提交 b917eb15 编写于 作者: E Eric Dumazet 提交者: David S. Miller

ipv6: gso: remove redundant locking

ipv6_gso_send_check() and ipv6_gso_segment() are called by
skb_mac_gso_segment() under rcu lock, no need to use
rcu_read_lock() / rcu_read_unlock()
Signed-off-by: NEric Dumazet <edumazet@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ea58c180
...@@ -66,7 +66,6 @@ static int ipv6_gso_send_check(struct sk_buff *skb) ...@@ -66,7 +66,6 @@ static int ipv6_gso_send_check(struct sk_buff *skb)
__skb_pull(skb, sizeof(*ipv6h)); __skb_pull(skb, sizeof(*ipv6h));
err = -EPROTONOSUPPORT; err = -EPROTONOSUPPORT;
rcu_read_lock();
ops = rcu_dereference(inet6_offloads[ ops = rcu_dereference(inet6_offloads[
ipv6_gso_pull_exthdrs(skb, ipv6h->nexthdr)]); ipv6_gso_pull_exthdrs(skb, ipv6h->nexthdr)]);
...@@ -74,7 +73,6 @@ static int ipv6_gso_send_check(struct sk_buff *skb) ...@@ -74,7 +73,6 @@ static int ipv6_gso_send_check(struct sk_buff *skb)
skb_reset_transport_header(skb); skb_reset_transport_header(skb);
err = ops->callbacks.gso_send_check(skb); err = ops->callbacks.gso_send_check(skb);
} }
rcu_read_unlock();
out: out:
return err; return err;
...@@ -113,13 +111,12 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, ...@@ -113,13 +111,12 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb,
segs = ERR_PTR(-EPROTONOSUPPORT); segs = ERR_PTR(-EPROTONOSUPPORT);
proto = ipv6_gso_pull_exthdrs(skb, ipv6h->nexthdr); proto = ipv6_gso_pull_exthdrs(skb, ipv6h->nexthdr);
rcu_read_lock();
ops = rcu_dereference(inet6_offloads[proto]); ops = rcu_dereference(inet6_offloads[proto]);
if (likely(ops && ops->callbacks.gso_segment)) { if (likely(ops && ops->callbacks.gso_segment)) {
skb_reset_transport_header(skb); skb_reset_transport_header(skb);
segs = ops->callbacks.gso_segment(skb, features); segs = ops->callbacks.gso_segment(skb, features);
} }
rcu_read_unlock();
if (IS_ERR(segs)) if (IS_ERR(segs))
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册