DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Chen, Jing D" <jing.d.chen@intel.com>
To: "Shaw, Jeffrey B" <jeffrey.b.shaw@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "Zhang, Helin" <helin.zhang@intel.com>,
	"Wu, Jingjing" <jingjing.wu@intel.com>,
	"damarion@cisco.com" <damarion@cisco.com>,
	"Zhang, Qi Z" <qi.z.zhang@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2 2/2] i40e: Enable bad checksum flags in i40e vPMD
Date: Wed, 5 Oct 2016 23:57:28 +0000	[thread overview]
Message-ID: <4341B239C0EFF9468EE453F9E9F4604D3A387BDA@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1475712772-105327-2-git-send-email-jeffrey.b.shaw@intel.com>

Hi,

> -----Original Message-----
> From: Shaw, Jeffrey B
> Sent: Wednesday, October 5, 2016 5:13 PM
> To: dev@dpdk.org
> Cc: Zhang, Helin <helin.zhang@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; damarion@cisco.com; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Chen, Jing D <jing.d.chen@intel.com>
> Subject: [PATCH v2 2/2] i40e: Enable bad checksum flags in i40e vPMD
> 
> From: Damjan Marion <damarion@cisco.com>
> 
> Decode the checksum flags from the rx descriptor, setting the appropriate bit
> in the mbuf ol_flags field when the flag indicates a bad checksum.
> 
> Signed-off-by: Damjan Marion <damarion@cisco.com>
> Signed-off-by: Jeff Shaw <jeffrey.b.shaw@intel.com>
> ---
>  drivers/net/i40e/i40e_rxtx_vec.c | 48 +++++++++++++++++++++++---------------
> --
>  1 file changed, 28 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_rxtx_vec.c
> b/drivers/net/i40e/i40e_rxtx_vec.c
> index 6c63141..d2267ad 100644
> --- a/drivers/net/i40e/i40e_rxtx_vec.c
> +++ b/drivers/net/i40e/i40e_rxtx_vec.c
> @@ -138,19 +138,14 @@ i40e_rxq_rearm(struct i40e_rx_queue *rxq)  static
> inline void  desc_to_olflags_v(__m128i descs[4], struct rte_mbuf **rx_pkts)  {
> -	__m128i vlan0, vlan1, rss;
> -	union {
> -		uint16_t e[4];
> -		uint64_t dword;
> -	} vol;
> +	__m128i vlan0, vlan1, rss, l3_l4e;
> 
>  	/* mask everything except RSS, flow director and VLAN flags
>  	 * bit2 is for VLAN tag, bit11 for flow director indication
>  	 * bit13:12 for RSS indication.
>  	 */
> -	const __m128i rss_vlan_msk = _mm_set_epi16(
> -			0x0000, 0x0000, 0x0000, 0x0000,
> -			0x3804, 0x3804, 0x3804, 0x3804);
> +	const __m128i rss_vlan_msk = _mm_set_epi32(
> +			0x1c03004, 0x1c03004, 0x1c03004, 0x1c03004);
> 
>  	/* map rss and vlan type to rss hash and vlan flag */
>  	const __m128i vlan_flags = _mm_set_epi8(0, 0, 0, 0, @@ -163,23
> +158,36 @@ desc_to_olflags_v(__m128i descs[4], struct rte_mbuf **rx_pkts)
>  			PKT_RX_RSS_HASH | PKT_RX_FDIR,
> PKT_RX_RSS_HASH, 0, 0,
>  			0, 0, PKT_RX_FDIR, 0);
> 
> -	vlan0 = _mm_unpackhi_epi16(descs[0], descs[1]);
> -	vlan1 = _mm_unpackhi_epi16(descs[2], descs[3]);
> -	vlan0 = _mm_unpacklo_epi32(vlan0, vlan1);
> +	const __m128i l3_l4e_flags = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0,
> +			PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD
> | PKT_RX_IP_CKSUM_BAD,
> +			PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD,
> +			PKT_RX_EIP_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD,
> +			PKT_RX_EIP_CKSUM_BAD,
> +			PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD,
> +			PKT_RX_L4_CKSUM_BAD,
> +			PKT_RX_IP_CKSUM_BAD,
> +			0);
> +
> +	vlan0 = _mm_unpackhi_epi32(descs[0], descs[1]);
> +	vlan1 = _mm_unpackhi_epi32(descs[2], descs[3]);
> +	vlan0 = _mm_unpacklo_epi64(vlan0, vlan1);
> 
>  	vlan1 = _mm_and_si128(vlan0, rss_vlan_msk);
>  	vlan0 = _mm_shuffle_epi8(vlan_flags, vlan1);
> 
> -	rss = _mm_srli_epi16(vlan1, 11);
> +	rss = _mm_srli_epi32(vlan1, 12);
> 	rss = _mm_shuffle_epi8(rss_flags, rss);

My bad. Original code will use bit[13:11] to identify RSS and FDIR flag. Now 
It masked bit 11 out when creating " rss_vlan_msk" and doing shift above,
while it still try to use  original "rss_flags"?

  parent reply	other threads:[~2016-10-05 23:57 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-14 16:59 [dpdk-dev] [PATCH 0/2] Add ptype and xsum handling in i40e rx vpmd Jeff Shaw
2016-07-14 16:59 ` [dpdk-dev] [PATCH 1/2] i40e: Add packet_type metadata in the i40e vPMD Jeff Shaw
2016-09-23  6:40   ` Zhang, Qi Z
2016-09-23  8:23     ` Thomas Monjalon
2016-09-26  1:46       ` Zhang, Qi Z
2016-10-05  1:29   ` Chen, Jing D
2016-10-06  0:12   ` [dpdk-dev] [PATCH v2 " Jeff Shaw
2016-10-05 21:26     ` Chen, Jing D
2016-10-06  0:12     ` [dpdk-dev] [PATCH v2 2/2] i40e: Enable bad checksum flags in " Jeff Shaw
2016-10-05 22:20       ` Chen, Jing D
2016-10-05 23:57       ` Chen, Jing D [this message]
2016-10-06  2:19         ` Jeff Shaw
2016-10-06  7:54           ` Damjan Marion (damarion)
2016-10-06  6:33       ` [dpdk-dev] [PATCH v3 1/2] i40e: Add packet_type metadata in the " Jeff Shaw
2016-10-06  6:38       ` [dpdk-dev] [PATCH v4 " Jeff Shaw
2016-10-06  6:38         ` [dpdk-dev] [PATCH v4 2/2] i40e: Enable bad checksum flags in " Jeff Shaw
2016-10-06 15:30           ` Chen, Jing D
2016-10-06 15:28         ` [dpdk-dev] [PATCH v4 1/2] i40e: Add packet_type metadata in the " Chen, Jing D
2016-10-12 15:51           ` Bruce Richardson
2016-07-14 16:59 ` [dpdk-dev] [PATCH 2/2] i40e: Enable bad checksum flags in " Jeff Shaw
2016-07-15 20:26 ` [dpdk-dev] [PATCH 0/2] Add ptype and xsum handling in i40e rx vpmd Thomas Monjalon
2016-09-01 14:47   ` Jeff Shaw
2016-09-14 13:22     ` 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=4341B239C0EFF9468EE453F9E9F4604D3A387BDA@shsmsx102.ccr.corp.intel.com \
    --to=jing.d.chen@intel.com \
    --cc=damarion@cisco.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=jeffrey.b.shaw@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@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).