mbuf: add IGMP packet type

Message ID 20180827123835.27531-1-jerin.jacob@caviumnetworks.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series mbuf: add IGMP packet type |

Checks

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

Commit Message

Jerin Jacob Aug. 27, 2018, 12:38 p.m. UTC
  Add support for IGMP 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 | 8 ++++++++
 2 files changed, 9 insertions(+)
  

Comments

Honnappa Nagarahalli Aug. 29, 2018, 5:35 a.m. UTC | #1
-----Original Message-----
From: dev <dev-bounces@dpdk.org> On Behalf Of Jerin Jacob
Sent: Monday, August 27, 2018 7:39 AM
To: dev@dpdk.org
Cc: olivier.matz@6wind.com; Jerin Jacob <jerin.jacob@caviumnetworks.com>
Subject: [dpdk-dev] [PATCH] mbuf: add IGMP packet type

Add support for IGMP 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 | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index d7835e283..b483a609d 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -47,6 +47,7 @@ const char *rte_get_ptype_l4_name(uint32_t ptype)
 	case RTE_PTYPE_L4_SCTP: return "L4_SCTP";
 	case RTE_PTYPE_L4_ICMP: return "L4_ICMP";
 	case RTE_PTYPE_L4_NONFRAG: return "L4_NONFRAG";
+	case RTE_PTYPE_L4_IGMP: return "L4_IGMP";
 	default: return "L4_UNKNOWN";
 	}
 }
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index 01acc66e2..00db3eeed 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -286,6 +286,14 @@ extern "C" {
  * | 'version'=6, 'next header'!=[6|17|44|132|1]>
  */
 #define RTE_PTYPE_L4_NONFRAG                0x00000600
+/**
+ * IGMP (Internet Group Management Protocol) packet type.
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=2, 'MF'=0, 'frag_offset'=0>  */
+#define RTE_PTYPE_L4_IGMP                   0x00000700
 /**
  * Mask of layer 4 packet types.
  * It is used for outer packet for tunneling cases.
--
2.18.0

Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
  
Andrew Rybchenko Aug. 29, 2018, 7:07 a.m. UTC | #2
On 08/27/2018 03:38 PM, Jerin Jacob wrote:
> Add support for IGMP packet type.
>
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
  
Stephen Hemminger Aug. 29, 2018, 3:31 p.m. UTC | #3
On Mon, 27 Aug 2018 18:08:35 +0530
Jerin Jacob <jerin.jacob@caviumnetworks.com> wrote:

> Add support for IGMP packet type.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Could you add logic to recoginize IGMP to the software packet type identification
rte_net_get_ptype used by drivers that don't have hardware support.

Also shouldn't this bit be part of RTE_PTYPE_L4_MASK?
  
Jerin Jacob Aug. 29, 2018, 3:59 p.m. UTC | #4
-----Original Message-----
> Date: Wed, 29 Aug 2018 08:31:10 -0700
> From: Stephen Hemminger <stephen@networkplumber.org>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> Cc: dev@dpdk.org, olivier.matz@6wind.com
> Subject: Re: [dpdk-dev]  [PATCH] mbuf: add IGMP packet type
> 
> External Email
> 
> On Mon, 27 Aug 2018 18:08:35 +0530
> Jerin Jacob <jerin.jacob@caviumnetworks.com> wrote:
> 
> > Add support for IGMP packet type.
> >
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> 
> Could you add logic to recoginize IGMP to the software packet type identification
> rte_net_get_ptype used by drivers that don't have hardware support.

If everyone agrees then I can do it as adding IGMP support will reduce
the performance of rte_net_get_ptype() and most of the NIC may not need it.

Opinions?

> 
> Also shouldn't this bit be part of RTE_PTYPE_L4_MASK?

The RTE_PTYPE_L4_MASK is 0x00000f00 so it is part it. Right?

>
  
Stephen Hemminger Aug. 29, 2018, 4:34 p.m. UTC | #5
On Wed, 29 Aug 2018 21:29:05 +0530
Jerin Jacob <jerin.jacob@caviumnetworks.com> wrote:

> -----Original Message-----
> > Date: Wed, 29 Aug 2018 08:31:10 -0700
> > From: Stephen Hemminger <stephen@networkplumber.org>
> > To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > Cc: dev@dpdk.org, olivier.matz@6wind.com
> > Subject: Re: [dpdk-dev]  [PATCH] mbuf: add IGMP packet type
> > 
> > External Email
> > 
> > On Mon, 27 Aug 2018 18:08:35 +0530
> > Jerin Jacob <jerin.jacob@caviumnetworks.com> wrote:
> >   
> > > Add support for IGMP packet type.
> > >
> > > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>  
> > 
> > Could you add logic to recoginize IGMP to the software packet type identification
> > rte_net_get_ptype used by drivers that don't have hardware support.  
> 
> If everyone agrees then I can do it as adding IGMP support will reduce
> the performance of rte_net_get_ptype() and most of the NIC may not need it.
> 
> Opinions?
> 
> > 
> > Also shouldn't this bit be part of RTE_PTYPE_L4_MASK?  
> 
> The RTE_PTYPE_L4_MASK is 0x00000f00 so it is part it. Right?

Then you must add it to the software matcher since most drivers are advertising L4_MASK
  
Stephen Hemminger Aug. 29, 2018, 4:38 p.m. UTC | #6
On Wed, 29 Aug 2018 21:29:05 +0530
Jerin Jacob <jerin.jacob@caviumnetworks.com> wrote:

> -----Original Message-----
> > Date: Wed, 29 Aug 2018 08:31:10 -0700
> > From: Stephen Hemminger <stephen@networkplumber.org>
> > To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > Cc: dev@dpdk.org, olivier.matz@6wind.com
> > Subject: Re: [dpdk-dev]  [PATCH] mbuf: add IGMP packet type
> > 
> > External Email
> > 
> > On Mon, 27 Aug 2018 18:08:35 +0530
> > Jerin Jacob <jerin.jacob@caviumnetworks.com> wrote:
> >   
> > > Add support for IGMP packet type.
> > >
> > > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>  
> > 
> > Could you add logic to recoginize IGMP to the software packet type identification
> > rte_net_get_ptype used by drivers that don't have hardware support.  
> 
> If everyone agrees then I can do it as adding IGMP support will reduce
> the performance of rte_net_get_ptype() and most of the NIC may not need it.

Since IGMP is an IP protocol field and the code is already looking for
TCP and UDP, how could adding another else slow it down in any observable way.
  
Jerin Jacob Aug. 29, 2018, 4:40 p.m. UTC | #7
-----Original Message-----
> Date: Wed, 29 Aug 2018 09:34:36 -0700
> From: Stephen Hemminger <stephen@networkplumber.org>
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> Cc: dev@dpdk.org, olivier.matz@6wind.com
> Subject: Re: [dpdk-dev]  [PATCH] mbuf: add IGMP packet type
> 
> External Email
> 
> On Wed, 29 Aug 2018 21:29:05 +0530
> Jerin Jacob <jerin.jacob@caviumnetworks.com> wrote:
> 
> > -----Original Message-----
> > > Date: Wed, 29 Aug 2018 08:31:10 -0700
> > > From: Stephen Hemminger <stephen@networkplumber.org>
> > > To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > > Cc: dev@dpdk.org, olivier.matz@6wind.com
> > > Subject: Re: [dpdk-dev]  [PATCH] mbuf: add IGMP packet type
> > >
> > > External Email
> > >
> > > On Mon, 27 Aug 2018 18:08:35 +0530
> > > Jerin Jacob <jerin.jacob@caviumnetworks.com> wrote:
> > >
> > > > Add support for IGMP packet type.
> > > >
> > > > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > >
> > > Could you add logic to recoginize IGMP to the software packet type identification
> > > rte_net_get_ptype used by drivers that don't have hardware support.
> >
> > If everyone agrees then I can do it as adding IGMP support will reduce
> > the performance of rte_net_get_ptype() and most of the NIC may not need it.
> >
> > Opinions?
> >
> > >
> > > Also shouldn't this bit be part of RTE_PTYPE_L4_MASK?
> >
> > The RTE_PTYPE_L4_MASK is 0x00000f00 so it is part it. Right?
> 
> Then you must add it to the software matcher since most drivers are advertising L4_MASK

Which driver returns .dev_supported_ptypes_get ethdev ops with L4_MASK?

>
  
Olivier Matz Oct. 23, 2018, 9:20 a.m. UTC | #8
On Mon, Aug 27, 2018 at 06:08:35PM +0530, Jerin Jacob wrote:
> Add support for IGMP packet type.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Acked-by: Olivier Matz <olivier.matz@6wind.com>
  
Thomas Monjalon Oct. 25, 2018, 1:57 p.m. UTC | #9
23/10/2018 11:20, Olivier Matz:
> On Mon, Aug 27, 2018 at 06:08:35PM +0530, Jerin Jacob wrote:
> > Add support for IGMP packet type.
> > 
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> 
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_mbuf/rte_mbuf_ptype.c b/lib/librte_mbuf/rte_mbuf_ptype.c
index d7835e283..b483a609d 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.c
+++ b/lib/librte_mbuf/rte_mbuf_ptype.c
@@ -47,6 +47,7 @@  const char *rte_get_ptype_l4_name(uint32_t ptype)
 	case RTE_PTYPE_L4_SCTP: return "L4_SCTP";
 	case RTE_PTYPE_L4_ICMP: return "L4_ICMP";
 	case RTE_PTYPE_L4_NONFRAG: return "L4_NONFRAG";
+	case RTE_PTYPE_L4_IGMP: return "L4_IGMP";
 	default: return "L4_UNKNOWN";
 	}
 }
diff --git a/lib/librte_mbuf/rte_mbuf_ptype.h b/lib/librte_mbuf/rte_mbuf_ptype.h
index 01acc66e2..00db3eeed 100644
--- a/lib/librte_mbuf/rte_mbuf_ptype.h
+++ b/lib/librte_mbuf/rte_mbuf_ptype.h
@@ -286,6 +286,14 @@  extern "C" {
  * | 'version'=6, 'next header'!=[6|17|44|132|1]>
  */
 #define RTE_PTYPE_L4_NONFRAG                0x00000600
+/**
+ * IGMP (Internet Group Management Protocol) packet type.
+ *
+ * Packet format:
+ * <'ether type'=0x0800
+ * | 'version'=4, 'protocol'=2, 'MF'=0, 'frag_offset'=0>
+ */
+#define RTE_PTYPE_L4_IGMP                   0x00000700
 /**
  * Mask of layer 4 packet types.
  * It is used for outer packet for tunneling cases.