diff options
author | Eric Dumazet <edumazet@google.com> | 2021-11-23 23:56:08 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-11-25 02:21:42 +0100 |
commit | 627b94f75b82d13d1530b59155a545fd99d807db (patch) | |
tree | 6b0cc9cd576b1c9355b9f1fdf0ab7f3d4ab44e7c /net/ipv4/fou.c | |
parent | gro: remove rcu_read_lock/rcu_read_unlock from gro_receive handlers (diff) | |
download | linux-627b94f75b82d13d1530b59155a545fd99d807db.tar.xz linux-627b94f75b82d13d1530b59155a545fd99d807db.zip |
gro: remove rcu_read_lock/rcu_read_unlock from gro_complete handlers
All gro_complete() handlers are called from napi_gro_complete()
while rcu_read_lock() has been called.
There is no point stacking more rcu_read_lock()
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv4/fou.c')
-rw-r--r-- | net/ipv4/fou.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c index 6ebc345e6001..0d085cc8d96c 100644 --- a/net/ipv4/fou.c +++ b/net/ipv4/fou.c @@ -266,19 +266,16 @@ static int fou_gro_complete(struct sock *sk, struct sk_buff *skb, const struct net_offload *ops; int err = -ENOSYS; - rcu_read_lock(); offloads = NAPI_GRO_CB(skb)->is_ipv6 ? inet6_offloads : inet_offloads; ops = rcu_dereference(offloads[proto]); if (WARN_ON(!ops || !ops->callbacks.gro_complete)) - goto out_unlock; + goto out; err = ops->callbacks.gro_complete(skb, nhoff); skb_set_inner_mac_header(skb, nhoff); -out_unlock: - rcu_read_unlock(); - +out: return err; } @@ -480,18 +477,16 @@ static int gue_gro_complete(struct sock *sk, struct sk_buff *skb, int nhoff) return err; } - rcu_read_lock(); offloads = NAPI_GRO_CB(skb)->is_ipv6 ? inet6_offloads : inet_offloads; ops = rcu_dereference(offloads[proto]); if (WARN_ON(!ops || !ops->callbacks.gro_complete)) - goto out_unlock; + goto out; err = ops->callbacks.gro_complete(skb, nhoff + guehlen); skb_set_inner_mac_header(skb, nhoff + guehlen); -out_unlock: - rcu_read_unlock(); +out: return err; } |