Skip to content

Commit

Permalink
samples/bpf: deal with EBUSY return code from sendmsg in xdpsock sample
Browse files Browse the repository at this point in the history
Sendmsg in the SKB path of AF_XDP can now return EBUSY when a packet
was discarded and completed by the driver. Just ignore this message
in the sample application.

Fixes: b4b8faa ("samples/bpf: sample application and documentation for AF_XDP sockets")
Signed-off-by: Magnus Karlsson <[email protected]>
Reported-by: Pavel Odintsov <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
  • Loading branch information
magnus-karlsson authored and Alexei Starovoitov committed Jul 3, 2018
1 parent fe58868 commit c03079c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion samples/bpf/xdpsock_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ static void kick_tx(int fd)
int ret;

ret = sendto(fd, NULL, 0, MSG_DONTWAIT, NULL, 0);
if (ret >= 0 || errno == ENOBUFS || errno == EAGAIN)
if (ret >= 0 || errno == ENOBUFS || errno == EAGAIN || errno == EBUSY)
return;
lassert(0);
}
Expand Down

0 comments on commit c03079c

Please sign in to comment.