Commit 4eadb882 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

ipmr: do not acquire mrt_lock while calling ip_mr_forward()

ip_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 9094db4b
...@@ -1817,7 +1817,7 @@ static bool ipmr_forward_offloaded(struct sk_buff *skb, struct mr_table *mrt, ...@@ -1817,7 +1817,7 @@ static bool ipmr_forward_offloaded(struct sk_buff *skb, struct mr_table *mrt,
} }
#endif #endif
/* Processing handlers for ipmr_forward */ /* Processing handlers for ipmr_forward, under rcu_read_lock() */
static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt, static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt,
int in_vifi, struct sk_buff *skb, int vifi) int in_vifi, struct sk_buff *skb, int vifi)
...@@ -1839,9 +1839,7 @@ static void ipmr_queue_xmit(struct net *net, struct mr_table *mrt, ...@@ -1839,9 +1839,7 @@ static void ipmr_queue_xmit(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();
ipmr_cache_report(mrt, skb, vifi, IGMPMSG_WHOLEPKT); ipmr_cache_report(mrt, skb, vifi, IGMPMSG_WHOLEPKT);
rcu_read_unlock();
goto out_free; goto out_free;
} }
...@@ -1936,6 +1934,7 @@ static int ipmr_find_vif(const struct mr_table *mrt, struct net_device *dev) ...@@ -1936,6 +1934,7 @@ static int ipmr_find_vif(const struct mr_table *mrt, struct net_device *dev)
} }
/* "local" means that we should preserve one skb (for local delivery) */ /* "local" means that we should preserve one skb (for local delivery) */
/* Called uner rcu_read_lock() */
static void ip_mr_forward(struct net *net, struct mr_table *mrt, static void ip_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 mfc_cache *c, int local) struct mfc_cache *c, int local)
...@@ -1992,12 +1991,10 @@ static void ip_mr_forward(struct net *net, struct mr_table *mrt, ...@@ -1992,12 +1991,10 @@ static void ip_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();
ipmr_cache_report(mrt, skb, true_vifi, IGMPMSG_WRONGVIF); ipmr_cache_report(mrt, skb, true_vifi, IGMPMSG_WRONGVIF);
if (mrt->mroute_do_wrvifwhole) if (mrt->mroute_do_wrvifwhole)
ipmr_cache_report(mrt, skb, true_vifi, ipmr_cache_report(mrt, skb, true_vifi,
IGMPMSG_WRVIFWHOLE); IGMPMSG_WRVIFWHOLE);
rcu_read_unlock();
} }
goto dont_forward; goto dont_forward;
} }
...@@ -2169,9 +2166,7 @@ int ip_mr_input(struct sk_buff *skb) ...@@ -2169,9 +2166,7 @@ int ip_mr_input(struct sk_buff *skb)
return -ENODEV; return -ENODEV;
} }
read_lock(&mrt_lock);
ip_mr_forward(net, mrt, dev, skb, cache, local); ip_mr_forward(net, mrt, dev, skb, cache, local);
read_unlock(&mrt_lock);
if (local) if (local)
return ip_local_deliver(skb); return ip_local_deliver(skb);
......
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