Commit 2d55d614 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by Daniel Borkmann

net: xsk: don't return frames via the allocator on error

xdp_return_buff() is used when frame has been successfully
handled (transmitted) or if an error occurred during delayed
processing and there is no way to report it back to
xdp_do_redirect().

In case of __xsk_rcv_zc() error is propagated all the way
back to the driver, so there is no need to call
xdp_return_buff().  Driver will recycle the frame anyway
after seeing that error happened.

Fixes: 173d3adb ("xsk: add zero-copy support for Rx")
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: default avatarBjörn Töpel <bjorn.topel@intel.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 573b3aa6
...@@ -84,10 +84,8 @@ static int __xsk_rcv_zc(struct xdp_sock *xs, struct xdp_buff *xdp, u32 len) ...@@ -84,10 +84,8 @@ static int __xsk_rcv_zc(struct xdp_sock *xs, struct xdp_buff *xdp, u32 len)
{ {
int err = xskq_produce_batch_desc(xs->rx, (u64)xdp->handle, len); int err = xskq_produce_batch_desc(xs->rx, (u64)xdp->handle, len);
if (err) { if (err)
xdp_return_buff(xdp);
xs->rx_dropped++; xs->rx_dropped++;
}
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment