mbuf: add new ptype for slow protocols

Message ID 20250704084502.237979-1-kuka@cesnet.cz (mailing list archive)
State Superseded
Delegated to: Thomas Monjalon
Headers
Series mbuf: add new ptype for slow protocols |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/aws-unit-testing success Unit Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-dts-check-format-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing warning Testing issues
ci/iol-sample-apps-testing fail Testing issues
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Mario Kuka July 4, 2025, 8:45 a.m. UTC
Introduce a new ptype for identifying slow protocol packets.

Signed-off-by: Mario Kuka <kuka@cesnet.cz>
---
 dts/framework/remote_session/testpmd_shell.py | 2 ++
 lib/mbuf/rte_mbuf_ptype.c                     | 1 +
 lib/mbuf/rte_mbuf_ptype.h                     | 7 +++++++
 3 files changed, 10 insertions(+)
  

Comments

Morten Brørup July 4, 2025, 9:38 a.m. UTC | #1
> diff --git a/lib/mbuf/rte_mbuf_ptype.h b/lib/mbuf/rte_mbuf_ptype.h
> index c46a94f89f..66c4eeb954 100644
> --- a/lib/mbuf/rte_mbuf_ptype.h
> +++ b/lib/mbuf/rte_mbuf_ptype.h
> @@ -144,6 +144,13 @@ extern "C" {
>   * <'ether type'=[0x8847|0x8848]>
>   */
>  #define RTE_PTYPE_L2_ETHER_MPLS             0x0000000a
> +/**
> + * Ethernet packet type for Slow Protocols.
> + *
> + * Packet format:
> + * <'ether type'=[0x8809]>
> + */
> +#define RTE_PTYPE_L2_ETHER_SLOW             0x0000000b

Matching 'ether type' doesn't suffice.
Slow protocols also require 'destination mac'=01-80-C2-00-00-02.
  

Patch

diff --git a/dts/framework/remote_session/testpmd_shell.py b/dts/framework/remote_session/testpmd_shell.py
index ac99bd09ef..8c3dda3ab4 100644
--- a/dts/framework/remote_session/testpmd_shell.py
+++ b/dts/framework/remote_session/testpmd_shell.py
@@ -1046,6 +1046,8 @@  class RtePTypes(Flag):
     L2_ETHER_FCOE = auto()
     #: MPLS packet type.
     L2_ETHER_MPLS = auto()
+    #: Ethernet packet type for Slow Protocols.
+    L2_ETHER_SLOW = auto()
     #: No L2 packet information.
     L2_UNKNOWN = auto()
 
diff --git a/lib/mbuf/rte_mbuf_ptype.c b/lib/mbuf/rte_mbuf_ptype.c
index 2c80294498..6f5926344f 100644
--- a/lib/mbuf/rte_mbuf_ptype.c
+++ b/lib/mbuf/rte_mbuf_ptype.c
@@ -23,6 +23,7 @@  const char *rte_get_ptype_l2_name(uint32_t ptype)
 	case RTE_PTYPE_L2_ETHER_PPPOE: return "L2_ETHER_PPPOE";
 	case RTE_PTYPE_L2_ETHER_FCOE: return "L2_ETHER_FCOE";
 	case RTE_PTYPE_L2_ETHER_MPLS: return "L2_ETHER_MPLS";
+	case RTE_PTYPE_L2_ETHER_SLOW: return "L2_ETHER_SLOW";
 	default: return "L2_UNKNOWN";
 	}
 }
diff --git a/lib/mbuf/rte_mbuf_ptype.h b/lib/mbuf/rte_mbuf_ptype.h
index c46a94f89f..66c4eeb954 100644
--- a/lib/mbuf/rte_mbuf_ptype.h
+++ b/lib/mbuf/rte_mbuf_ptype.h
@@ -144,6 +144,13 @@  extern "C" {
  * <'ether type'=[0x8847|0x8848]>
  */
 #define RTE_PTYPE_L2_ETHER_MPLS             0x0000000a
+/**
+ * Ethernet packet type for Slow Protocols.
+ *
+ * Packet format:
+ * <'ether type'=[0x8809]>
+ */
+#define RTE_PTYPE_L2_ETHER_SLOW             0x0000000b
 /**
  * Mask of layer 2 packet types.
  * It is used for outer packet for tunneling cases.