From: Bui Quang Minh <minhquangbui99@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: virtualization@lists.linux.dev,
"Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"Eric Dumazet" <edumazet@google.com>,
"Paolo Abeni" <pabeni@redhat.com>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Jesper Dangaard Brouer" <hawk@kernel.org>,
"John Fastabend" <john.fastabend@gmail.com>,
"Eugenio Pérez" <eperezma@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org
Subject: Re: [PATCH v4 4/4] selftests: net: add a virtio_net deadlock selftest
Date: Thu, 24 Apr 2025 17:33:49 +0700 [thread overview]
Message-ID: <619bc46d-4acf-4c54-bd47-6b482fb76878@gmail.com> (raw)
In-Reply-To: <20250423152333.68117196@kernel.org>
On 4/24/25 05:23, Jakub Kicinski wrote:
> On Wed, 23 Apr 2025 22:20:41 +0700 Bui Quang Minh wrote:
>> I've tried to make the setup_xsk into each test. However, I've an issue
>> that the XDP socket destruct waits for an RCU grace period as I see this
>> sock's flag SOCK_RCU_FREE is set. So if we start the next test right
>> away, we can have the error when setting up XDP socket again because
>> previous XDP socket has not unbound the network interface's queue yet. I
>> can resolve the issue by putting the sleep(1) after closing the socket
>> in xdp_helper:
>>
>> diff --git a/tools/testing/selftests/net/lib/xdp_helper.c
>> b/tools/testing/selftests/net/lib/xdp_helper.c
>> index f21536ab95ba..e882bb22877f 100644
>> --- a/tools/testing/selftests/net/lib/xdp_helper.c
>> +++ b/tools/testing/selftests/net/lib/xdp_helper.c
>> @@ -162,5 +162,6 @@ int main(int argc, char **argv)
>> */
>>
>> close(sock_fd);
>> + sleep(1);
>> return 0;
>> }
>>
>> Do you think it's enough or do you have a better suggestion here?
> Interesting :S What errno does the kernel return? EBUSY?
> Perhaps we could loop for a second retrying the bind()
> if kernel returns EBUSY in case it's just a socket waiting
> to be cleaned up?
Yes, the kernel returns EBUSY. Loop and retry sounds good to me but it's
not easy to get the return code when using bkg(). So for simplicity,
I'll retry with sleep(1) 3 times when the xdp_helper fails.
Thanks,
Quang Minh.
next prev parent reply other threads:[~2025-04-24 10:33 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-17 7:28 [PATCH v4 0/4] virtio-net: disable delayed refill when pausing rx Bui Quang Minh
2025-04-17 7:28 ` [PATCH v4 1/4] " Bui Quang Minh
2025-04-21 3:03 ` Jason Wang
2025-04-17 7:28 ` [PATCH v4 2/4] selftests: net: move xdp_helper to net/lib Bui Quang Minh
2025-04-17 7:28 ` [PATCH v4 3/4] selftests: net: add flag to force zerocopy mode in xdp_helper Bui Quang Minh
2025-04-23 1:34 ` Jakub Kicinski
2025-04-17 7:28 ` [PATCH v4 4/4] selftests: net: add a virtio_net deadlock selftest Bui Quang Minh
2025-04-23 1:41 ` Jakub Kicinski
2025-04-23 15:20 ` Bui Quang Minh
2025-04-23 22:23 ` Jakub Kicinski
2025-04-24 10:33 ` Bui Quang Minh [this message]
2025-04-24 22:07 ` Jakub Kicinski
2025-04-23 1:50 ` [PATCH v4 0/4] virtio-net: disable delayed refill when pausing rx patchwork-bot+netdevbpf
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=619bc46d-4acf-4c54-bd47-6b482fb76878@gmail.com \
--to=minhquangbui99@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eperezma@redhat.com \
--cc=hawk@kernel.org \
--cc=jasowang@redhat.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.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