diff options
author | Johan Almbladh <johan.almbladh@anyfinetworks.com> | 2022-07-05 10:23:45 +0200 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2022-07-06 16:43:53 +0200 |
commit | 1fd6e5675336daf4747940b4285e84b0c114ae32 (patch) | |
tree | 926b8eea48ab4d54f7d3b0284557b52f1a0f7e66 /kernel/bpf/core.c | |
parent | ae9fdf6cb4da4265bdc3a574d06eaad02a7f669a (diff) | |
download | linux-stable-1fd6e5675336daf4747940b4285e84b0c114ae32.tar.gz linux-stable-1fd6e5675336daf4747940b4285e84b0c114ae32.tar.bz2 linux-stable-1fd6e5675336daf4747940b4285e84b0c114ae32.zip |
xdp: Fix spurious packet loss in generic XDP TX path
The byte queue limits (BQL) mechanism is intended to move queuing from
the driver to the network stack in order to reduce latency caused by
excessive queuing in hardware. However, when transmitting or redirecting
a packet using generic XDP, the qdisc layer is bypassed and there are no
additional queues. Since netif_xmit_stopped() also takes BQL limits into
account, but without having any alternative queuing, packets are
silently dropped.
This patch modifies the drop condition to only consider cases when the
driver itself cannot accept any more packets. This is analogous to the
condition in __dev_direct_xmit(). Dropped packets are also counted on
the device.
Bypassing the qdisc layer in the generic XDP TX path means that XDP
packets are able to starve other packets going through a qdisc, and
DDOS attacks will be more effective. In-driver-XDP use dedicated TX
queues, so they do not have this starvation issue.
Signed-off-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220705082345.2494312-1-johan.almbladh@anyfinetworks.com
Diffstat (limited to 'kernel/bpf/core.c')
0 files changed, 0 insertions, 0 deletions