* [PATCH net] vsock: fix `vsock_proto` declaration
@ 2025-07-03 11:23 Stefano Garzarella
2025-07-03 11:24 ` Michael S. Tsirkin
2025-07-08 0:43 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Stefano Garzarella @ 2025-07-03 11:23 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, Bobby Eshleman, Jakub Kicinski, Simon Horman,
Stefano Garzarella, Paolo Abeni, Michael S. Tsirkin,
virtualization, bpf, David S. Miller, Eric Dumazet
From: Stefano Garzarella <sgarzare@redhat.com>
From commit 634f1a7110b4 ("vsock: support sockmap"), `struct proto
vsock_proto`, defined in af_vsock.c, is not static anymore, since it's
used by vsock_bpf.c.
If CONFIG_BPF_SYSCALL is not defined, `make C=2` will print a warning:
$ make O=build C=2 W=1 net/vmw_vsock/
...
CC [M] net/vmw_vsock/af_vsock.o
CHECK ../net/vmw_vsock/af_vsock.c
../net/vmw_vsock/af_vsock.c:123:14: warning: symbol 'vsock_proto' was not declared. Should it be static?
Declare `vsock_proto` regardless of CONFIG_BPF_SYSCALL, since it's defined
in af_vsock.c, which is built regardless of CONFIG_BPF_SYSCALL.
Fixes: 634f1a7110b4 ("vsock: support sockmap")
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
---
include/net/af_vsock.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h
index d56e6e135158..d40e978126e3 100644
--- a/include/net/af_vsock.h
+++ b/include/net/af_vsock.h
@@ -243,8 +243,8 @@ int __vsock_dgram_recvmsg(struct socket *sock, struct msghdr *msg,
int vsock_dgram_recvmsg(struct socket *sock, struct msghdr *msg,
size_t len, int flags);
-#ifdef CONFIG_BPF_SYSCALL
extern struct proto vsock_proto;
+#ifdef CONFIG_BPF_SYSCALL
int vsock_bpf_update_proto(struct sock *sk, struct sk_psock *psock, bool restore);
void __init vsock_bpf_build_proto(void);
#else
--
2.50.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] vsock: fix `vsock_proto` declaration
2025-07-03 11:23 [PATCH net] vsock: fix `vsock_proto` declaration Stefano Garzarella
@ 2025-07-03 11:24 ` Michael S. Tsirkin
2025-07-08 0:43 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2025-07-03 11:24 UTC (permalink / raw)
To: Stefano Garzarella
Cc: netdev, linux-kernel, Bobby Eshleman, Jakub Kicinski,
Simon Horman, Paolo Abeni, virtualization, bpf, David S. Miller,
Eric Dumazet
On Thu, Jul 03, 2025 at 01:23:29PM +0200, Stefano Garzarella wrote:
> From: Stefano Garzarella <sgarzare@redhat.com>
>
> >From commit 634f1a7110b4 ("vsock: support sockmap"), `struct proto
> vsock_proto`, defined in af_vsock.c, is not static anymore, since it's
> used by vsock_bpf.c.
>
> If CONFIG_BPF_SYSCALL is not defined, `make C=2` will print a warning:
> $ make O=build C=2 W=1 net/vmw_vsock/
> ...
> CC [M] net/vmw_vsock/af_vsock.o
> CHECK ../net/vmw_vsock/af_vsock.c
> ../net/vmw_vsock/af_vsock.c:123:14: warning: symbol 'vsock_proto' was not declared. Should it be static?
>
> Declare `vsock_proto` regardless of CONFIG_BPF_SYSCALL, since it's defined
> in af_vsock.c, which is built regardless of CONFIG_BPF_SYSCALL.
>
> Fixes: 634f1a7110b4 ("vsock: support sockmap")
> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> include/net/af_vsock.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h
> index d56e6e135158..d40e978126e3 100644
> --- a/include/net/af_vsock.h
> +++ b/include/net/af_vsock.h
> @@ -243,8 +243,8 @@ int __vsock_dgram_recvmsg(struct socket *sock, struct msghdr *msg,
> int vsock_dgram_recvmsg(struct socket *sock, struct msghdr *msg,
> size_t len, int flags);
>
> -#ifdef CONFIG_BPF_SYSCALL
> extern struct proto vsock_proto;
> +#ifdef CONFIG_BPF_SYSCALL
> int vsock_bpf_update_proto(struct sock *sk, struct sk_psock *psock, bool restore);
> void __init vsock_bpf_build_proto(void);
> #else
> --
> 2.50.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] vsock: fix `vsock_proto` declaration
2025-07-03 11:23 [PATCH net] vsock: fix `vsock_proto` declaration Stefano Garzarella
2025-07-03 11:24 ` Michael S. Tsirkin
@ 2025-07-08 0:43 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-07-08 0:43 UTC (permalink / raw)
To: Stefano Garzarella
Cc: netdev, linux-kernel, bobby.eshleman, kuba, horms, pabeni, mst,
virtualization, bpf, davem, edumazet
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 3 Jul 2025 13:23:29 +0200 you wrote:
> From: Stefano Garzarella <sgarzare@redhat.com>
>
> From commit 634f1a7110b4 ("vsock: support sockmap"), `struct proto
> vsock_proto`, defined in af_vsock.c, is not static anymore, since it's
> used by vsock_bpf.c.
>
> If CONFIG_BPF_SYSCALL is not defined, `make C=2` will print a warning:
> $ make O=build C=2 W=1 net/vmw_vsock/
> ...
> CC [M] net/vmw_vsock/af_vsock.o
> CHECK ../net/vmw_vsock/af_vsock.c
> ../net/vmw_vsock/af_vsock.c:123:14: warning: symbol 'vsock_proto' was not declared. Should it be static?
>
> [...]
Here is the summary with links:
- [net] vsock: fix `vsock_proto` declaration
https://git.kernel.org/netdev/net/c/1e3b66e32601
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-08 0:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-03 11:23 [PATCH net] vsock: fix `vsock_proto` declaration Stefano Garzarella
2025-07-03 11:24 ` Michael S. Tsirkin
2025-07-08 0:43 ` 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;
as well as URLs for NNTP newsgroup(s).