diff options
author | Eli Cohen <eli@dev.mellanox.co.il> | 2006-09-22 18:22:58 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-09-22 18:22:58 -0400 |
commit | a8bfca024326560d86c6323b0504288ca55a75fc (patch) | |
tree | cc3bae75628c57b8f70a0ed66beee62201557bad /drivers/infiniband/ulp | |
parent | 507c33504686e733a14ef0b2dc9db0c20fae4653 (diff) |
IPoIB: Add some likely/unlikely annotations in hot path
Signed-off-by: Eli Cohen <eli@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_ib.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 240befdf90dc..f426a69d9a43 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
@@ -332,7 +332,7 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb, | |||
332 | struct ipoib_tx_buf *tx_req; | 332 | struct ipoib_tx_buf *tx_req; |
333 | dma_addr_t addr; | 333 | dma_addr_t addr; |
334 | 334 | ||
335 | if (skb->len > dev->mtu + INFINIBAND_ALEN) { | 335 | if (unlikely(skb->len > dev->mtu + INFINIBAND_ALEN)) { |
336 | ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n", | 336 | ipoib_warn(priv, "packet len %d (> %d) too long to send, dropping\n", |
337 | skb->len, dev->mtu + INFINIBAND_ALEN); | 337 | skb->len, dev->mtu + INFINIBAND_ALEN); |
338 | ++priv->stats.tx_dropped; | 338 | ++priv->stats.tx_dropped; |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 867d62742054..1eaf00e9862c 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -620,7 +620,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
620 | struct ipoib_neigh *neigh; | 620 | struct ipoib_neigh *neigh; |
621 | unsigned long flags; | 621 | unsigned long flags; |
622 | 622 | ||
623 | if (!spin_trylock_irqsave(&priv->tx_lock, flags)) | 623 | if (unlikely(!spin_trylock_irqsave(&priv->tx_lock, flags))) |
624 | return NETDEV_TX_LOCKED; | 624 | return NETDEV_TX_LOCKED; |
625 | 625 | ||
626 | /* | 626 | /* |
@@ -633,7 +633,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
633 | return NETDEV_TX_BUSY; | 633 | return NETDEV_TX_BUSY; |
634 | } | 634 | } |
635 | 635 | ||
636 | if (skb->dst && skb->dst->neighbour) { | 636 | if (likely(skb->dst && skb->dst->neighbour)) { |
637 | if (unlikely(!*to_ipoib_neigh(skb->dst->neighbour))) { | 637 | if (unlikely(!*to_ipoib_neigh(skb->dst->neighbour))) { |
638 | ipoib_path_lookup(skb, dev); | 638 | ipoib_path_lookup(skb, dev); |
639 | goto out; | 639 | goto out; |