From: Nipun Gupta <nipun.gupta@nxp.com>
To: Gavin Hu <gavin.hu@arm.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "nd@arm.com" <nd@arm.com>,
"thomas@monjalon.net" <thomas@monjalon.net>,
"konstantin.ananyev@intel.com" <konstantin.ananyev@intel.com>,
"jerinj@marvell.com" <jerinj@marvell.com>,
Hemant Agrawal <hemant.agrawal@nxp.com>,
"Honnappa.Nagarahalli@arm.com" <Honnappa.Nagarahalli@arm.com>,
"i.maximets@samsung.com" <i.maximets@samsung.com>,
"chaozhu@linux.vnet.ibm.com" <chaozhu@linux.vnet.ibm.com>,
"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH v3 1/1] ring: enforce reading the tail before reading ring slots
Date: Wed, 13 Mar 2019 08:12:10 +0000 [thread overview]
Message-ID: <VI1PR04MB4480F3E58BA76601AAE5B0CDE64A0@VI1PR04MB4480.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <1552409933-45684-2-git-send-email-gavin.hu@arm.com>
> -----Original Message-----
> From: Gavin Hu [mailto:gavin.hu@arm.com]
> Sent: Tuesday, March 12, 2019 10:29 PM
> To: dev@dpdk.org
> Cc: nd@arm.com; gavin hu <gavin.hu@arm.com>; thomas@monjalon.net;
> konstantin.ananyev@intel.com; jerinj@marvell.com; Hemant Agrawal
> <hemant.agrawal@nxp.com>; Nipun Gupta <nipun.gupta@nxp.com>;
> Honnappa.Nagarahalli@arm.com; i.maximets@samsung.com;
> chaozhu@linux.vnet.ibm.com; stable@dpdk.org
> Subject: [PATCH v3 1/1] ring: enforce reading the tail before reading ring slots
>
> From: gavin hu <gavin.hu@arm.com>
>
> In weak memory models, like arm64, reading the prod.tail may get
> reordered after reading the ring slots, which corrupts the ring and
> stale data is observed.
>
> This issue was reported by NXP on 8-A72 DPAA2 board. The problem is most
> likely caused by missing the acquire semantics when reading
> prod.tail (in SC dequeue) which makes it possible to read a
> stale value from the ring slots.
>
> For MP (and MC) case, rte_atomic32_cmpset() already provides the required
> ordering. For SP case, the control depependency between if-
> statement(which
> depends on the read of r->cons.tail) and the later stores to the ring slots
> make RMB unnecessary. About the control dependency, read more at:
> https://emea01.safelinks.protection.outlook.com/?url=https:%2F%2Fwww.c
> l.cam.ac.uk%2F~pes20%2Fppc-
> supplemental%2Ftest7.pdf&data=02%7C01%7Cnipun.gupta%40nxp.co
> m%7Cc3df030ec49449bbaf0508d6a70c0b9f%7C686ea1d3bc2b4c6fa92cd99c5c
> 301635%7C0%7C0%7C636880067514602937&sdata=ogPdd%2F4UGYWE8
> nAwY1lkXPCB9MpUIFY0VOQr2N1lwe4%3D&reserved=0
>
> This patch is adding the required read barrier to prevent reading the ring
> slots get reordered before reading prod.tail for SC case.
>
> Fixes: c9fb3c62896f ("ring: move code in a new header file")
> Cc: stable@dpdk.org
>
> Signed-off-by: gavin hu <gavin.hu@arm.com>
> Reviewed-by: Ola Liljedahl <Ola.Liljedahl@arm.com>
> Tested-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Also, I have revalidated this updated patch.
next prev parent reply other threads:[~2019-03-13 8:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1552409933-45684-1-git-send-email-gavin.hu@arm.com>
[not found] ` <1551841661-42892-1-git-send-email-gavin.hu@arm.com>
2019-03-12 16:58 ` Gavin Hu
2019-03-13 8:12 ` Nipun Gupta [this message]
2019-03-15 13:26 ` Ananyev, Konstantin
2019-03-28 0:21 ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=VI1PR04MB4480F3E58BA76601AAE5B0CDE64A0@VI1PR04MB4480.eurprd04.prod.outlook.com \
--to=nipun.gupta@nxp.com \
--cc=Honnappa.Nagarahalli@arm.com \
--cc=chaozhu@linux.vnet.ibm.com \
--cc=dev@dpdk.org \
--cc=gavin.hu@arm.com \
--cc=hemant.agrawal@nxp.com \
--cc=i.maximets@samsung.com \
--cc=jerinj@marvell.com \
--cc=konstantin.ananyev@intel.com \
--cc=nd@arm.com \
--cc=stable@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).