net/af_xdp: make reserve/submit peek/release consistent
authorXiaolong Ye <xiaolong.ye@intel.com>
Wed, 17 Apr 2019 13:49:45 +0000 (21:49 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 19 Apr 2019 12:51:54 +0000 (14:51 +0200)
commit10edf857fde473d34d794883024e6330f397714d
treebdeff5589f785103c68eca5d0c61a96769e763d3
parentfb6c5f2a1975a0f3de8ba6768c1b31d78fa1ee7b
net/af_xdp: make reserve/submit peek/release consistent

As David pointed out, if we reserve N slots for Tx, but only submit n
slots, we would end up with an incorrect opinion of the number of available
slots later, we also would get wrong idx when we call
xsk_ring_prod__reserve next time. It also applies to
xsk_ring_cons__peek()/xsk_ring_cons__release().

This patch ensures that both reserve/submit and peek/release are
consistent.

Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")

Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
drivers/net/af_xdp/rte_eth_af_xdp.c