]> git.baikalelectronics.ru Git - kernel.git/commit
xsk: Rollback reservation at NETDEV_TX_BUSY
authorMagnus Karlsson <magnus.karlsson@intel.com>
Fri, 18 Dec 2020 13:45:25 +0000 (14:45 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 18 Dec 2020 15:10:21 +0000 (16:10 +0100)
commit375fd4f2eaa2d6b46bbed351431f35bb10a35c12
tree254b6dc6aed11912cc16e0552762b67cfebe0739
parent28cdb9f4e0da625ef3dd3fb38aff56af50a6e521
xsk: Rollback reservation at NETDEV_TX_BUSY

Rollback the reservation in the completion ring when we get a
NETDEV_TX_BUSY. When this error is received from the driver, we are
supposed to let the user application retry the transmit again. And in
order to do this, we need to roll back the failed send so it can be
retried. Unfortunately, we did not cancel the reservation we had made
in the completion ring. By not doing this, we actually make the
completion ring one entry smaller per NETDEV_TX_BUSY error we get, and
after enough of these errors the completion ring will be of size zero
and transmit will stop working.

Fix this by cancelling the reservation when we get a NETDEV_TX_BUSY
error.

Fixes: 3c7d000d97b5 ("xsk: Do not discard packet when NETDEV_TX_BUSY")
Reported-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Björn Töpel <bjorn.topel@intel.com>
Link: https://lore.kernel.org/bpf/20201218134525.13119-3-magnus.karlsson@gmail.com
net/xdp/xsk.c
net/xdp/xsk_queue.h