]> www.infradead.org Git - nvme.git/commit
xsk: Fix __xsk_generic_xmit() error code when cq is full
authorWang Liang <wangliang74@huawei.com>
Thu, 27 Feb 2025 08:10:52 +0000 (16:10 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 3 Apr 2025 04:55:43 +0000 (21:55 -0700)
commit5d0b204654de25615cf712be86c3192eca68ed80
treefee3c9ebf35352be9d43a77300724f3a1cbe280b
parenta1b5bd45d4ee58af4f56e49497b8c3db96d8f8a3
xsk: Fix __xsk_generic_xmit() error code when cq is full

When the cq reservation is failed, the error code is not set which is
initialized to zero in __xsk_generic_xmit(). That means the packet is not
send successfully but sendto() return ok.

Considering the impact on uapi, return -EAGAIN is a good idea. The cq is
full usually because it is not released in time, try to send msg again is
appropriate.

The bug was at the very early implementation of xsk, so the Fixes tag
targets the commit that introduced the changes in
xsk_cq_reserve_addr_locked where this fix depends on.

Fixes: e6c4047f5122 ("xsk: Use xsk_buff_pool directly for cq functions")
Suggested-by: Magnus Karlsson <magnus.karlsson@gmail.com>
Signed-off-by: Wang Liang <wangliang74@huawei.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20250227081052.4096337-1-wangliang74@huawei.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
net/xdp/xsk.c