xsk: frame could be completed more than once in SKB path
authorMagnus Karlsson <magnus.karlsson@intel.com>
Fri, 29 Jun 2018 07:48:18 +0000 (09:48 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 3 Jul 2018 01:37:11 +0000 (18:37 -0700)
commitfe5886852601fb2593cbc5a7549ef9fd2ef481ba
tree9a70b5726fb7b432289dd130d5d871d0a61de56b
parent20b52a75166086a40d838397ef3db28a4f2c5998
xsk: frame could be completed more than once in SKB path

Fixed a bug in which a frame could be completed more than once
when an error was returned from dev_direct_xmit(). The code
erroneously retried sending the message leading to multiple
calls to the SKB destructor and therefore multiple completions
of the same buffer to user space.

The error code in this case has been changed from EAGAIN to EBUSY
in order to tell user space that the sending of the packet failed
and the buffer has been return to user space through the completion
queue.

Fixes: 35fcde7f8deb ("xsk: support for Tx")
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Reported-by: Pavel Odintsov <pavel@fastnetmon.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
net/xdp/xsk.c