Commit 9b1c21d8 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

ip6mr: do not acquire mrt_lock while calling ip6_mr_forward()

ip6_mr_forward() uses standard RCU protection already.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent db9eb7c8
...@@ -2042,9 +2042,7 @@ static int ip6mr_forward2(struct net *net, struct mr_table *mrt, ...@@ -2042,9 +2042,7 @@ static int ip6mr_forward2(struct net *net, struct mr_table *mrt,
WRITE_ONCE(vif->bytes_out, vif->bytes_out + skb->len); WRITE_ONCE(vif->bytes_out, vif->bytes_out + skb->len);
vif_dev->stats.tx_bytes += skb->len; vif_dev->stats.tx_bytes += skb->len;
vif_dev->stats.tx_packets++; vif_dev->stats.tx_packets++;
rcu_read_lock();
ip6mr_cache_report(mrt, skb, vifi, MRT6MSG_WHOLEPKT); ip6mr_cache_report(mrt, skb, vifi, MRT6MSG_WHOLEPKT);
rcu_read_unlock();
goto out_free; goto out_free;
} }
#endif #endif
...@@ -2112,6 +2110,7 @@ static int ip6mr_find_vif(struct mr_table *mrt, struct net_device *dev) ...@@ -2112,6 +2110,7 @@ static int ip6mr_find_vif(struct mr_table *mrt, struct net_device *dev)
return ct; return ct;
} }
/* Called under rcu_read_lock() */
static void ip6_mr_forward(struct net *net, struct mr_table *mrt, static void ip6_mr_forward(struct net *net, struct mr_table *mrt,
struct net_device *dev, struct sk_buff *skb, struct net_device *dev, struct sk_buff *skb,
struct mfc6_cache *c) struct mfc6_cache *c)
...@@ -2131,14 +2130,12 @@ static void ip6_mr_forward(struct net *net, struct mr_table *mrt, ...@@ -2131,14 +2130,12 @@ static void ip6_mr_forward(struct net *net, struct mr_table *mrt,
/* For an (*,G) entry, we only check that the incoming /* For an (*,G) entry, we only check that the incoming
* interface is part of the static tree. * interface is part of the static tree.
*/ */
rcu_read_lock();
cache_proxy = mr_mfc_find_any_parent(mrt, vif); cache_proxy = mr_mfc_find_any_parent(mrt, vif);
if (cache_proxy && if (cache_proxy &&
cache_proxy->_c.mfc_un.res.ttls[true_vifi] < 255) { cache_proxy->_c.mfc_un.res.ttls[true_vifi] < 255) {
rcu_read_unlock(); rcu_read_unlock();
goto forward; goto forward;
} }
rcu_read_unlock();
} }
/* /*
...@@ -2159,12 +2156,10 @@ static void ip6_mr_forward(struct net *net, struct mr_table *mrt, ...@@ -2159,12 +2156,10 @@ static void ip6_mr_forward(struct net *net, struct mr_table *mrt,
c->_c.mfc_un.res.last_assert + c->_c.mfc_un.res.last_assert +
MFC_ASSERT_THRESH)) { MFC_ASSERT_THRESH)) {
c->_c.mfc_un.res.last_assert = jiffies; c->_c.mfc_un.res.last_assert = jiffies;
rcu_read_lock();
ip6mr_cache_report(mrt, skb, true_vifi, MRT6MSG_WRONGMIF); ip6mr_cache_report(mrt, skb, true_vifi, MRT6MSG_WRONGMIF);
if (mrt->mroute_do_wrvifwhole) if (mrt->mroute_do_wrvifwhole)
ip6mr_cache_report(mrt, skb, true_vifi, ip6mr_cache_report(mrt, skb, true_vifi,
MRT6MSG_WRMIFWHOLE); MRT6MSG_WRMIFWHOLE);
rcu_read_unlock();
} }
goto dont_forward; goto dont_forward;
} }
...@@ -2278,11 +2273,8 @@ int ip6_mr_input(struct sk_buff *skb) ...@@ -2278,11 +2273,8 @@ int ip6_mr_input(struct sk_buff *skb)
return -ENODEV; return -ENODEV;
} }
read_lock(&mrt_lock);
ip6_mr_forward(net, mrt, dev, skb, cache); ip6_mr_forward(net, mrt, dev, skb, cache);
read_unlock(&mrt_lock);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment