From patchwork Sat Apr 11 15:33:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: WangDong X-Patchwork-Id: 4293 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 4C195C32A; Sat, 11 Apr 2015 17:33:57 +0200 (CEST) Received: from BLU004-OMC4S27.hotmail.com (blu004-omc4s27.hotmail.com [65.55.111.166]) by dpdk.org (Postfix) with ESMTP id 864E5C322 for ; Sat, 11 Apr 2015 17:33:55 +0200 (CEST) Received: from BLU436-SMTP179 ([65.55.111.136]) by BLU004-OMC4S27.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Sat, 11 Apr 2015 08:33:54 -0700 X-TMN: [3bvQFERcMSq3+Z23mwl8mOStg0Iji3mu] X-Originating-Email: [dong.wang.pro@hotmail.com] Message-ID: From: WangDong To: dev@dpdk.org Date: Sat, 11 Apr 2015 23:33:35 +0800 X-Mailer: git-send-email 1.9.1 X-OriginalArrivalTime: 11 Apr 2015 15:33:54.0112 (UTC) FILETIME=[EAF77400:01D0746C] MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] ixgbe:Add write memory barrier for recv pkts. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Like transmit packets, before update receive descriptor's tail pointer, rte_wmb() should be added after writing recv descriptor. Signed-off-by: Dong Wang --- lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c index 9da2c7e..d504688 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c @@ -1338,6 +1338,9 @@ ixgbe_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, */ rx_pkts[nb_rx++] = rxm; } + + rte_wmb(); + rxq->rx_tail = rx_id; /* @@ -1595,6 +1598,8 @@ ixgbe_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, first_seg = NULL; } + rte_wmb(); + /* * Record index of the next RX descriptor to probe. */