Skip to content

Commit 2d55d61

Browse files
Jakub Kicinskiborkmann
authored andcommitted
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: 173d3ad ("xsk: add zero-copy support for Rx") Signed-off-by: Jakub Kicinski <[email protected]> Acked-by: Björn Töpel <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
1 parent 573b3aa commit 2d55d61

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

net/xdp/xsk.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,8 @@ static int __xsk_rcv_zc(struct xdp_sock *xs, struct xdp_buff *xdp, u32 len)
8484
{
8585
int err = xskq_produce_batch_desc(xs->rx, (u64)xdp->handle, len);
8686

87-
if (err) {
88-
xdp_return_buff(xdp);
87+
if (err)
8988
xs->rx_dropped++;
90-
}
9189

9290
return err;
9391
}

0 commit comments

Comments
 (0)