diff options
author | Eric Dumazet <edumazet@google.com> | 2021-11-24 01:56:08 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-11-25 04:21:42 +0300 |
commit | 627b94f75b82d13d1530b59155a545fd99d807db (patch) | |
tree | 6b0cc9cd576b1c9355b9f1fdf0ab7f3d4ab44e7c /net/ipv4/af_inet.c | |
parent | fc1ca3348a74a1afaa7ffebc2b2f2cc149e11278 (diff) | |
download | linux-627b94f75b82d13d1530b59155a545fd99d807db.tar.xz |
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/af_inet.c')
-rw-r--r-- | net/ipv4/af_inet.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index de7d3a6748f5..04067b249bf3 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -1612,10 +1612,9 @@ int inet_gro_complete(struct sk_buff *skb, int nhoff) csum_replace2(&iph->check, iph->tot_len, newlen); iph->tot_len = newlen; - rcu_read_lock(); ops = rcu_dereference(inet_offloads[proto]); if (WARN_ON(!ops || !ops->callbacks.gro_complete)) - goto out_unlock; + goto out; /* Only need to add sizeof(*iph) to get to the next hdr below * because any hdr with option will have been flushed in @@ -1625,9 +1624,7 @@ int inet_gro_complete(struct sk_buff *skb, int nhoff) tcp4_gro_complete, udp4_gro_complete, skb, nhoff + sizeof(*iph)); -out_unlock: - rcu_read_unlock(); - +out: return err; } |