[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <42gn3eaqfcs7qaei7qf3nrtvcp3kztuex5ttcaahfntzx6hw6v@afsmwqb4xhmj>
Date: Wed, 20 Nov 2024 17:25:40 -0800
From: Leo Stone <leocstone@...il.com>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, horms@...nel.org, shuah@...nel.org, netdev@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-kernel-mentees@...ts.linuxfoundation.org
Subject: Re: [PATCH net-next] selftests: net/psock_lib: Handle EINTR and
EAGAIN
Willem de Bruijn wrote:
> Did you observe actual issues or is this based on the comment in the
> existing code ("Should really handle EINTR and EAGAIN").
No, this patch was based purely off of the comment, and the examples of
similar code in other selftests, e.g. tools/testing/selftests/bpf/xsk.c:
> static int netlink_recvmsg(int sock, struct msghdr *mhdr, int flags)
> {
> int len;
>
> do {
> len = recvmsg(sock, mhdr, flags);
> } while (len < 0 && (errno == EINTR || errno == EAGAIN));
>
> if (len < 0)
> return -errno;
> return len;
> }
> A simpler approach to dealing with EINTR is to ask glibc to restart
> with sigaction or siginterrupt.
>
If we want to handle it that way, this patch is probably not necessary,
since there is no specific signal I would want to install a handler for.
Thanks for your feedback,
Leo
Powered by blists - more mailing lists