From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id A6B57532D for ; Fri, 15 Jul 2016 14:22:32 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 15 Jul 2016 05:22:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,368,1464678000"; d="scan'208";a="1007426302" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga001.fm.intel.com with ESMTP; 15 Jul 2016 05:22:30 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.51]) by IRSMSX103.ger.corp.intel.com ([169.254.3.204]) with mapi id 14.03.0248.002; Fri, 15 Jul 2016 13:22:30 +0100 From: "Ananyev, Konstantin" To: Juhamatti Kuusisaari , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] lib: change rte_ring dequeue to guarantee ordering before tail update Thread-Index: AQHR3lMVB7U+jl295UCMHLK24AQt4KAZXSLg Date: Fri, 15 Jul 2016 12:22:29 +0000 Message-ID: <2601191342CEEE43887BDE71AB97725836B7E32F@irsmsx105.ger.corp.intel.com> References: <20160715043951.32040-1-juhamatti.kuusisaari@coriant.com> In-Reply-To: <20160715043951.32040-1-juhamatti.kuusisaari@coriant.com> 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] lib: change rte_ring dequeue to guarantee ordering before tail update 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: Fri, 15 Jul 2016 12:22:33 -0000 >=20 > Consumer queue dequeuing must be guaranteed to be done fully before the t= ail is updated. This is not guaranteed with a read barrier, > changed to a write barrier just before tail update which in practice guar= antees correct order of reads and writes. >=20 > Signed-off-by: Juhamatti Kuusisaari > --- > lib/librte_ring/rte_ring.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h inde= x eb45e41..14920af 100644 > --- a/lib/librte_ring/rte_ring.h > +++ b/lib/librte_ring/rte_ring.h > @@ -748,7 +748,7 @@ __rte_ring_sc_do_dequeue(struct rte_ring *r, void **o= bj_table, >=20 > /* copy in table */ > DEQUEUE_PTRS(); > - rte_smp_rmb(); > + rte_smp_wmb(); >=20 > __RING_STAT_ADD(r, deq_success, n); > r->cons.tail =3D cons_next; > -- Acked-by: Konstantin Ananyev > 2.9.0 >=20