From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 77E0AA0352 for ; Mon, 23 Dec 2019 03:38:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1FDA53977; Mon, 23 Dec 2019 03:38:45 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 075C11252; Mon, 23 Dec 2019 03:38:40 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Dec 2019 18:38:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,346,1571727600"; d="scan'208";a="229184457" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga002.jf.intel.com with ESMTP; 22 Dec 2019 18:38:39 -0800 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 22 Dec 2019 18:38:39 -0800 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 22 Dec 2019 18:38:39 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.29]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.164]) with mapi id 14.03.0439.000; Mon, 23 Dec 2019 10:38:36 +0800 From: "Wu, Jingjing" To: "Li, Xiaoyun" CC: "dev@dpdk.org" , "Maslekar, Omkar" , "stable@dpdk.org" Thread-Topic: [PATCH v2] raw/ntb: fix write memory barrier issue Thread-Index: AQHVs7Tq9NYXlKUWakKlyCWLWkd9tqfHDKJA Date: Mon, 23 Dec 2019 02:38:36 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F8115C6D9E@SHSMSX103.ccr.corp.intel.com> References: <20191204151916.12607-1-xiaoyun.li@intel.com> <20191216015854.28725-1-xiaoyun.li@intel.com> In-Reply-To: <20191216015854.28725-1-xiaoyun.li@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDk2MjkwY2EtYTRkZS00MTAyLWE2NTItMjZkYjUzNzhkZDE0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVVhoY2lsQ3dHdGtXUFZBbTJ5alE4MmpzR0FDaTZjTmFMUjVUd2FMb1lCUCtsZmNxZGxrdjhYR0d5RkxsWFdWbyJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [PATCH v2] raw/ntb: fix write memory barrier issue X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" > -----Original Message----- > From: Li, Xiaoyun > Sent: Monday, December 16, 2019 9:59 AM > To: Wu, Jingjing > Cc: dev@dpdk.org; Maslekar, Omkar ; Li, Xiaoyun > ; stable@dpdk.org > Subject: [PATCH v2] raw/ntb: fix write memory barrier issue >=20 > All buffers and ring info should be written before tail register update. > This patch relocates the write memory barrier before updating tail regist= er > to avoid potential issues. >=20 > Fixes: 11b5c7daf019 ("raw/ntb: add enqueue and dequeue functions") > Cc: stable@dpdk.org >=20 > Signed-off-by: Xiaoyun Li Acked-by: Jingjing Wu > --- > v2: > * Replaced rte_wmb with rte_io_wmb since rte_io_wmb is enough. > --- > drivers/raw/ntb/ntb.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/raw/ntb/ntb.c b/drivers/raw/ntb/ntb.c > index ad7f6abfd..c7de86f36 100644 > --- a/drivers/raw/ntb/ntb.c > +++ b/drivers/raw/ntb/ntb.c > @@ -683,8 +683,8 @@ ntb_enqueue_bufs(struct rte_rawdev *dev, > sizeof(struct ntb_used) * nb1); > rte_memcpy(txq->tx_used_ring, tx_used + nb1, > sizeof(struct ntb_used) * nb2); > + rte_io_wmb(); > *txq->used_cnt =3D txq->last_used; > - rte_wmb(); >=20 > /* update queue stats */ > hw->ntb_xstats[NTB_TX_BYTES_ID + off] +=3D bytes; > @@ -789,8 +789,8 @@ ntb_dequeue_bufs(struct rte_rawdev *dev, > sizeof(struct ntb_desc) * nb1); > rte_memcpy(rxq->rx_desc_ring, rx_desc + nb1, > sizeof(struct ntb_desc) * nb2); > + rte_io_wmb(); > *rxq->avail_cnt =3D rxq->last_avail; > - rte_wmb(); >=20 > /* update queue stats */ > off =3D NTB_XSTATS_NUM * ((size_t)context + 1); > -- > 2.17.1