diff mbox series

[net-next] fou: remove sparse errors

Message ID 20210831032608.932407-1-eric.dumazet@gmail.com (mailing list archive)
State Accepted
Commit 8d65cd8d25fa23951171094553901d69a88ccdff
Delegated to: Netdev Maintainers
Headers show
Series [net-next] fou: remove sparse errors | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers fail 1 blamed authors not CCed: therbert@google.com; 3 maintainers not CCed: yoshfuji@linux-ipv6.org therbert@google.com dsahern@kernel.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 16 this patch: 6
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch warning WARNING: A patch subject line should describe the change not the tool that found it
netdev/build_allmodconfig_warn success Errors and warnings before: 16 this patch: 6
netdev/header_inline success Link

Commit Message

Eric Dumazet Aug. 31, 2021, 3:26 a.m. UTC
From: Eric Dumazet <edumazet@google.com>

We need to add __rcu qualifier to avoid these errors:

net/ipv4/fou.c:250:18: warning: incorrect type in assignment (different address spaces)
net/ipv4/fou.c:250:18:    expected struct net_offload const **offloads
net/ipv4/fou.c:250:18:    got struct net_offload const [noderef] __rcu **
net/ipv4/fou.c:251:15: error: incompatible types in comparison expression (different address spaces):
net/ipv4/fou.c:251:15:    struct net_offload const [noderef] __rcu *
net/ipv4/fou.c:251:15:    struct net_offload const *
net/ipv4/fou.c:272:18: warning: incorrect type in assignment (different address spaces)
net/ipv4/fou.c:272:18:    expected struct net_offload const **offloads
net/ipv4/fou.c:272:18:    got struct net_offload const [noderef] __rcu **
net/ipv4/fou.c:273:15: error: incompatible types in comparison expression (different address spaces):
net/ipv4/fou.c:273:15:    struct net_offload const [noderef] __rcu *
net/ipv4/fou.c:273:15:    struct net_offload const *
net/ipv4/fou.c:442:18: warning: incorrect type in assignment (different address spaces)
net/ipv4/fou.c:442:18:    expected struct net_offload const **offloads
net/ipv4/fou.c:442:18:    got struct net_offload const [noderef] __rcu **
net/ipv4/fou.c:443:15: error: incompatible types in comparison expression (different address spaces):
net/ipv4/fou.c:443:15:    struct net_offload const [noderef] __rcu *
net/ipv4/fou.c:443:15:    struct net_offload const *
net/ipv4/fou.c:489:18: warning: incorrect type in assignment (different address spaces)
net/ipv4/fou.c:489:18:    expected struct net_offload const **offloads
net/ipv4/fou.c:489:18:    got struct net_offload const [noderef] __rcu **
net/ipv4/fou.c:490:15: error: incompatible types in comparison expression (different address spaces):
net/ipv4/fou.c:490:15:    struct net_offload const [noderef] __rcu *
net/ipv4/fou.c:490:15:    struct net_offload const *
net/ipv4/udp_offload.c:170:26: warning: incorrect type in assignment (different address spaces)
net/ipv4/udp_offload.c:170:26:    expected struct net_offload const **offloads
net/ipv4/udp_offload.c:170:26:    got struct net_offload const [noderef] __rcu **
net/ipv4/udp_offload.c:171:23: error: incompatible types in comparison expression (different address spaces):
net/ipv4/udp_offload.c:171:23:    struct net_offload const [noderef] __rcu *
net/ipv4/udp_offload.c:171:23:    struct net_offload const *

Fixes: efc98d08e1ec ("fou: eliminate IPv4,v6 specific GRO functions")
Fixes: 8bce6d7d0d1e ("udp: Generalize skb_udp_segment")
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv4/fou.c         | 10 +++++-----
 net/ipv4/udp_offload.c |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Aug. 31, 2021, 11:10 a.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Mon, 30 Aug 2021 20:26:08 -0700 you wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> We need to add __rcu qualifier to avoid these errors:
> 
> net/ipv4/fou.c:250:18: warning: incorrect type in assignment (different address spaces)
> net/ipv4/fou.c:250:18:    expected struct net_offload const **offloads
> net/ipv4/fou.c:250:18:    got struct net_offload const [noderef] __rcu **
> net/ipv4/fou.c:251:15: error: incompatible types in comparison expression (different address spaces):
> net/ipv4/fou.c:251:15:    struct net_offload const [noderef] __rcu *
> net/ipv4/fou.c:251:15:    struct net_offload const *
> net/ipv4/fou.c:272:18: warning: incorrect type in assignment (different address spaces)
> net/ipv4/fou.c:272:18:    expected struct net_offload const **offloads
> net/ipv4/fou.c:272:18:    got struct net_offload const [noderef] __rcu **
> net/ipv4/fou.c:273:15: error: incompatible types in comparison expression (different address spaces):
> net/ipv4/fou.c:273:15:    struct net_offload const [noderef] __rcu *
> net/ipv4/fou.c:273:15:    struct net_offload const *
> net/ipv4/fou.c:442:18: warning: incorrect type in assignment (different address spaces)
> net/ipv4/fou.c:442:18:    expected struct net_offload const **offloads
> net/ipv4/fou.c:442:18:    got struct net_offload const [noderef] __rcu **
> net/ipv4/fou.c:443:15: error: incompatible types in comparison expression (different address spaces):
> net/ipv4/fou.c:443:15:    struct net_offload const [noderef] __rcu *
> net/ipv4/fou.c:443:15:    struct net_offload const *
> net/ipv4/fou.c:489:18: warning: incorrect type in assignment (different address spaces)
> net/ipv4/fou.c:489:18:    expected struct net_offload const **offloads
> net/ipv4/fou.c:489:18:    got struct net_offload const [noderef] __rcu **
> net/ipv4/fou.c:490:15: error: incompatible types in comparison expression (different address spaces):
> net/ipv4/fou.c:490:15:    struct net_offload const [noderef] __rcu *
> net/ipv4/fou.c:490:15:    struct net_offload const *
> net/ipv4/udp_offload.c:170:26: warning: incorrect type in assignment (different address spaces)
> net/ipv4/udp_offload.c:170:26:    expected struct net_offload const **offloads
> net/ipv4/udp_offload.c:170:26:    got struct net_offload const [noderef] __rcu **
> net/ipv4/udp_offload.c:171:23: error: incompatible types in comparison expression (different address spaces):
> net/ipv4/udp_offload.c:171:23:    struct net_offload const [noderef] __rcu *
> net/ipv4/udp_offload.c:171:23:    struct net_offload const *
> 
> [...]

Here is the summary with links:
  - [net-next] fou: remove sparse errors
    https://git.kernel.org/netdev/net-next/c/8d65cd8d25fa

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c
index e5f69b0bf3df551e28344ddd1c5068069c823cd1..8fcbc6258ec527f3069f7a525d33929c0ffa1bdf 100644
--- a/net/ipv4/fou.c
+++ b/net/ipv4/fou.c
@@ -230,8 +230,8 @@  static struct sk_buff *fou_gro_receive(struct sock *sk,
 				       struct list_head *head,
 				       struct sk_buff *skb)
 {
+	const struct net_offload __rcu **offloads;
 	u8 proto = fou_from_sock(sk)->protocol;
-	const struct net_offload **offloads;
 	const struct net_offload *ops;
 	struct sk_buff *pp = NULL;
 
@@ -263,10 +263,10 @@  static struct sk_buff *fou_gro_receive(struct sock *sk,
 static int fou_gro_complete(struct sock *sk, struct sk_buff *skb,
 			    int nhoff)
 {
-	const struct net_offload *ops;
+	const struct net_offload __rcu **offloads;
 	u8 proto = fou_from_sock(sk)->protocol;
+	const struct net_offload *ops;
 	int err = -ENOSYS;
-	const struct net_offload **offloads;
 
 	rcu_read_lock();
 	offloads = NAPI_GRO_CB(skb)->is_ipv6 ? inet6_offloads : inet_offloads;
@@ -311,7 +311,7 @@  static struct sk_buff *gue_gro_receive(struct sock *sk,
 				       struct list_head *head,
 				       struct sk_buff *skb)
 {
-	const struct net_offload **offloads;
+	const struct net_offload __rcu **offloads;
 	const struct net_offload *ops;
 	struct sk_buff *pp = NULL;
 	struct sk_buff *p;
@@ -457,8 +457,8 @@  static struct sk_buff *gue_gro_receive(struct sock *sk,
 
 static int gue_gro_complete(struct sock *sk, struct sk_buff *skb, int nhoff)
 {
-	const struct net_offload **offloads;
 	struct guehdr *guehdr = (struct guehdr *)(skb->data + nhoff);
+	const struct net_offload __rcu **offloads;
 	const struct net_offload *ops;
 	unsigned int guehlen = 0;
 	u8 proto;
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index 1380a6b6f4ff429960ecb3ffcf1197f80e81b8f3..86d32a1e62ac969fae1879c8cb5f992c1b026987 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -152,8 +152,8 @@  struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,
 				       netdev_features_t features,
 				       bool is_ipv6)
 {
+	const struct net_offload __rcu **offloads;
 	__be16 protocol = skb->protocol;
-	const struct net_offload **offloads;
 	const struct net_offload *ops;
 	struct sk_buff *segs = ERR_PTR(-EINVAL);
 	struct sk_buff *(*gso_inner_segment)(struct sk_buff *skb,