Re: [dpdk-dev] [PATCH v2] ring: fix c11 memory ordering issue

2018-08-08 Thread He, Jia
Hi Gavin > -Original Message- > From: Gavin Hu [mailto:gavin...@arm.com] > Sent: 2018年8月7日 11:20 > To: dev@dpdk.org > Cc: gavin...@arm.com; honnappa.nagaraha...@arm.com; > steve.cap...@arm.com; ola.liljed...@arm.com; > jerin.ja...@caviumnetworks.com; hemant.agra...@nxp.com; He, Jia > ; sta.

Re: [dpdk-dev] [PATCH v2] ring: fix c11 memory ordering issue

2018-08-07 Thread Jerin Jacob
-Original Message- > Date: Tue, 7 Aug 2018 07:56:08 + > From: Gavin Hu > To: "He, Jia" , "dev@dpdk.org" > CC: Honnappa Nagarahalli , Steve Capper > , Ola Liljedahl , > "jerin.ja...@caviumnetworks.com" , > "hemant.agra...@nxp.com" , "sta...@dpdk.org" > > Subject: RE: [PATCH v2] ri

Re: [dpdk-dev] [PATCH v2] ring: fix c11 memory ordering issue

2018-08-07 Thread Gavin Hu
Hi Jia, Thanks for your feedback, let's see if there are requests from others to split the fix. The is a race condition between updating the tail and getting free/avail_entries, which is dependent on the tails. Which should be synchronized by load-acquire and store-release. In simple words bel

[dpdk-dev] [PATCH v2] ring: fix c11 memory ordering issue

2018-08-06 Thread Gavin Hu
This patch includes two bug fixes(#1 and 2) and two optimisations(#3 and #4). 1) In update_tail, read ht->tail using __atomic_load.Although the compiler currently seems to be doing the right thing even without _atomic_load, we don't want to give the compiler freedom to optimise what should