net/af_xdp: avoid deadlock due to empty fill queue
authorRongQing Li <lirongqing@baidu.com>
Fri, 18 Sep 2020 11:32:31 +0000 (19:32 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 30 Sep 2020 17:19:09 +0000 (19:19 +0200)
commitab7ed23a2f3e74f1341de76b19256842c4cdc7f2
tree6f88b7530cb5cabdeb9d5ec0af82d1929b495630
parent45718ada5fa12619db4821646ba964a2df365c68
net/af_xdp: avoid deadlock due to empty fill queue

While receiving packets, it is possible to fail to reserve
fill queue, since buffer ring is shared between tx and rx,
and maybe not available temporary. As a result both fill
queue and Rx queue will be empty.

Then kernel side will not be able to receive packets due to
empty fill queue, and dpdk will not be able to reserve fill
queue because dpdk doesn't have packets to receive, finally
deadlock will happen.

So move reserve fill queue before xsk_ring_cons__peek to fix it.

Cc: stable@dpdk.org
Signed-off-by: RongQing Li <lirongqing@baidu.com>
Signed-off-by: Dongsheng Rong <rongdongsheng@baidu.com>
Acked-by: Ciara Loftus <ciara.loftus@intel.com>
drivers/net/af_xdp/rte_eth_af_xdp.c