]> 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)
commitea7137ae213c51a3df3fb0fa27a713a8b932f639
tree254b6dc6aed11912cc16e0552762b67cfebe0739
parent1539452ef43d6dd99e1fb581293e58ae0a839b91
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: dedf51134337 ("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