[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250423152333.68117196@kernel.org>
Date: Wed, 23 Apr 2025 15:23:33 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Bui Quang Minh <minhquangbui99@...il.com>
Cc: virtualization@...ts.linux.dev, "Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>, Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Andrew Lunn <andrew+netdev@...n.ch>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, Jesper Dangaard Brouer
<hawk@...nel.org>, John Fastabend <john.fastabend@...il.com>, Eugenio
Pérez <eperezma@...hat.com>, "David S. Miller"
<davem@...emloft.net>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: [PATCH v4 4/4] selftests: net: add a virtio_net deadlock
selftest
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?
Powered by blists - more mailing lists