From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 5ED8AF72 for ; Wed, 2 Nov 2016 11:21:23 +0100 (CET) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP; 02 Nov 2016 03:21:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,583,1473145200"; d="scan'208";a="26465792" Received: from yliu-dev.sh.intel.com ([10.239.67.162]) by fmsmga006.fm.intel.com with ESMTP; 02 Nov 2016 03:21:22 -0700 From: Yuanhan Liu To: Qi Zhang Date: Wed, 2 Nov 2016 18:21:30 +0800 Message-Id: <1478082097-16957-34-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1478082097-16957-1-git-send-email-yuanhan.liu@linux.intel.com> References: <1478082097-16957-1-git-send-email-yuanhan.liu@linux.intel.com> Cc: Konstantin Ananyev , dpdk stable Subject: [dpdk-stable] patch 'net/ixgbe: fix out of order Rx read' has been queued to stable release 16.07.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Nov 2016 10:21:23 -0000 Hi, FYI, your patch has been queued to stable release 16.07.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/06/16. So please shout if anyone has objections. Thanks. --yliu --- >>From 92704c3dfb390939ca6b4831853062fa375938bd Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Tue, 18 Oct 2016 02:29:41 +0800 Subject: [PATCH] net/ixgbe: fix out of order Rx read [ upstream commit bd85525efbf3ce382c12146ab89954e8bcdfd0be ] In vPMD, when we load Rx desc with _mm_loadu_si128, the volatile modifier will be cast away, allowing the compiler to reorder the load instructions. The Rx recv function's correctness is relying on these load instructions following a strict sequence, reading the descriptors in reverse order, so we add compiler barrier to prevent compiler reorder. Fixes: c95584dc2b18 ("ixgbe: new vectorized functions for Rx/Tx") Signed-off-by: Qi Zhang Acked-by: Konstantin Ananyev --- drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c index 1c4fd7c..7fb155a 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c +++ b/drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c @@ -305,6 +305,7 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts, /* Read desc statuses backwards to avoid race condition */ /* A.1 load 4 pkts desc */ descs[3] = _mm_loadu_si128((__m128i *)(rxdp + 3)); + rte_compiler_barrier(); /* B.2 copy 2 mbuf point into rx_pkts */ _mm_storeu_si128((__m128i *)&rx_pkts[pos], mbp1); @@ -313,8 +314,10 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts, mbp2 = _mm_loadu_si128((__m128i *)&sw_ring[pos+2]); descs[2] = _mm_loadu_si128((__m128i *)(rxdp + 2)); + rte_compiler_barrier(); /* B.1 load 2 mbuf point */ descs[1] = _mm_loadu_si128((__m128i *)(rxdp + 1)); + rte_compiler_barrier(); descs[0] = _mm_loadu_si128((__m128i *)(rxdp)); /* B.2 copy 2 mbuf point into rx_pkts */ -- 1.9.0