net: adress some sparse warnings
Subsystems (6)
cover net: adress some sparse warnings
This series adds missing declarations and move others to address W=1 C=1 warnings in tcp and udp.
Eric Dumazet (5):
tcp: add declarations to avoid warnings
tcp: move ipv6_specific declaration to remove a warning
tcp: move ipv4_specific to tcp include file
net: move tcp gro declarations to net/tcp.h
udp: move gro declarations to net/udp.h
include/net/tcp.h | 10 ++++++++++ include/net/transp_v6.h | 3 --- include/net/udp.h | 7 +++++++ net/ipv4/af_inet.c | 6 ------ net/ipv6/ip6_offload.c | 8 ++------ net/mptcp/protocol.h | 5 ----- 6 files changed, 19 insertions(+), 20 deletions(-)
Signature · 1 line
2.27.0.111.gc72c7da667-goog
PATCH 1/5 tcp: add declarations to avoid warnings
Remove these errors:
net/ipv6/tcp_ipv6.c:1550:29: warning: symbol 'tcp_v6_rcv' was not declared. Should it be static? net/ipv6/tcp_ipv6.c:1770:30: warning: symbol 'tcp_v6_early_demux' was not declared. Should it be static?
net/ipv6/tcp_ipv6.c:1550:29: warning: no previous prototype for 'tcp_v6_rcv' [-Wmissing-prototypes]
1550 | INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb)
| ^~~~~~~~~~
net/ipv6/tcp_ipv6.c:1770:30: warning: no previous prototype for 'tcp_v6_early_demux' [-Wmissing-prototypes]
1770 | INDIRECT_CALLABLE_SCOPE void tcp_v6_early_demux(struct sk_buff *skb)
| ^~~~~~~~~~~~~~~~~~--- include/net/tcp.h | 2 ++ 1 file changed, 2 insertions(+)
include/net/tcp.h +2 -0
@@ -934,6 +934,8 @@ static inline int tcp_v6_sdif(const struct sk_buff *skb) } INDIRECT_CALLABLE_DECLARE(void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb)); +INDIRECT_CALLABLE_DECLARE(int tcp_v6_rcv(struct sk_buff *skb)); +INDIRECT_CALLABLE_DECLARE(void tcp_v6_early_demux(struct sk_buff *skb));#endif
Signature · 1 line
2.27.0.111.gc72c7da667-goog
PATCH 2/5 tcp: move ipv6_specific declaration to remove a warning
In reply to Eric Dumazetipv6_specific should be declared in tcp include files, not mptcp.
This removes the following warning :
CHECK net/ipv6/tcp_ipv6.cnet/ipv6/tcp_ipv6.c:78:42: warning: symbol 'ipv6_specific' was not declared. Should it be static?
--- include/net/tcp.h | 2 ++ net/mptcp/protocol.h | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-)
include/net/tcp.h +2 -0
@@ -933,6 +933,8 @@ static inline int tcp_v6_sdif(const struct sk_buff *skb)return 0 ; } +extern const struct inet_connection_sock_af_ops ipv6_specific; + INDIRECT_CALLABLE_DECLARE(void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb)); INDIRECT_CALLABLE_DECLARE(int tcp_v6_rcv(struct sk_buff *skb)); INDIRECT_CALLABLE_DECLARE(void tcp_v6_early_demux(struct sk_buff *skb));
net/mptcp/protocol.h +0 -3
@@ -355,9 +355,6 @@ static inline void mptcp_subflow_tcp_fallback(struct sock *sk, }extern const struct inet_connection_sock_af_ops ipv4_specific; -#if IS_ENABLED (CONFIG_MPTCP_IPV6 ) -extern const struct inet_connection_sock_af_ops ipv6_specific; -#endif void mptcp_proto_init (void );#if IS_ENABLED (CONFIG_MPTCP_IPV6 )
Signature · 1 line
2.27.0.111.gc72c7da667-goog
PATCH 3/5 tcp: move ipv4_specific to tcp include file
In reply to Eric DumazetDeclare ipv4_specific once, in tcp.h were it belongs.
--- include/net/tcp.h | 2 ++ include/net/transp_v6.h | 3 --- net/mptcp/protocol.h | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-)
include/net/tcp.h +2 -0
@@ -907,6 +907,8 @@ static inline void tcp_skb_bpf_redirect_clear(struct sk_buff *skb)TCP_SKB_CB (skb)->bpf.sk_redir =NULL ; } +extern const struct inet_connection_sock_af_ops ipv4_specific; +#if IS_ENABLED (CONFIG_IPV6 )/* This is the variant of inet6_iif() that must be used by TCP, * as TCP moves IP6CB into a different location in skb->cb[]
include/net/transp_v6.h +0 -3
@@ -56,9 +56,6 @@ ip6_dgram_sock_seq_show(struct seq_file *seq, struct sock *sp, __u16 srcp,#define LOOPBACK4_IPV6 cpu_to_be32(0x7f000006) -/* address family specific functions */ -extern const struct inet_connection_sock_af_ops ipv4_specific; -void inet6_destroy_sock (struct sock *sk);#define IPV6_SEQ_DGRAM_HEADER \
net/mptcp/protocol.h +0 -2
@@ -354,8 +354,6 @@ static inline void mptcp_subflow_tcp_fallback(struct sock *sk,inet_csk (sk)->icsk_af_ops = ctx->icsk_af_ops; } -extern const struct inet_connection_sock_af_ops ipv4_specific; -void mptcp_proto_init (void );#if IS_ENABLED (CONFIG_MPTCP_IPV6 )int mptcp_proto_v6_init (void );
Signature · 1 line
2.27.0.111.gc72c7da667-goog
PATCH 4/5 net: move tcp gro declarations to net/tcp.h
In reply to Eric DumazetThis patch removes following (C=1 W=1) warnings for CONFIG_RETPOLINE=y :
net/ipv4/tcp_offload.c:306:16: warning: symbol 'tcp4_gro_receive' was not declared. Should it be static? net/ipv4/tcp_offload.c:306:17: warning: no previous prototype for 'tcp4_gro_receive' [-Wmissing-prototypes] net/ipv4/tcp_offload.c:319:29: warning: symbol 'tcp4_gro_complete' was not declared. Should it be static? net/ipv4/tcp_offload.c:319:29: warning: no previous prototype for 'tcp4_gro_complete' [-Wmissing-prototypes]
CHECK net/ipv6/tcpv6_offload.cnet/ipv6/tcpv6_offload.c:16:16: warning: symbol 'tcp6_gro_receive' was not declared. Should it be static? net/ipv6/tcpv6_offload.c:29:29: warning: symbol 'tcp6_gro_complete' was not declared. Should it be static?
CC net/ipv6/tcpv6_offload.onet/ipv6/tcpv6_offload.c:16:17: warning: no previous prototype for 'tcp6_gro_receive' [-Wmissing-prototypes]
16 | struct sk_buff *tcp6_gro_receive(struct list_head *head, struct sk_buff *skb)
| ^~~~~~~~~~~~~~~~
net/ipv6/tcpv6_offload.c:29:29: warning: no previous prototype for 'tcp6_gro_complete' [-Wmissing-prototypes]
29 | INDIRECT_CALLABLE_SCOPE int tcp6_gro_complete(struct sk_buff *skb, int thoff)
| ^~~~~~~~~~~~~~~~~--- include/net/tcp.h | 4 ++++ net/ipv4/af_inet.c | 3 --- net/ipv6/ip6_offload.c | 4 +--- 3 files changed, 5 insertions(+), 6 deletions(-)
include/net/tcp.h +4 -0
@@ -1957,6 +1957,10 @@ void tcp_v4_destroy_sock(struct sock *sk);struct sk_buff *tcp_gso_segment (struct sk_buff *skb,netdev_features_t features);struct sk_buff *tcp_gro_receive (struct list_head *head,struct sk_buff *skb); +INDIRECT_CALLABLE_DECLARE(int tcp4_gro_complete(struct sk_buff *skb, int thoff)); +INDIRECT_CALLABLE_DECLARE(struct sk_buff *tcp4_gro_receive(struct list_head *head, struct sk_buff *skb)); +INDIRECT_CALLABLE_DECLARE(int tcp6_gro_complete(struct sk_buff *skb, int thoff)); +INDIRECT_CALLABLE_DECLARE(struct sk_buff *tcp6_gro_receive(struct list_head *head, struct sk_buff *skb));int tcp_gro_complete (struct sk_buff *skb);void __tcp_v4_send_check (struct sk_buff *skb,__be32 saddr,__be32 daddr);
net/ipv4/af_inet.c +0 -3
@@ -1432,8 +1432,6 @@ static struct sk_buff *ipip_gso_segment(struct sk_buff *skb,return inet_gso_segment (skb, features); } -INDIRECT_CALLABLE_DECLARE(struct sk_buff *tcp4_gro_receive(struct list_head *, -struct sk_buff *)); INDIRECT_CALLABLE_DECLARE(struct sk_buff *udp4_gro_receive(struct list_head *,struct sk_buff *));struct sk_buff *inet_gro_receive (struct list_head *head,struct sk_buff *skb)
@@ -1608,7 +1606,6 @@ int inet_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)return -EINVAL ; } -INDIRECT_CALLABLE_DECLARE(int tcp4_gro_complete(struct sk_buff *, int)); INDIRECT_CALLABLE_DECLARE(int udp4_gro_complete(struct sk_buff *, int));int inet_gro_complete (struct sk_buff *skb,int nhoff) {
net/ipv6/ip6_offload.c +1 -3
@@ -13,6 +13,7 @@#include <net/protocol.h> #include <net/ipv6.h> #include <net/inet_common.h> +#include <net/tcp.h> #include "ip6_offload.h"
@@ -177,8 +178,6 @@ static int ipv6_exthdrs_len(struct ipv6hdr *iph,return len; } -INDIRECT_CALLABLE_DECLARE(struct sk_buff *tcp6_gro_receive(struct list_head *, -struct sk_buff *)); INDIRECT_CALLABLE_DECLARE(struct sk_buff *udp6_gro_receive(struct list_head *,struct sk_buff *)); INDIRECT_CALLABLE_SCOPE struct sk_buff *ipv6_gro_receive(struct list_head *head,
@@ -319,7 +318,6 @@ static struct sk_buff *ip4ip6_gro_receive(struct list_head *head,return inet_gro_receive (head, skb); } -INDIRECT_CALLABLE_DECLARE(int tcp6_gro_complete(struct sk_buff *, int)); INDIRECT_CALLABLE_DECLARE(int udp6_gro_complete(struct sk_buff *, int)); INDIRECT_CALLABLE_SCOPE int ipv6_gro_complete(struct sk_buff *skb, int nhoff) {
Signature · 1 line
2.27.0.111.gc72c7da667-goog
PATCH 5/5 udp: move gro declarations to net/udp.h
In reply to Eric DumazetThis removes following warnings :
CC net/ipv4/udp_offload.onet/ipv4/udp_offload.c:504:17: warning: no previous prototype for 'udp4_gro_receive' [-Wmissing-prototypes]
504 | struct sk_buff *udp4_gro_receive(struct list_head *head, struct sk_buff *skb)
| ^~~~~~~~~~~~~~~~
net/ipv4/udp_offload.c:584:29: warning: no previous prototype for 'udp4_gro_complete' [-Wmissing-prototypes]
584 | INDIRECT_CALLABLE_SCOPE int udp4_gro_complete(struct sk_buff *skb, int nhoff)
| ^~~~~~~~~~~~~~~~~ CHECK net/ipv6/udp_offload.cnet/ipv6/udp_offload.c:115:16: warning: symbol 'udp6_gro_receive' was not declared. Should it be static? net/ipv6/udp_offload.c:148:29: warning: symbol 'udp6_gro_complete' was not declared. Should it be static?
CC net/ipv6/udp_offload.onet/ipv6/udp_offload.c:115:17: warning: no previous prototype for 'udp6_gro_receive' [-Wmissing-prototypes]
115 | struct sk_buff *udp6_gro_receive(struct list_head *head, struct sk_buff *skb)
| ^~~~~~~~~~~~~~~~
net/ipv6/udp_offload.c:148:29: warning: no previous prototype for 'udp6_gro_complete' [-Wmissing-prototypes]
148 | INDIRECT_CALLABLE_SCOPE int udp6_gro_complete(struct sk_buff *skb, int nhoff)
| ^~~~~~~~~~~~~~~~~--- include/net/udp.h | 7 +++++++ net/ipv4/af_inet.c | 3 --- net/ipv6/ip6_offload.c | 4 +--- 3 files changed, 8 insertions(+), 6 deletions(-)
include/net/udp.h +7 -0
@@ -27,6 +27,7 @@#include <linux/ipv6.h> #include <linux/seq_file.h> #include <linux/poll.h> +#include <linux/indirect_call_wrapper.h> /** * struct udp_skb_cb - UDP(-Lite) private variables
@@ -166,6 +167,12 @@ static inline void udp_csum_pull_header(struct sk_buff *skb)typedef struct sock *(*udp_lookup_t )(struct sk_buff *skb,__be16 sport,__be16 dport); +INDIRECT_CALLABLE_DECLARE(struct sk_buff *udp4_gro_receive(struct list_head *, +struct sk_buff *)); +INDIRECT_CALLABLE_DECLARE(int udp4_gro_complete(struct sk_buff *, int)); +INDIRECT_CALLABLE_DECLARE(struct sk_buff *udp6_gro_receive(struct list_head *, +struct sk_buff *)); +INDIRECT_CALLABLE_DECLARE(int udp6_gro_complete(struct sk_buff *, int));struct sk_buff *udp_gro_receive (struct list_head *head,struct sk_buff *skb,struct udphdr *uh,struct sock *sk);int udp_gro_complete (struct sk_buff *skb,int nhoff,udp_lookup_t lookup);
net/ipv4/af_inet.c +0 -3
@@ -1432,8 +1432,6 @@ static struct sk_buff *ipip_gso_segment(struct sk_buff *skb,return inet_gso_segment (skb, features); } -INDIRECT_CALLABLE_DECLARE(struct sk_buff *udp4_gro_receive(struct list_head *, -struct sk_buff *));struct sk_buff *inet_gro_receive (struct list_head *head,struct sk_buff *skb) {const struct net_offload *ops;
@@ -1606,7 +1604,6 @@ int inet_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)return -EINVAL ; } -INDIRECT_CALLABLE_DECLARE(int udp4_gro_complete(struct sk_buff *, int));int inet_gro_complete (struct sk_buff *skb,int nhoff) {__be16 newlen =htons (skb->len - nhoff);
net/ipv6/ip6_offload.c +1 -3
@@ -14,6 +14,7 @@#include <net/ipv6.h> #include <net/inet_common.h> #include <net/tcp.h> +#include <net/udp.h> #include "ip6_offload.h"
@@ -178,8 +179,6 @@ static int ipv6_exthdrs_len(struct ipv6hdr *iph,return len; } -INDIRECT_CALLABLE_DECLARE(struct sk_buff *udp6_gro_receive(struct list_head *, -struct sk_buff *)); INDIRECT_CALLABLE_SCOPE struct sk_buff *ipv6_gro_receive(struct list_head *head,struct sk_buff *skb) {
@@ -318,7 +317,6 @@ static struct sk_buff *ip4ip6_gro_receive(struct list_head *head,return inet_gro_receive (head, skb); } -INDIRECT_CALLABLE_DECLARE(int udp6_gro_complete(struct sk_buff *, int)); INDIRECT_CALLABLE_SCOPE int ipv6_gro_complete(struct sk_buff *skb, int nhoff) {const struct net_offload *ops;
Signature · 1 line
2.27.0.111.gc72c7da667-goog
David Miller
maintainerFrom: Eric Dumazet <[email protected]>
Date: Tue, 23 Jun 2020 15:31:10 -0700
Quoted 2 lines
This series adds missing declarations and move others to address W=1 C=1 warnings in tcp and udp.
I fixed up 's/adress/address/' for you.
Applied and queued up for -stable.