net/af_xdp: use recvfrom only if busy polling enabled
authorCiara Loftus <ciara.loftus@intel.com>
Tue, 20 Apr 2021 08:44:31 +0000 (09:44 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 20 Apr 2021 10:09:33 +0000 (12:09 +0200)
commitb42cffab059ea525566d54e3daf4ba5fcf0d62e1
tree9fedbcedbdb28ec0da3f09c0e754688153d01877
parent2aa51cdd559e18fd6bbdead121d84a13ffa3455a
net/af_xdp: use recvfrom only if busy polling enabled

The recvfrom() syscall is only supported by AF_XDP sockets since
kernel 5.11. Only use it if busy polling is configured. We can
assume a kernel >= 5.11 is in use if busy polling is configured
so we can safely call recvfrom() in that case.

Fixes: 63e8989fe5a4 ("net/af_xdp: use recvfrom instead of poll syscall")

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
drivers/net/af_xdp/compat.h
drivers/net/af_xdp/rte_eth_af_xdp.c