patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] app/testpmd: add parsing for multiple VLAN headers
@ 2020-04-20 15:32 Raslan Darawsheh
  2020-04-21 14:54 ` Iremonger, Bernard
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Raslan Darawsheh @ 2020-04-20 15:32 UTC (permalink / raw)
  To: bernard.iremonger, jingjing.wu, wenzhuo.lu; +Cc: dev, stable

When having multiple VLANs in the packet, parse_ethernet
is cabable of parsing only the first vlan.

add parsing for mutliple VLAN headers in the packet.

Fixes: 51f694dd40f5 ("app/testpmd: rework checksum forward engine")
Cc: stable@dpdk.org

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
---
 app/test-pmd/csumonly.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index fe19615..b0665f7 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -139,22 +139,22 @@ parse_ipv6(struct rte_ipv6_hdr *ipv6_hdr, struct testpmd_offload_info *info)
 
 /*
  * Parse an ethernet header to fill the ethertype, l2_len, l3_len and
- * ipproto. This function is able to recognize IPv4/IPv6 with one optional vlan
- * header. The l4_len argument is only set in case of TCP (useful for TSO).
+ * ipproto. This function is able to recognize IPv4/IPv6 with optional VLAN
+ * headers. The l4_len argument is only set in case of TCP (useful for TSO).
  */
 static void
 parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_info *info)
 {
 	struct rte_ipv4_hdr *ipv4_hdr;
 	struct rte_ipv6_hdr *ipv6_hdr;
+	struct rte_vlan_hdr *vlan_hdr;
 
 	info->l2_len = sizeof(struct rte_ether_hdr);
 	info->ethertype = eth_hdr->ether_type;
 
-	if (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) {
-		struct rte_vlan_hdr *vlan_hdr = (
-			struct rte_vlan_hdr *)(eth_hdr + 1);
-
+	while (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) {
+		vlan_hdr = (struct rte_vlan_hdr *)
+			((char *)eth_hdr + info->l2_len);
 		info->l2_len  += sizeof(struct rte_vlan_hdr);
 		info->ethertype = vlan_hdr->eth_proto;
 	}
-- 
2.7.4


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-stable] [PATCH] app/testpmd: add parsing for multiple VLAN headers
  2020-04-20 15:32 [dpdk-stable] [PATCH] app/testpmd: add parsing for multiple VLAN headers Raslan Darawsheh
@ 2020-04-21 14:54 ` Iremonger, Bernard
  2020-04-21 20:47 ` [dpdk-stable] [dpdk-dev] " Ferruh Yigit
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Iremonger, Bernard @ 2020-04-21 14:54 UTC (permalink / raw)
  To: Raslan Darawsheh, Wu, Jingjing, Lu, Wenzhuo; +Cc: dev, stable

> -----Original Message-----
> From: Raslan Darawsheh <rasland@mellanox.com>
> Sent: Monday, April 20, 2020 4:32 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] app/testpmd: add parsing for multiple VLAN headers
> 
> When having multiple VLANs in the packet, parse_ethernet is cabable of
> parsing only the first vlan.
> 
> add parsing for mutliple VLAN headers in the packet.
> 
> Fixes: 51f694dd40f5 ("app/testpmd: rework checksum forward engine")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>

Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] app/testpmd: add parsing for multiple VLAN headers
  2020-04-20 15:32 [dpdk-stable] [PATCH] app/testpmd: add parsing for multiple VLAN headers Raslan Darawsheh
  2020-04-21 14:54 ` Iremonger, Bernard
@ 2020-04-21 20:47 ` Ferruh Yigit
  2020-04-22 11:05   ` Iremonger, Bernard
  2020-04-22  7:22 ` Ori Kam
  2020-04-23  8:41 ` [dpdk-stable] [PATCH v2] " Raslan Darawsheh
  3 siblings, 1 reply; 11+ messages in thread
From: Ferruh Yigit @ 2020-04-21 20:47 UTC (permalink / raw)
  To: Raslan Darawsheh, bernard.iremonger, jingjing.wu, wenzhuo.lu; +Cc: dev, stable

On 4/20/2020 4:32 PM, Raslan Darawsheh wrote:
> When having multiple VLANs in the packet, parse_ethernet
> is cabable of parsing only the first vlan.
> 
> add parsing for mutliple VLAN headers in the packet.
> 
> Fixes: 51f694dd40f5 ("app/testpmd: rework checksum forward engine")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
> ---
>  app/test-pmd/csumonly.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
> index fe19615..b0665f7 100644
> --- a/app/test-pmd/csumonly.c
> +++ b/app/test-pmd/csumonly.c
> @@ -139,22 +139,22 @@ parse_ipv6(struct rte_ipv6_hdr *ipv6_hdr, struct testpmd_offload_info *info)
>  
>  /*
>   * Parse an ethernet header to fill the ethertype, l2_len, l3_len and
> - * ipproto. This function is able to recognize IPv4/IPv6 with one optional vlan
> - * header. The l4_len argument is only set in case of TCP (useful for TSO).
> + * ipproto. This function is able to recognize IPv4/IPv6 with optional VLAN
> + * headers. The l4_len argument is only set in case of TCP (useful for TSO).
>   */
>  static void
>  parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_info *info)
>  {
>  	struct rte_ipv4_hdr *ipv4_hdr;
>  	struct rte_ipv6_hdr *ipv6_hdr;
> +	struct rte_vlan_hdr *vlan_hdr;
>  
>  	info->l2_len = sizeof(struct rte_ether_hdr);
>  	info->ethertype = eth_hdr->ether_type;
>  
> -	if (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) {
> -		struct rte_vlan_hdr *vlan_hdr = (
> -			struct rte_vlan_hdr *)(eth_hdr + 1);
> -
> +	while (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) {
> +		vlan_hdr = (struct rte_vlan_hdr *)
> +			((char *)eth_hdr + info->l2_len);
>  		info->l2_len  += sizeof(struct rte_vlan_hdr);
>  		info->ethertype = vlan_hdr->eth_proto;
>  	}
> 

Can an ethernet packet have multiple VLAN header, according IEEE 802.1Q there
can be only single VLAN header, if this is for QinQ will both TPID be same and
0x8100 (RTE_ETHER_TYPE_VLAN)?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] app/testpmd: add parsing for multiple VLAN headers
  2020-04-20 15:32 [dpdk-stable] [PATCH] app/testpmd: add parsing for multiple VLAN headers Raslan Darawsheh
  2020-04-21 14:54 ` Iremonger, Bernard
  2020-04-21 20:47 ` [dpdk-stable] [dpdk-dev] " Ferruh Yigit
@ 2020-04-22  7:22 ` Ori Kam
  2020-04-23  8:41 ` [dpdk-stable] [PATCH v2] " Raslan Darawsheh
  3 siblings, 0 replies; 11+ messages in thread
From: Ori Kam @ 2020-04-22  7:22 UTC (permalink / raw)
  To: Raslan Darawsheh, bernard.iremonger, jingjing.wu, wenzhuo.lu; +Cc: dev, stable



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Raslan Darawsheh
> Sent: Monday, April 20, 2020 6:32 PM
> To: bernard.iremonger@intel.com; jingjing.wu@intel.com;
> wenzhuo.lu@intel.com
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] app/testpmd: add parsing for multiple VLAN
> headers
> 
> When having multiple VLANs in the packet, parse_ethernet
> is cabable of parsing only the first vlan.
> 
> add parsing for mutliple VLAN headers in the packet.
> 
> Fixes: 51f694dd40f5 ("app/testpmd: rework checksum forward engine")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
> ---
>  app/test-pmd/csumonly.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
> index fe19615..b0665f7 100644
> --- a/app/test-pmd/csumonly.c
> +++ b/app/test-pmd/csumonly.c
> @@ -139,22 +139,22 @@ parse_ipv6(struct rte_ipv6_hdr *ipv6_hdr, struct
> testpmd_offload_info *info)
> 
>  /*
>   * Parse an ethernet header to fill the ethertype, l2_len, l3_len and
> - * ipproto. This function is able to recognize IPv4/IPv6 with one optional vlan
> - * header. The l4_len argument is only set in case of TCP (useful for TSO).
> + * ipproto. This function is able to recognize IPv4/IPv6 with optional VLAN
> + * headers. The l4_len argument is only set in case of TCP (useful for TSO).
>   */
>  static void
>  parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_info
> *info)
>  {
>  	struct rte_ipv4_hdr *ipv4_hdr;
>  	struct rte_ipv6_hdr *ipv6_hdr;
> +	struct rte_vlan_hdr *vlan_hdr;
> 
>  	info->l2_len = sizeof(struct rte_ether_hdr);
>  	info->ethertype = eth_hdr->ether_type;
> 
> -	if (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) {
> -		struct rte_vlan_hdr *vlan_hdr = (
> -			struct rte_vlan_hdr *)(eth_hdr + 1);
> -
> +	while (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) {
> +		vlan_hdr = (struct rte_vlan_hdr *)
> +			((char *)eth_hdr + info->l2_len);
>  		info->l2_len  += sizeof(struct rte_vlan_hdr);
>  		info->ethertype = vlan_hdr->eth_proto;
>  	}
> --


Acked-by: Ori Kam <orika@mellanox.com>
Thanks,
Ori
> 2.7.4


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] app/testpmd: add parsing for multiple VLAN headers
  2020-04-21 20:47 ` [dpdk-stable] [dpdk-dev] " Ferruh Yigit
@ 2020-04-22 11:05   ` Iremonger, Bernard
  2020-04-22 11:28     ` Raslan Darawsheh
  0 siblings, 1 reply; 11+ messages in thread
From: Iremonger, Bernard @ 2020-04-22 11:05 UTC (permalink / raw)
  To: Yigit, Ferruh, Raslan Darawsheh, Wu, Jingjing, Lu, Wenzhuo; +Cc: dev, stable

Hi Ferruh, Raslan,

> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit@intel.com>
> Sent: Tuesday, April 21, 2020 9:48 PM
> To: Raslan Darawsheh <rasland@mellanox.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Lu,
> Wenzhuo <wenzhuo.lu@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] app/testpmd: add parsing for multiple
> VLAN headers
> 
> On 4/20/2020 4:32 PM, Raslan Darawsheh wrote:
> > When having multiple VLANs in the packet, parse_ethernet is cabable of
> > parsing only the first vlan.
> >
> > add parsing for mutliple VLAN headers in the packet.
> >
> > Fixes: 51f694dd40f5 ("app/testpmd: rework checksum forward engine")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
> > ---
> >  app/test-pmd/csumonly.c | 12 ++++++------
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index
> > fe19615..b0665f7 100644
> > --- a/app/test-pmd/csumonly.c
> > +++ b/app/test-pmd/csumonly.c
> > @@ -139,22 +139,22 @@ parse_ipv6(struct rte_ipv6_hdr *ipv6_hdr, struct
> > testpmd_offload_info *info)
> >
> >  /*
> >   * Parse an ethernet header to fill the ethertype, l2_len, l3_len and
> > - * ipproto. This function is able to recognize IPv4/IPv6 with one
> > optional vlan
> > - * header. The l4_len argument is only set in case of TCP (useful for TSO).
> > + * ipproto. This function is able to recognize IPv4/IPv6 with
> > + optional VLAN
> > + * headers. The l4_len argument is only set in case of TCP (useful for TSO).
> >   */
> >  static void
> >  parse_ethernet(struct rte_ether_hdr *eth_hdr, struct
> > testpmd_offload_info *info)  {
> >  	struct rte_ipv4_hdr *ipv4_hdr;
> >  	struct rte_ipv6_hdr *ipv6_hdr;
> > +	struct rte_vlan_hdr *vlan_hdr;
> >
> >  	info->l2_len = sizeof(struct rte_ether_hdr);
> >  	info->ethertype = eth_hdr->ether_type;
> >
> > -	if (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) {
> > -		struct rte_vlan_hdr *vlan_hdr = (
> > -			struct rte_vlan_hdr *)(eth_hdr + 1);
> > -
> > +	while (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) {
> > +		vlan_hdr = (struct rte_vlan_hdr *)
> > +			((char *)eth_hdr + info->l2_len);
> >  		info->l2_len  += sizeof(struct rte_vlan_hdr);
> >  		info->ethertype = vlan_hdr->eth_proto;
> >  	}
> >
> 
> Can an ethernet packet have multiple VLAN header, according IEEE 802.1Q
> there can be only single VLAN header, if this is for QinQ will both TPID be
> same and
> 0x8100 (RTE_ETHER_TYPE_VLAN)?

There is also 0x88a8 (RTE_ETHER_TYPE_QINQ), IEEE 802.1ad QinQ tagging, both values should probably be checked.

Regards,

Bernard.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] app/testpmd: add parsing for multiple VLAN headers
  2020-04-22 11:05   ` Iremonger, Bernard
@ 2020-04-22 11:28     ` Raslan Darawsheh
  0 siblings, 0 replies; 11+ messages in thread
From: Raslan Darawsheh @ 2020-04-22 11:28 UTC (permalink / raw)
  To: Iremonger, Bernard, Yigit, Ferruh, Wu, Jingjing, Lu, Wenzhuo; +Cc: dev, stable

Hi,

> -----Original Message-----
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> Sent: Wednesday, April 22, 2020 2:05 PM
> To: Yigit, Ferruh <ferruh.yigit@intel.com>; Raslan Darawsheh
> <rasland@mellanox.com>; Wu, Jingjing <jingjing.wu@intel.com>; Lu,
> Wenzhuo <wenzhuo.lu@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH] app/testpmd: add parsing for multiple VLAN
> headers
> 
> Hi Ferruh, Raslan,
> 
> > -----Original Message-----
> > From: Yigit, Ferruh <ferruh.yigit@intel.com>
> > Sent: Tuesday, April 21, 2020 9:48 PM
> > To: Raslan Darawsheh <rasland@mellanox.com>; Iremonger, Bernard
> > <bernard.iremonger@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Lu,
> > Wenzhuo <wenzhuo.lu@intel.com>
> > Cc: dev@dpdk.org; stable@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH] app/testpmd: add parsing for multiple
> > VLAN headers
> >
> > On 4/20/2020 4:32 PM, Raslan Darawsheh wrote:
> > > When having multiple VLANs in the packet, parse_ethernet is cabable of
> > > parsing only the first vlan.
> > >
> > > add parsing for mutliple VLAN headers in the packet.
> > >
> > > Fixes: 51f694dd40f5 ("app/testpmd: rework checksum forward engine")
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
> > > ---
> > >  app/test-pmd/csumonly.c | 12 ++++++------
> > >  1 file changed, 6 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index
> > > fe19615..b0665f7 100644
> > > --- a/app/test-pmd/csumonly.c
> > > +++ b/app/test-pmd/csumonly.c
> > > @@ -139,22 +139,22 @@ parse_ipv6(struct rte_ipv6_hdr *ipv6_hdr,
> struct
> > > testpmd_offload_info *info)
> > >
> > >  /*
> > >   * Parse an ethernet header to fill the ethertype, l2_len, l3_len and
> > > - * ipproto. This function is able to recognize IPv4/IPv6 with one
> > > optional vlan
> > > - * header. The l4_len argument is only set in case of TCP (useful for TSO).
> > > + * ipproto. This function is able to recognize IPv4/IPv6 with
> > > + optional VLAN
> > > + * headers. The l4_len argument is only set in case of TCP (useful for
> TSO).
> > >   */
> > >  static void
> > >  parse_ethernet(struct rte_ether_hdr *eth_hdr, struct
> > > testpmd_offload_info *info)  {
> > >  	struct rte_ipv4_hdr *ipv4_hdr;
> > >  	struct rte_ipv6_hdr *ipv6_hdr;
> > > +	struct rte_vlan_hdr *vlan_hdr;
> > >
> > >  	info->l2_len = sizeof(struct rte_ether_hdr);
> > >  	info->ethertype = eth_hdr->ether_type;
> > >
> > > -	if (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) {
> > > -		struct rte_vlan_hdr *vlan_hdr = (
> > > -			struct rte_vlan_hdr *)(eth_hdr + 1);
> > > -
> > > +	while (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) {
> > > +		vlan_hdr = (struct rte_vlan_hdr *)
> > > +			((char *)eth_hdr + info->l2_len);
> > >  		info->l2_len  += sizeof(struct rte_vlan_hdr);
> > >  		info->ethertype = vlan_hdr->eth_proto;
> > >  	}
> > >
> >
> > Can an ethernet packet have multiple VLAN header, according IEEE 802.1Q
> > there can be only single VLAN header, if this is for QinQ will both TPID be
> > same and
> > 0x8100 (RTE_ETHER_TYPE_VLAN)?
@Yigit, Ferruh,
If we are talking about QinQ then the value that need to be checked is (RTE_ETHER_TYPE_QINQ) you are right,

> 
> There is also 0x88a8 (RTE_ETHER_TYPE_QINQ), IEEE 802.1ad QinQ tagging,
> both values should probably be checked.
Yes you are right, I'll update the patch to check for both of them, will send v2 shortly

> 
> Regards,
> 
> Bernard.

Kindest regards
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [dpdk-stable] [PATCH v2] app/testpmd: add parsing for multiple VLAN headers
  2020-04-20 15:32 [dpdk-stable] [PATCH] app/testpmd: add parsing for multiple VLAN headers Raslan Darawsheh
                   ` (2 preceding siblings ...)
  2020-04-22  7:22 ` Ori Kam
@ 2020-04-23  8:41 ` Raslan Darawsheh
  2020-04-23  8:59   ` Iremonger, Bernard
  2020-04-23  9:05   ` [dpdk-stable] [PATCH v3] app/testpmd: add parsing for QINQ " Raslan Darawsheh
  3 siblings, 2 replies; 11+ messages in thread
From: Raslan Darawsheh @ 2020-04-23  8:41 UTC (permalink / raw)
  To: bernard.iremonger, jingjing.wu, wenzhuo.lu; +Cc: ferruh.yigit, dev, stable

When having multiple VLANs in the packet, parse_ethernet
is cabable of parsing only the first vlan.

add parsing for mutliple VLAN headers in the packet.

Fixes: 51f694dd40f5 ("app/testpmd: rework checksum forward engine")
Cc: stable@dpdk.org

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
v2: added QinQ to check for multiple vlan's
---
 app/test-pmd/csumonly.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index fe19615..8626223 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -139,22 +139,23 @@ parse_ipv6(struct rte_ipv6_hdr *ipv6_hdr, struct testpmd_offload_info *info)
 
 /*
  * Parse an ethernet header to fill the ethertype, l2_len, l3_len and
- * ipproto. This function is able to recognize IPv4/IPv6 with one optional vlan
- * header. The l4_len argument is only set in case of TCP (useful for TSO).
+ * ipproto. This function is able to recognize IPv4/IPv6 with optional VLAN
+ * headers. The l4_len argument is only set in case of TCP (useful for TSO).
  */
 static void
 parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_info *info)
 {
 	struct rte_ipv4_hdr *ipv4_hdr;
 	struct rte_ipv6_hdr *ipv6_hdr;
+	struct rte_vlan_hdr *vlan_hdr;
 
 	info->l2_len = sizeof(struct rte_ether_hdr);
 	info->ethertype = eth_hdr->ether_type;
 
-	if (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) {
-		struct rte_vlan_hdr *vlan_hdr = (
-			struct rte_vlan_hdr *)(eth_hdr + 1);
-
+	while (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN) ||
+	       info->ethertype == _htons(RTE_ETHER_TYPE_QINQ)) {
+		vlan_hdr = (struct rte_vlan_hdr *)
+			((char *)eth_hdr + info->l2_len);
 		info->l2_len  += sizeof(struct rte_vlan_hdr);
 		info->ethertype = vlan_hdr->eth_proto;
 	}
-- 
2.7.4


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-stable] [PATCH v2] app/testpmd: add parsing for multiple VLAN headers
  2020-04-23  8:41 ` [dpdk-stable] [PATCH v2] " Raslan Darawsheh
@ 2020-04-23  8:59   ` Iremonger, Bernard
  2020-04-23  9:01     ` Raslan Darawsheh
  2020-04-23  9:05   ` [dpdk-stable] [PATCH v3] app/testpmd: add parsing for QINQ " Raslan Darawsheh
  1 sibling, 1 reply; 11+ messages in thread
From: Iremonger, Bernard @ 2020-04-23  8:59 UTC (permalink / raw)
  To: Raslan Darawsheh, Wu, Jingjing, Lu, Wenzhuo; +Cc: Yigit, Ferruh, dev, stable

Hi Raslan,

> -----Original Message-----
> From: Raslan Darawsheh <rasland@mellanox.com>
> Sent: Thursday, April 23, 2020 9:41 AM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH v2] app/testpmd: add parsing for multiple VLAN headers

Might be better to replace "multiple" with QINQ in the commit message.
 
> When having multiple VLANs in the packet, parse_ethernet is cabable of

Might be better to replace "multiple" with QINQ

> parsing only the first vlan.
> 
> add parsing for mutliple VLAN headers in the packet.

Might be better to replace "multiple" with QINQ

> 
> Fixes: 51f694dd40f5 ("app/testpmd: rework checksum forward engine")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
> Acked-by: Ori Kam <orika@mellanox.com>
> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
> v2: added QinQ to check for multiple vlan's
> ---
>  app/test-pmd/csumonly.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index
> fe19615..8626223 100644
> --- a/app/test-pmd/csumonly.c
> +++ b/app/test-pmd/csumonly.c
> @@ -139,22 +139,23 @@ parse_ipv6(struct rte_ipv6_hdr *ipv6_hdr, struct
> testpmd_offload_info *info)
> 
>  /*
>   * Parse an ethernet header to fill the ethertype, l2_len, l3_len and
> - * ipproto. This function is able to recognize IPv4/IPv6 with one optional vlan
> - * header. The l4_len argument is only set in case of TCP (useful for TSO).
> + * ipproto. This function is able to recognize IPv4/IPv6 with optional
> + VLAN
> + * headers. The l4_len argument is only set in case of TCP (useful for TSO).
>   */
>  static void
>  parse_ethernet(struct rte_ether_hdr *eth_hdr, struct
> testpmd_offload_info *info)  {
>  	struct rte_ipv4_hdr *ipv4_hdr;
>  	struct rte_ipv6_hdr *ipv6_hdr;
> +	struct rte_vlan_hdr *vlan_hdr;
> 
>  	info->l2_len = sizeof(struct rte_ether_hdr);
>  	info->ethertype = eth_hdr->ether_type;
> 
> -	if (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) {
> -		struct rte_vlan_hdr *vlan_hdr = (
> -			struct rte_vlan_hdr *)(eth_hdr + 1);
> -
> +	while (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN) ||
> +	       info->ethertype == _htons(RTE_ETHER_TYPE_QINQ)) {
> +		vlan_hdr = (struct rte_vlan_hdr *)
> +			((char *)eth_hdr + info->l2_len);
>  		info->l2_len  += sizeof(struct rte_vlan_hdr);
>  		info->ethertype = vlan_hdr->eth_proto;
>  	}
> --
> 2.7.4
Otherwise

Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-stable] [PATCH v2] app/testpmd: add parsing for multiple VLAN headers
  2020-04-23  8:59   ` Iremonger, Bernard
@ 2020-04-23  9:01     ` Raslan Darawsheh
  0 siblings, 0 replies; 11+ messages in thread
From: Raslan Darawsheh @ 2020-04-23  9:01 UTC (permalink / raw)
  To: Iremonger, Bernard, Wu, Jingjing, Lu, Wenzhuo; +Cc: Yigit, Ferruh, dev, stable

Hi,

> -----Original Message-----
> From: Iremonger, Bernard <bernard.iremonger@intel.com>
> Sent: Thursday, April 23, 2020 12:00 PM
> To: Raslan Darawsheh <rasland@mellanox.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; dev@dpdk.org; stable@dpdk.org
> Subject: RE: [PATCH v2] app/testpmd: add parsing for multiple VLAN headers
> 
> Hi Raslan,
> 
> > -----Original Message-----
> > From: Raslan Darawsheh <rasland@mellanox.com>
> > Sent: Thursday, April 23, 2020 9:41 AM
> > To: Iremonger, Bernard <bernard.iremonger@intel.com>; Wu, Jingjing
> > <jingjing.wu@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>
> > Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; dev@dpdk.org;
> stable@dpdk.org
> > Subject: [PATCH v2] app/testpmd: add parsing for multiple VLAN headers
> 
> Might be better to replace "multiple" with QINQ in the commit message.
> 
> > When having multiple VLANs in the packet, parse_ethernet is cabable of
> 
> Might be better to replace "multiple" with QINQ
> 
> > parsing only the first vlan.
> >
> > add parsing for mutliple VLAN headers in the packet.
> 
> Might be better to replace "multiple" with QINQ

Sure, will handle in v3

> 
> >
> > Fixes: 51f694dd40f5 ("app/testpmd: rework checksum forward engine")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
> > Acked-by: Ori Kam <orika@mellanox.com>
> > Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> > v2: added QinQ to check for multiple vlan's
> > ---
> >  app/test-pmd/csumonly.c | 13 +++++++------
> >  1 file changed, 7 insertions(+), 6 deletions(-)
> >
> > diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index
> > fe19615..8626223 100644
> > --- a/app/test-pmd/csumonly.c
> > +++ b/app/test-pmd/csumonly.c
> > @@ -139,22 +139,23 @@ parse_ipv6(struct rte_ipv6_hdr *ipv6_hdr, struct
> > testpmd_offload_info *info)
> >
> >  /*
> >   * Parse an ethernet header to fill the ethertype, l2_len, l3_len and
> > - * ipproto. This function is able to recognize IPv4/IPv6 with one optional
> vlan
> > - * header. The l4_len argument is only set in case of TCP (useful for TSO).
> > + * ipproto. This function is able to recognize IPv4/IPv6 with optional
> > + VLAN
> > + * headers. The l4_len argument is only set in case of TCP (useful for TSO).
> >   */
> >  static void
> >  parse_ethernet(struct rte_ether_hdr *eth_hdr, struct
> > testpmd_offload_info *info)  {
> >  	struct rte_ipv4_hdr *ipv4_hdr;
> >  	struct rte_ipv6_hdr *ipv6_hdr;
> > +	struct rte_vlan_hdr *vlan_hdr;
> >
> >  	info->l2_len = sizeof(struct rte_ether_hdr);
> >  	info->ethertype = eth_hdr->ether_type;
> >
> > -	if (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) {
> > -		struct rte_vlan_hdr *vlan_hdr = (
> > -			struct rte_vlan_hdr *)(eth_hdr + 1);
> > -
> > +	while (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN) ||
> > +	       info->ethertype == _htons(RTE_ETHER_TYPE_QINQ)) {
> > +		vlan_hdr = (struct rte_vlan_hdr *)
> > +			((char *)eth_hdr + info->l2_len);
> >  		info->l2_len  += sizeof(struct rte_vlan_hdr);
> >  		info->ethertype = vlan_hdr->eth_proto;
> >  	}
> > --
> > 2.7.4
> Otherwise
> 
> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>

Kindest regards,
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [dpdk-stable] [PATCH v3] app/testpmd: add parsing for QINQ VLAN headers
  2020-04-23  8:41 ` [dpdk-stable] [PATCH v2] " Raslan Darawsheh
  2020-04-23  8:59   ` Iremonger, Bernard
@ 2020-04-23  9:05   ` Raslan Darawsheh
  2020-04-24 16:35     ` Ferruh Yigit
  1 sibling, 1 reply; 11+ messages in thread
From: Raslan Darawsheh @ 2020-04-23  9:05 UTC (permalink / raw)
  To: bernard.iremonger, jingjing.wu, wenzhuo.lu; +Cc: ferruh.yigit, dev, stable

When having QINQ VLAN headers in the packet, parse_ethernet
is cabable of parsing only the first vlan.

add parsing for QINQ VLAN headers in the packet.

Fixes: 51f694dd40f5 ("app/testpmd: rework checksum forward engine")
Cc: stable@dpdk.org

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
v2: added QinQ to check for multiple vlan's
v3: reword commit to replace Multiple with QINQ
---
 app/test-pmd/csumonly.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index fe19615..8626223 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -139,22 +139,23 @@ parse_ipv6(struct rte_ipv6_hdr *ipv6_hdr, struct testpmd_offload_info *info)
 
 /*
  * Parse an ethernet header to fill the ethertype, l2_len, l3_len and
- * ipproto. This function is able to recognize IPv4/IPv6 with one optional vlan
- * header. The l4_len argument is only set in case of TCP (useful for TSO).
+ * ipproto. This function is able to recognize IPv4/IPv6 with optional VLAN
+ * headers. The l4_len argument is only set in case of TCP (useful for TSO).
  */
 static void
 parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_info *info)
 {
 	struct rte_ipv4_hdr *ipv4_hdr;
 	struct rte_ipv6_hdr *ipv6_hdr;
+	struct rte_vlan_hdr *vlan_hdr;
 
 	info->l2_len = sizeof(struct rte_ether_hdr);
 	info->ethertype = eth_hdr->ether_type;
 
-	if (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) {
-		struct rte_vlan_hdr *vlan_hdr = (
-			struct rte_vlan_hdr *)(eth_hdr + 1);
-
+	while (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN) ||
+	       info->ethertype == _htons(RTE_ETHER_TYPE_QINQ)) {
+		vlan_hdr = (struct rte_vlan_hdr *)
+			((char *)eth_hdr + info->l2_len);
 		info->l2_len  += sizeof(struct rte_vlan_hdr);
 		info->ethertype = vlan_hdr->eth_proto;
 	}
-- 
2.7.4


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [dpdk-stable] [PATCH v3] app/testpmd: add parsing for QINQ VLAN headers
  2020-04-23  9:05   ` [dpdk-stable] [PATCH v3] app/testpmd: add parsing for QINQ " Raslan Darawsheh
@ 2020-04-24 16:35     ` Ferruh Yigit
  0 siblings, 0 replies; 11+ messages in thread
From: Ferruh Yigit @ 2020-04-24 16:35 UTC (permalink / raw)
  To: Raslan Darawsheh, bernard.iremonger, jingjing.wu, wenzhuo.lu; +Cc: dev, stable

On 4/23/2020 10:05 AM, Raslan Darawsheh wrote:
> When having QINQ VLAN headers in the packet, parse_ethernet
> is cabable of parsing only the first vlan.
> 
> add parsing for QINQ VLAN headers in the packet.
> 
> Fixes: 51f694dd40f5 ("app/testpmd: rework checksum forward engine")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
> Acked-by: Ori Kam <orika@mellanox.com>
> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-04-24 16:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20 15:32 [dpdk-stable] [PATCH] app/testpmd: add parsing for multiple VLAN headers Raslan Darawsheh
2020-04-21 14:54 ` Iremonger, Bernard
2020-04-21 20:47 ` [dpdk-stable] [dpdk-dev] " Ferruh Yigit
2020-04-22 11:05   ` Iremonger, Bernard
2020-04-22 11:28     ` Raslan Darawsheh
2020-04-22  7:22 ` Ori Kam
2020-04-23  8:41 ` [dpdk-stable] [PATCH v2] " Raslan Darawsheh
2020-04-23  8:59   ` Iremonger, Bernard
2020-04-23  9:01     ` Raslan Darawsheh
2020-04-23  9:05   ` [dpdk-stable] [PATCH v3] app/testpmd: add parsing for QINQ " Raslan Darawsheh
2020-04-24 16:35     ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).