Commit daa86e50 authored by Shannon Nelson's avatar Shannon Nelson Committed by David S. Miller

sunvnet: remove extra rcu_read_unlocks

The RCU read lock is grabbed first thing in sunvnet_start_xmit_common()
so it always needs to be released.  This removes the conditional release
in the dropped packet error path and removes a couple of superfluous
calls in the middle of the code.
Reported-by: default avatarBijan Mottahedeh <bijan.mottahedeh@oracle.com>
Signed-off-by: default avatarShannon Nelson <shannon.nelson@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bf091f3f
...@@ -1253,10 +1253,8 @@ int sunvnet_start_xmit_common(struct sk_buff *skb, struct net_device *dev, ...@@ -1253,10 +1253,8 @@ int sunvnet_start_xmit_common(struct sk_buff *skb, struct net_device *dev,
rcu_read_lock(); rcu_read_lock();
port = vnet_tx_port(skb, dev); port = vnet_tx_port(skb, dev);
if (unlikely(!port)) { if (unlikely(!port))
rcu_read_unlock();
goto out_dropped; goto out_dropped;
}
if (skb_is_gso(skb) && skb->len > port->tsolen) { if (skb_is_gso(skb) && skb->len > port->tsolen) {
err = vnet_handle_offloads(port, skb, vnet_tx_port); err = vnet_handle_offloads(port, skb, vnet_tx_port);
...@@ -1281,7 +1279,6 @@ int sunvnet_start_xmit_common(struct sk_buff *skb, struct net_device *dev, ...@@ -1281,7 +1279,6 @@ int sunvnet_start_xmit_common(struct sk_buff *skb, struct net_device *dev,
fl4.saddr = ip_hdr(skb)->saddr; fl4.saddr = ip_hdr(skb)->saddr;
rt = ip_route_output_key(dev_net(dev), &fl4); rt = ip_route_output_key(dev_net(dev), &fl4);
rcu_read_unlock();
if (!IS_ERR(rt)) { if (!IS_ERR(rt)) {
skb_dst_set(skb, &rt->dst); skb_dst_set(skb, &rt->dst);
icmp_send(skb, ICMP_DEST_UNREACH, icmp_send(skb, ICMP_DEST_UNREACH,
...@@ -1441,7 +1438,6 @@ int sunvnet_start_xmit_common(struct sk_buff *skb, struct net_device *dev, ...@@ -1441,7 +1438,6 @@ int sunvnet_start_xmit_common(struct sk_buff *skb, struct net_device *dev,
jiffies + VNET_CLEAN_TIMEOUT); jiffies + VNET_CLEAN_TIMEOUT);
else if (port) else if (port)
del_timer(&port->clean_timer); del_timer(&port->clean_timer);
if (port)
rcu_read_unlock(); rcu_read_unlock();
if (skb) if (skb)
dev_kfree_skb(skb); dev_kfree_skb(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