DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Iremonger, Bernard" <bernard.iremonger@intel.com>
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" <dev@dpdk.org>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2] app/testpmd: add parsing for multiple VLAN headers
Date: Thu, 23 Apr 2020 08:59:35 +0000	[thread overview]
Message-ID: <DM6PR11MB2537C31FF46900AF83BA508FEFD30@DM6PR11MB2537.namprd11.prod.outlook.com> (raw)
In-Reply-To: <1587631275-25710-1-git-send-email-rasland@mellanox.com>

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>


  reply	other threads:[~2020-04-23  9:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-20 15:32 [dpdk-dev] [PATCH] " 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 11:28     ` Raslan Darawsheh
2020-04-22  7:22 ` Ori Kam
2020-04-23  8:41 ` [dpdk-dev] [PATCH v2] " Raslan Darawsheh
2020-04-23  8:59   ` Iremonger, Bernard [this message]
2020-04-23  9:01     ` Raslan Darawsheh
2020-04-23  9:05   ` [dpdk-dev] [PATCH v3] app/testpmd: add parsing for QINQ " Raslan Darawsheh
2020-04-24 16:35     ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM6PR11MB2537C31FF46900AF83BA508FEFD30@DM6PR11MB2537.namprd11.prod.outlook.com \
    --to=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=rasland@mellanox.com \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).