Commit a8bfca02 authored by Eli Cohen's avatar Eli Cohen Committed by Roland Dreier

IPoIB: Add some likely/unlikely annotations in hot path

Signed-off-by: default avatarEli Cohen <eli@dev.mellanox.co.il>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 507c3350
...@@ -332,7 +332,7 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb, ...@@ -332,7 +332,7 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb,
struct ipoib_tx_buf *tx_req; struct ipoib_tx_buf *tx_req;
dma_addr_t addr; dma_addr_t addr;
if (skb->len > dev->mtu + INFINIBAND_ALEN) { if (unlikely(skb->len > dev->mtu + INFINIBAND_ALEN)) {
ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n", ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n",
skb->len, dev->mtu + INFINIBAND_ALEN); skb->len, dev->mtu + INFINIBAND_ALEN);
++priv->stats.tx_dropped; ++priv->stats.tx_dropped;
......
...@@ -620,7 +620,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -620,7 +620,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct ipoib_neigh *neigh; struct ipoib_neigh *neigh;
unsigned long flags; unsigned long flags;
if (!spin_trylock_irqsave(&priv->tx_lock, flags)) if (unlikely(!spin_trylock_irqsave(&priv->tx_lock, flags)))
return NETDEV_TX_LOCKED; return NETDEV_TX_LOCKED;
/* /*
...@@ -633,7 +633,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -633,7 +633,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_BUSY; return NETDEV_TX_BUSY;
} }
if (skb->dst && skb->dst->neighbour) { if (likely(skb->dst && skb->dst->neighbour)) {
if (unlikely(!*to_ipoib_neigh(skb->dst->neighbour))) { if (unlikely(!*to_ipoib_neigh(skb->dst->neighbour))) {
ipoib_path_lookup(skb, dev); ipoib_path_lookup(skb, dev);
goto out; goto out;
......
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