patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Qi Zhang <qi.z.zhang@intel.com>
Cc: Yuanhan Liu <yuanhan.liu@linux.intel.com>, dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'net/i40e: fix checksum flag in x86 vector Rx' has been queued to stable release 16.11.1
Date: Wed, 15 Feb 2017 14:26:25 +0800	[thread overview]
Message-ID: <1487140012-13314-13-git-send-email-yuanhan.liu@linux.intel.com> (raw)
In-Reply-To: <1487140012-13314-1-git-send-email-yuanhan.liu@linux.intel.com>

Hi,

FYI, your patch has been queued to stable release 16.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
yet. It will be pushed if I get no objections before 02/18/17.
So please shout if anyone has objections.

Thanks.

	--yliu

---
>From b642e4f4fc40b064a69aa8be259a28b6d1902852 Mon Sep 17 00:00:00 2001
From: Qi Zhang <qi.z.zhang@intel.com>
Date: Tue, 24 Jan 2017 14:06:59 -0500
Subject: [PATCH] net/i40e: fix checksum flag in x86 vector Rx

[ upstream commit f3a85f4ce04d9fb55ebdb392563f7c1711f3d943 ]

When no error reported in Rx descriptor, we should set
CKSUM_GOOD flag before return.

Fixes: 9966a00a0688 ("net/i40e: enable bad checksum flags in vector Rx")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/i40e_rxtx_vec_sse.c | 37 ++++++++++++++++++++++++++++--------
 1 file changed, 29 insertions(+), 8 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx_vec_sse.c b/drivers/net/i40e/i40e_rxtx_vec_sse.c
index 7c84a41..b95cc8e 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_sse.c
+++ b/drivers/net/i40e/i40e_rxtx_vec_sse.c
@@ -148,6 +148,20 @@ desc_to_olflags_v(__m128i descs[4], struct rte_mbuf **rx_pkts)
 	const __m128i rss_vlan_msk = _mm_set_epi32(
 			0x1c03804, 0x1c03804, 0x1c03804, 0x1c03804);
 
+	const __m128i cksum_mask = _mm_set_epi32(
+			PKT_RX_IP_CKSUM_GOOD | PKT_RX_IP_CKSUM_BAD |
+			PKT_RX_L4_CKSUM_GOOD | PKT_RX_L4_CKSUM_BAD |
+			PKT_RX_EIP_CKSUM_BAD,
+			PKT_RX_IP_CKSUM_GOOD | PKT_RX_IP_CKSUM_BAD |
+			PKT_RX_L4_CKSUM_GOOD | PKT_RX_L4_CKSUM_BAD |
+			PKT_RX_EIP_CKSUM_BAD,
+			PKT_RX_IP_CKSUM_GOOD | PKT_RX_IP_CKSUM_BAD |
+			PKT_RX_L4_CKSUM_GOOD | PKT_RX_L4_CKSUM_BAD |
+			PKT_RX_EIP_CKSUM_BAD,
+			PKT_RX_IP_CKSUM_GOOD | PKT_RX_IP_CKSUM_BAD |
+			PKT_RX_L4_CKSUM_GOOD | PKT_RX_L4_CKSUM_BAD |
+			PKT_RX_EIP_CKSUM_BAD);
+
 	/* map rss and vlan type to rss hash and vlan flag */
 	const __m128i vlan_flags = _mm_set_epi8(0, 0, 0, 0,
 			0, 0, 0, 0,
@@ -160,14 +174,17 @@ desc_to_olflags_v(__m128i descs[4], struct rte_mbuf **rx_pkts)
 			0, 0, PKT_RX_FDIR, 0);
 
 	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);
+			/* shift right 1 bit to make sure it not exceed 255 */
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD |
+			 PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_EIP_CKSUM_BAD |
+			 PKT_RX_L4_CKSUM_BAD) >> 1,
+			(PKT_RX_EIP_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_EIP_CKSUM_BAD) >> 1,
+			(PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD) >> 1,
+			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_BAD) >> 1,
+			PKT_RX_IP_CKSUM_BAD >> 1,
+			(PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD) >> 1);
 
 	vlan0 = _mm_unpackhi_epi32(descs[0], descs[1]);
 	vlan1 = _mm_unpackhi_epi32(descs[2], descs[3]);
@@ -181,6 +198,10 @@ desc_to_olflags_v(__m128i descs[4], struct rte_mbuf **rx_pkts)
 
 	l3_l4e = _mm_srli_epi32(vlan1, 22);
 	l3_l4e = _mm_shuffle_epi8(l3_l4e_flags, l3_l4e);
+	/* then we shift left 1 bit */
+	l3_l4e = _mm_slli_epi32(l3_l4e, 1);
+	/* we need to mask out the reduntant bits */
+	l3_l4e = _mm_and_si128(l3_l4e, cksum_mask);
 
 	vlan0 = _mm_or_si128(vlan0, rss);
 	vlan0 = _mm_or_si128(vlan0, l3_l4e);
-- 
1.9.0

  parent reply	other threads:[~2017-02-15  6:24 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15  6:26 [dpdk-stable] patch 'devargs: reset driver name pointer on parsing failure' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'vhost: fix dead loop in enqueue path' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'vhost: fix long stall of negotiation' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'vhost: do not GSO when no header is present' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/virtio: fix performance regression due to TSO' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/virtio: optimize header reset on any layout' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/i40e: fix Rx checksum flag' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/mlx5: fix memory leak when parsing device params' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/qede/base: fix FreeBSD build' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/i40e: fix deletion of all macvlan filters' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/bnx2x: fix Rx mode configuration' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/cxgbe/base: initialize variable before reading EEPROM' " Yuanhan Liu
2017-02-15  6:26 ` Yuanhan Liu [this message]
2017-02-15  6:26 ` [dpdk-stable] patch 'net/i40e: fix crash in close' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'vfio: fix file descriptor leak in multi-process' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'sched: fix crash when freeing port' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/enic: fix memory leak with oversized Tx packets' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/ena: fix setting host attributes' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/i40e: fix ethertype filter on X722' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/i40evf: fix reporting of imissed packets' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/i40e: fix link update delay' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/enic: fix hardcoding of some flow director masks' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/ixgbe: fix received packets number for ARM' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/ixgbe: fix received packets number for ARM NEON' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/i40e: fix TC bandwidth definition' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'drivers/crypto: fix different auth/cipher keys' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'examples/l2fwd-crypto: fix overflow' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'examples/l2fwd-crypto: fix padding' " Yuanhan Liu
2017-02-16  8:01   ` Yuanhan Liu
2017-02-16  9:10     ` De Lara Guarch, Pablo
2017-02-17  7:44       ` Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'vhost: allow many vhost-user ports' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'mempool: fix stack handler dequeue' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'ethdev: fix port data mismatched in multiple process model' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/virtio: fix wrong Rx/Tx method for secondary process' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/virtio: store PCI operators pointer locally' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/virtio: store IO port info " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/virtio: fix multiple process support' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/virtio: fix build without virtio-user' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/virtio: fix crash when number of virtio devices > 1' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'usertools: fix active interface detection when binding' " Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/vhost: fix unix socket not removed as closing' " Yuanhan Liu
2017-02-15  7:22   ` Tan, Jianfeng
2017-02-15  7:28     ` Yuanhan Liu
2017-02-15  6:26 ` [dpdk-stable] patch 'net/ixgbevf: fix max packet length' " Yuanhan Liu

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=1487140012-13314-13-git-send-email-yuanhan.liu@linux.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    /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).