From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 05A3C9A8F for ; Wed, 15 Apr 2015 00:50:18 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 14 Apr 2015 15:50:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,578,1422950400"; d="scan'208";a="713702857" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by orsmga002.jf.intel.com with ESMTP; 14 Apr 2015 15:50:16 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.2]) by IRSMSX151.ger.corp.intel.com ([169.254.4.100]) with mapi id 14.03.0224.002; Tue, 14 Apr 2015 23:50:15 +0100 From: "Ananyev, Konstantin" To: WangDong , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] ixgbe:Add write memory barrier for recv pkts. Thread-Index: AQHQdGz6+8vgd33r00S1uKt4k2uohp1NH2Qw Date: Tue, 14 Apr 2015 22:50:15 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725821415A3A@irsmsx105.ger.corp.intel.com> References: In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Tue, 14 Apr 2015 22:50:19 -0000 Hi, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of WangDong > Sent: Saturday, April 11, 2015 4:34 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] ixgbe:Add write memory barrier for recv pkts. >=20 > Like transmit packets, before update receive descriptor's tail pointer, r= te_wmb() should be added after writing recv descriptor. >=20 > Signed-off-by: Dong Wang > --- > lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixg= be_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 **r= x_pkts, > */ > rx_pkts[nb_rx++] =3D rxm; > } > + > + rte_wmb(); > + Why do you think it is necessary? I can't see any good reason to put wmb() here. I would understand if, at least you'll try to insert it just before updatin= g RDT: rx_id =3D (uint16_t) ((rx_id =3D=3D 0) ? (rxq->nb_rx_desc - 1) : (rx_id - 1)); + rte_wmb(); IXGBE_PCI_REG_WRITE(rxq->rdt_reg_addr, rx_id); That is not needed IA with current implementation, but would make sense for= machines with relaxed memory ordering. Though right now DPDK IXGBE PMD is supported only on IA, anyway. Same for ixgbe_recv_scattered_pkts(). Konstantin > rxq->rx_tail =3D rx_id; >=20 > /* > @@ -1595,6 +1598,8 @@ ixgbe_recv_scattered_pkts(void *rx_queue, struct rt= e_mbuf **rx_pkts, > first_seg =3D NULL; > } >=20 > + rte_wmb(); > + > /* > * Record index of the next RX descriptor to probe. > */ > -- > 1.9.1