Re: [dpdk-dev] [PATCH v2] rte_ethdev: safer memory access by calling Rx callback

2020-03-05 Thread Liang, Ma
On 05 Mar 07:19, Ananyev, Konstantin wrote: > > > On 05 Mar 11:27, Ananyev, Konstantin wrote: > > > > > > > > > > > > > > On Thu, Mar 05, 2020 at 01:33:49AM +0800, ZY Qiu wrote: > > > > > When compiling with -O0, > > > > > the compiler does not optimize two memory accesses into one. > > > > > Lead

Re: [dpdk-dev] [PATCH v2] rte_ethdev: safer memory access by calling Rx callback

2020-03-05 Thread Ananyev, Konstantin
> On 05 Mar 11:27, Ananyev, Konstantin wrote: > > > > > > > > > > On Thu, Mar 05, 2020 at 01:33:49AM +0800, ZY Qiu wrote: > > > > When compiling with -O0, > > > > the compiler does not optimize two memory accesses into one. > > > > Leads to accessing a null pointer when queue post Rx burst callbac

Re: [dpdk-dev] [PATCH v2] rte_ethdev: safer memory access by calling Rx callback

2020-03-05 Thread Liang, Ma
On 05 Mar 11:27, Ananyev, Konstantin wrote: > > > > > > On Thu, Mar 05, 2020 at 01:33:49AM +0800, ZY Qiu wrote: > > > When compiling with -O0, > > > the compiler does not optimize two memory accesses into one. > > > Leads to accessing a null pointer when queue post Rx burst callback > > > remova

Re: [dpdk-dev] [PATCH v2] rte_ethdev: safer memory access by calling Rx callback

2020-03-05 Thread 腾讯网关团队
> > > > On Thu, Mar 05, 2020 at 01:33:49AM +0800, ZY Qiu wrote: > > > When compiling with -O0, > > > the compiler does not optimize two memory accesses into one. > > > Leads to accessing a null pointer when queue post Rx burst callback > > > removal while traffic is running. > > > See rte_eth_tx_

Re: [dpdk-dev] [PATCH v2] rte_ethdev: safer memory access by calling Rx callback

2020-03-05 Thread Ananyev, Konstantin
> > On Thu, Mar 05, 2020 at 01:33:49AM +0800, ZY Qiu wrote: > > When compiling with -O0, > > the compiler does not optimize two memory accesses into one. > > Leads to accessing a null pointer when queue post Rx burst callback > > removal while traffic is running. > > See rte_eth_tx_burst functi

Re: [dpdk-dev] [PATCH v2] rte_ethdev: safer memory access by calling Rx callback

2020-03-05 Thread Bruce Richardson
On Thu, Mar 05, 2020 at 01:33:49AM +0800, ZY Qiu wrote: > When compiling with -O0, > the compiler does not optimize two memory accesses into one. > Leads to accessing a null pointer when queue post Rx burst callback > removal while traffic is running. > See rte_eth_tx_burst function. > > Signed-of

Re: [dpdk-dev] [PATCH v2] rte_ethdev: safer memory access by calling Rx callback

2020-03-04 Thread 腾讯网关团队
Thank you raising your concerns. I mean, the original wrong code, but using -O3 optimization yielded a correct result. My patch makes the effects of -O3 and -O0 consistent. Unlike other signals that require busy wait, this callback pointer only needs to be read once. So I don't think memory bar

Re: [dpdk-dev] [PATCH v2] rte_ethdev: safer memory access by calling Rx callback

2020-03-04 Thread Stephen Hemminger
On Thu, 5 Mar 2020 01:33:49 +0800 ZY Qiu wrote: > When compiling with -O0, > the compiler does not optimize two memory accesses into one. > Leads to accessing a null pointer when queue post Rx burst callback > removal while traffic is running. > See rte_eth_tx_burst function. > > Signed-off-by:

[dpdk-dev] [PATCH v2] rte_ethdev: safer memory access by calling Rx callback

2020-03-04 Thread ZY Qiu
When compiling with -O0, the compiler does not optimize two memory accesses into one. Leads to accessing a null pointer when queue post Rx burst callback removal while traffic is running. See rte_eth_tx_burst function. Signed-off-by: ZY Qiu --- lib/librte_ethdev/rte_ethdev.h | 6 ++ 1 file c