summaryrefslogtreecommitdiff
path: root/net/xdp
diff options
context:
space:
mode:
authorLi RongQing <lirongqing@baidu.com>2020-06-11 13:11:06 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-06-24 17:50:44 +0200
commite7847db7aa6d3c44f87286f779d1b956a38e5b4d (patch)
treea2b70670243a6c204f68417cd1ea002d6d03a868 /net/xdp
parent57f71bb57f7c74ab06855dba30dd68935168fb7c (diff)
xdp: Fix xsk_generic_xmit errno
[ Upstream commit aa2cad0600ed2ca6a0ab39948d4db1666b6c962b ] 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: 35fcde7f8deb ("xsk: support for Tx") Signed-off-by: Li RongQing <lirongqing@baidu.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Björn Töpel <bjorn.topel@intel.com> Link: https://lore.kernel.org/bpf/1591852266-24017-1-git-send-email-lirongqing@baidu.com Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/xdp')
-rw-r--r--net/xdp/xsk.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 7181a30666b4..f9eb5efb237c 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -362,10 +362,8 @@ static int xsk_generic_xmit(struct sock *sk)
len = desc.len;
skb = sock_alloc_send_skb(sk, len, 1, &err);
- if (unlikely(!skb)) {
- err = -EAGAIN;
+ if (unlikely(!skb))
goto out;
- }
skb_put(skb, len);
addr = desc.addr;