]> git.baikalelectronics.ru Git - kernel.git/commit
xsk: do not return EAGAIN from sendmsg when completion queue is full
authorMagnus Karlsson <magnus.karlsson@intel.com>
Wed, 11 Jul 2018 08:12:50 +0000 (10:12 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 13 Jul 2018 13:34:31 +0000 (15:34 +0200)
commit67da9c376614e939c5c1fbda15029e1675732c04
tree7a040d749346cd1b34b5eaa35980c09a6a57399e
parent2767856c5dfd1d6a6903d71460ac7a07bc5fe26d
xsk: do not return EAGAIN from sendmsg when completion queue is full

This patch stops returning EAGAIN in TX copy mode when the completion
queue is full as zero-copy does not do this. Instead this situation
can be detected by comparing the head and tail pointers of the
completion queue in both modes. In any case, EAGAIN was not the
correct error code here since no amount of calling sendmsg will solve
the problem. Only consuming one or more messages on the completion
queue will fix this.

With this patch, the error reporting becomes consistent between copy
mode and zero-copy mode.

Fixes: b053263a3f77 ("xsk: support for Tx")
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
net/xdp/xsk.c