Netdev List
 help / color / mirror / Atom feed
From: Magnus Karlsson <magnus.karlsson@intel.com>
To: magnus.karlsson@intel.com, bjorn.topel@intel.com, ast@fb.com,
	daniel@iogearbox.net, netdev@vger.kernel.org,
	eric.dumazet@gmail.com, liu.song.a23@gmail.com
Cc: qi.z.zhang@intel.com, pavel@fastnetmon.com
Subject: [PATCH bpf v2 3/4] samples/bpf: deal with EBUSY return code from sendmsg in xdpsock sample
Date: Fri, 29 Jun 2018 09:48:19 +0200	[thread overview]
Message-ID: <1530258500-9126-4-git-send-email-magnus.karlsson@intel.com> (raw)
In-Reply-To: <1530258500-9126-1-git-send-email-magnus.karlsson@intel.com>

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: b4b8faa1ded7 ("samples/bpf: sample application and documentation for AF_XDP sockets")
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Reported-by: Pavel Odintsov <pavel@fastnetmon.com>
---
 samples/bpf/xdpsock_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/samples/bpf/xdpsock_user.c b/samples/bpf/xdpsock_user.c
index d69c8d78d3fd..5904b1543831 100644
--- a/samples/bpf/xdpsock_user.c
+++ b/samples/bpf/xdpsock_user.c
@@ -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);
 }
-- 
2.7.4

  parent reply	other threads:[~2018-06-29  7:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-29  7:48 [PATCH bpf v2 0/4] Bug fixes to the SKB TX path of AF_XDP Magnus Karlsson
2018-06-29  7:48 ` [PATCH bpf v2 1/4] xsk: fix potential lost completion message in SKB path Magnus Karlsson
2018-06-29  7:48 ` [PATCH bpf v2 2/4] xsk: frame could be completed more than once " Magnus Karlsson
2018-06-29  7:48 ` Magnus Karlsson [this message]
2018-06-29  7:48 ` [PATCH bpf v2 4/4] xsk: fix potential race in SKB TX completion code Magnus Karlsson
2018-07-03  1:39 ` [PATCH bpf v2 0/4] Bug fixes to the SKB TX path of AF_XDP Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1530258500-9126-4-git-send-email-magnus.karlsson@intel.com \
    --to=magnus.karlsson@intel.com \
    --cc=ast@fb.com \
    --cc=bjorn.topel@intel.com \
    --cc=daniel@iogearbox.net \
    --cc=eric.dumazet@gmail.com \
    --cc=liu.song.a23@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pavel@fastnetmon.com \
    --cc=qi.z.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox