Skip to content

Commit aa2cad0

Browse files
lrq-maxborkmann
authored andcommitted
xdp: Fix xsk_generic_xmit errno
Propagate sock_alloc_send_skb error code, not set it to EAGAIN unconditionally, when fail to allocate skb, which might cause that user space unnecessary loops. Fixes: 35fcde7 ("xsk: support for Tx") Signed-off-by: Li RongQing <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Björn Töpel <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent d4060ac commit aa2cad0

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
@@ -352,10 +352,8 @@ static int xsk_generic_xmit(struct sock *sk)
352352

353353
len = desc.len;
354354
skb = sock_alloc_send_skb(sk, len, 1, &err);
355-
if (unlikely(!skb)) {
356-
err = -EAGAIN;
355+
if (unlikely(!skb))
357356
goto out;
358-
}
359357

360358
skb_put(skb, len);
361359
addr = desc.addr;

0 commit comments

Comments
 (0)