[2/2] mbuf: add MPLS packet type
diff mbox series

Message ID 20180826125455.27393-2-jerin.jacob@caviumnetworks.com
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show
Series
  • [1/2] mbuf: add FCoE packet type
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Jerin Jacob Aug. 26, 2018, 12:54 p.m. UTC
Add support of MPLS packet type.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 lib/librte_mbuf/rte_mbuf_ptype.c | 1 +
 lib/librte_mbuf/rte_mbuf_ptype.h | 7 +++++++
 2 files changed, 8 insertions(+)

Comments

Olivier Matz Oct. 23, 2018, 7:45 a.m. UTC | #1
On Sun, Aug 26, 2018 at 06:24:55PM +0530, Jerin Jacob wrote:
> Add support of MPLS packet type.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Acked-by: Olivier Matz <olivier.matz@6wind.com>
Olivier Matz Oct. 23, 2018, 7:48 a.m. UTC | #2
On Tue, Oct 23, 2018 at 09:45:33AM +0200, Olivier Matz wrote:
> On Sun, Aug 26, 2018 at 06:24:55PM +0530, Jerin Jacob wrote:
> > Add support of MPLS packet type.
> > 
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> 
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

By the way, I've just submitted an implementation of the software parser
for MPLS.

https://mails.dpdk.org/archives/dev/2018-October/116691.html

Patch
diff mbox series

diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index 71577f9b9..5954c2bc5 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -20,6 +20,7 @@  const char *rte_get_ptype_l2_name(uint32_t ptype)
 	case RTE_PTYPE_L2_ETHER_QINQ: return "L2_ETHER_QINQ";
 	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";
 	default: return "L2_UNKNOWN";
 	}
 }
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index 5693baeb8..8fe000a82 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -137,6 +137,13 @@  extern "C" {
  * <'ether type'=[0x8906]>
  */
 #define RTE_PTYPE_L2_ETHER_FCOE             0x00000009
+/**
+ * MPLS packet type.
+ *
+ * Packet format:
+ * <'ether type'=[0x8847|0x8848]>
+ */
+#define RTE_PTYPE_L2_ETHER_MPLS             0x0000000a
 /**
  * Mask of layer 2 packet types.
  * It is used for outer packet for tunneling cases.