On Thu, 5 Mar 2020 01:33:49 +0800 ZY Qiu <quze...@gmail.com> 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: ZY Qiu <tgw_t...@tencent.com>
This is a problem many places in DPDK. You said it was related to -O0 but that is just what is causing a more generic problem to be exposed. Your solution is not sufficient. DPDK is sloppy in several places in handling memory ordering issues https://en.wikipedia.org/wiki/Memory_ordering It should have a macro to do RTE_READ_ONCE(). Several drives have this, the Linux kernel has it, Liburcu has it. The macro RTE_READ_ONCE() can then be used in many places in DPDK.