xsk: Skip polling event check for unbound socket
authorYewon Choi <woni9911@gmail.com>
Fri, 1 Dec 2023 06:10:52 +0000 (15:10 +0900)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 5 Dec 2023 12:43:43 +0000 (13:43 +0100)
commite4d008d49a7135214e0ee70537405b6a069e3a3f
tree49a625866ba1bff1b71d541004e9045816a92b6c
parentdfce9cb3140592b886838e06f3e0c25fea2a9cae
xsk: Skip polling event check for unbound socket

In xsk_poll(), checking available events and setting mask bits should
be executed only when a socket has been bound. Setting mask bits for
unbound socket is meaningless.

Currently, it checks events even when xsk_check_common() failed.
To prevent this, we move goto location (skip_tx) after that checking.

Fixes: 1596dae2f17e ("xsk: check IFF_UP earlier in Tx path")
Signed-off-by: Yewon Choi <woni9911@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>
Link: https://lore.kernel.org/bpf/20231201061048.GA1510@libra05
net/xdp/xsk.c