diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2020-02-05 22:06:09 +0100 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-02-05 22:06:12 +0100 |
commit | b9e42724888527352604260abc6717cba21421de (patch) | |
tree | d664c62878db152984cb9317a94e5d858515542b /net/core/sock_map.c | |
parent | fc9e34f8de001c92e6cfc6481bb30a34dbda4f5c (diff) | |
parent | 8ed47e140867a6e7d56170f325c8d4fdee6d6b66 (diff) | |
download | linux-b9e42724888527352604260abc6717cba21421de.tar.gz linux-b9e42724888527352604260abc6717cba21421de.tar.bz2 linux-b9e42724888527352604260abc6717cba21421de.zip |
Merge branch 'bpf-xsk-fixes'
Maciej Fijalkowski says:
====================
Cameron reported [0] that on fresh bpf-next he could not run multiple
xdpsock instances in Tx-only mode on single network interface with i40e
driver.
Turns out that Maxim's series [1] which was adding RCU protection around
ndo_xsk_wakeup added check against the __I40E_CONFIG_BUSY being set on
pf->state within i40e_xsk_wakeup() - if it's set, return -ENETDOWN.
Since this bit is set per PF when UMEM is being enabled/disabled, the
situation Cameron stumbled upon was that when he launched second xdpsock
instance, second UMEM was being registered, hence set __I40E_CONFIG_BUSY
which is now observed by first xdpsock and therefore xdpsock's kick_tx()
gets -ENETDOWN as errno.
-ENETDOWN currently is not allowed in kick_tx(), so we were exiting the
first application. Such exit means also XDP program being unloaded and
its dedicated resources, which caused an -ENXIO being return in the
second xdpsock instance.
Let's fix the issue from both sides - protect ourselves from future
xdpsock crashes by allowing for -ENETDOWN errno being set in kick_tx()
(patch 3) and from driver side, return -EAGAIN for the case where PF is
busy (patch 1).
Remove also doubled variable from xdpsock_user.c (patch 2).
Note that ixgbe seems not to be affected since UMEM registration sets
the busy/disable bit per ring, not per PF.
[0]: https://www.spinics.net/lists/xdp-newbies/msg01558.html
[1]: https://lore.kernel.org/netdev/20191217162023.16011-1-maximmi@mellanox.com/
====================
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'net/core/sock_map.c')
0 files changed, 0 insertions, 0 deletions