diff options
author | Eric Dumazet <edumazet@google.com> | 2021-11-23 14:56:07 -0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-11-24 17:21:42 -0800 |
commit | fc1ca3348a74a1afaa7ffebc2b2f2cc149e11278 (patch) | |
tree | f3a16dc7567519f4257f4caf884d4ab770f0bf92 /net/ipv4/gre_offload.c | |
parent | 1aad9634b94ef65d72110a6fc6625c890db9667c (diff) | |
download | linux-fc1ca3348a74a1afaa7ffebc2b2f2cc149e11278.tar.gz |
gro: remove rcu_read_lock/rcu_read_unlock from gro_receive handlers
All gro_receive() handlers are called from dev_gro_receive()
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/gre_offload.c')
-rw-r--r-- | net/ipv4/gre_offload.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c index 740298dac7d3..c6b5d327e3e1 100644 --- a/net/ipv4/gre_offload.c +++ b/net/ipv4/gre_offload.c @@ -163,10 +163,9 @@ static struct sk_buff *gre_gro_receive(struct list_head *head, type = greh->protocol; - rcu_read_lock(); ptype = gro_find_receive_by_type(type); if (!ptype) - goto out_unlock; + goto out; grehlen = GRE_HEADER_SECTION; @@ -180,13 +179,13 @@ static struct sk_buff *gre_gro_receive(struct list_head *head, if (skb_gro_header_hard(skb, hlen)) { greh = skb_gro_header_slow(skb, hlen, off); if (unlikely(!greh)) - goto out_unlock; + goto out; } /* Don't bother verifying checksum if we're going to flush anyway. */ if ((greh->flags & GRE_CSUM) && !NAPI_GRO_CB(skb)->flush) { if (skb_gro_checksum_simple_validate(skb)) - goto out_unlock; + goto out; skb_gro_checksum_try_convert(skb, IPPROTO_GRE, null_compute_pseudo); @@ -230,8 +229,6 @@ static struct sk_buff *gre_gro_receive(struct list_head *head, pp = call_gro_receive(ptype->callbacks.gro_receive, head, skb); flush = 0; -out_unlock: - rcu_read_unlock(); out: skb_gro_flush_final(skb, pp, flush); |