* [PATCH net-next] vsock/test: fix vsock_ioctl_int() check for unsupported ioctl
@ 2025-07-15 9:32 Stefano Garzarella
2025-07-15 9:59 ` Xuewei Niu
2025-07-16 23:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Stefano Garzarella @ 2025-07-15 9:32 UTC (permalink / raw)
To: netdev; +Cc: Stefano Garzarella, niuxuewei.nxw
From: Stefano Garzarella <sgarzare@redhat•com>
`vsock_do_ioctl` returns -ENOIOCTLCMD if an ioctl support is not
implemented, like for SIOCINQ before commit f7c722659275 ("vsock: Add
support for SIOCINQ ioctl"). In net/socket.c, -ENOIOCTLCMD is re-mapped
to -ENOTTY for the user space. So, our test suite, without that commit
applied, is failing in this way:
34 - SOCK_STREAM ioctl(SIOCINQ) functionality...ioctl(21531): Inappropriate ioctl for device
Return false in vsock_ioctl_int() to skip the test in this case as well,
instead of failing.
Fixes: 53548d6bffac ("test/vsock: Add retry mechanism to ioctl wrapper")
Cc: niuxuewei.nxw@antgroup•com
Signed-off-by: Stefano Garzarella <sgarzare@redhat•com>
---
tools/testing/vsock/util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/vsock/util.c b/tools/testing/vsock/util.c
index 1e65c5abd85b..7b861a8e997a 100644
--- a/tools/testing/vsock/util.c
+++ b/tools/testing/vsock/util.c
@@ -116,7 +116,7 @@ bool vsock_ioctl_int(int fd, unsigned long op, int expected)
do {
ret = ioctl(fd, op, &actual);
if (ret < 0) {
- if (errno == EOPNOTSUPP)
+ if (errno == EOPNOTSUPP || errno == ENOTTY)
break;
perror(name);
--
2.50.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] vsock/test: fix vsock_ioctl_int() check for unsupported ioctl
2025-07-15 9:32 [PATCH net-next] vsock/test: fix vsock_ioctl_int() check for unsupported ioctl Stefano Garzarella
@ 2025-07-15 9:59 ` Xuewei Niu
2025-07-16 23:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Xuewei Niu @ 2025-07-15 9:59 UTC (permalink / raw)
To: Stefano Garzarella, netdev
On 2025/7/15 17:32, Stefano Garzarella wrote:
> From: Stefano Garzarella <sgarzare@redhat•com>
>
> `vsock_do_ioctl` returns -ENOIOCTLCMD if an ioctl support is not
> implemented, like for SIOCINQ before commit f7c722659275 ("vsock: Add
> support for SIOCINQ ioctl"). In net/socket.c, -ENOIOCTLCMD is re-mapped
> to -ENOTTY for the user space. So, our test suite, without that commit
> applied, is failing in this way:
>
> 34 - SOCK_STREAM ioctl(SIOCINQ) functionality...ioctl(21531): Inappropriate ioctl for device
>
> Return false in vsock_ioctl_int() to skip the test in this case as well,
> instead of failing.
>
> Fixes: 53548d6bffac ("test/vsock: Add retry mechanism to ioctl wrapper")
> Cc: niuxuewei.nxw@antgroup•com
> Signed-off-by: Stefano Garzarella <sgarzare@redhat•com>
> ---
> tools/testing/vsock/util.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/vsock/util.c b/tools/testing/vsock/util.c
> index 1e65c5abd85b..7b861a8e997a 100644
> --- a/tools/testing/vsock/util.c
> +++ b/tools/testing/vsock/util.c
> @@ -116,7 +116,7 @@ bool vsock_ioctl_int(int fd, unsigned long op, int expected)
> do {
> ret = ioctl(fd, op, &actual);
> if (ret < 0) {
> - if (errno == EOPNOTSUPP)
> + if (errno == EOPNOTSUPP || errno == ENOTTY)
> break;
>
> perror(name);
LGTM, thanks!
Reviewed-by: Xuewei Niu <niuxuewei.nxw@antgroup•com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] vsock/test: fix vsock_ioctl_int() check for unsupported ioctl
2025-07-15 9:32 [PATCH net-next] vsock/test: fix vsock_ioctl_int() check for unsupported ioctl Stefano Garzarella
2025-07-15 9:59 ` Xuewei Niu
@ 2025-07-16 23:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-07-16 23:20 UTC (permalink / raw)
To: Stefano Garzarella; +Cc: netdev, niuxuewei.nxw
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel•org>:
On Tue, 15 Jul 2025 11:32:33 +0200 you wrote:
> From: Stefano Garzarella <sgarzare@redhat•com>
>
> `vsock_do_ioctl` returns -ENOIOCTLCMD if an ioctl support is not
> implemented, like for SIOCINQ before commit f7c722659275 ("vsock: Add
> support for SIOCINQ ioctl"). In net/socket.c, -ENOIOCTLCMD is re-mapped
> to -ENOTTY for the user space. So, our test suite, without that commit
> applied, is failing in this way:
>
> [...]
Here is the summary with links:
- [net-next] vsock/test: fix vsock_ioctl_int() check for unsupported ioctl
https://git.kernel.org/netdev/net-next/c/47ee43e4bf50
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-16 23:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-15 9:32 [PATCH net-next] vsock/test: fix vsock_ioctl_int() check for unsupported ioctl Stefano Garzarella
2025-07-15 9:59 ` Xuewei Niu
2025-07-16 23:20 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox