[openib-general] [PATCH] IB/ipoib: likely/unlikely annotations

Eli cohen eli at dev.mellanox.co.il
Thu Sep 21 06:10:25 PDT 2006


Use likely/unlikely in data tx flow

Signed-off-by: Eli Cohen <eli at dev.mellanox.co.il>
Acked-by: Michael S. Tsirkin <mst at mellanox.co.il>
---

Index: openib-1.1-rc6/drivers/infiniband/ulp/ipoib/ipoib_main.c
===================================================================
--- openib-1.1-rc6.orig/drivers/infiniband/ulp/ipoib/ipoib_main.c	2006-09-21 15:43:49.000000000 +0300
+++ openib-1.1-rc6/drivers/infiniband/ulp/ipoib/ipoib_main.c	2006-09-21 15:46:26.000000000 +0300
@@ -643,7 +643,7 @@
 	struct ipoib_neigh *neigh;
 	unsigned long flags;
 
-	if (!spin_trylock_irqsave(&priv->tx_lock, flags))
+	if (unlikely(!spin_trylock_irqsave(&priv->tx_lock, flags)))
 		return NETDEV_TX_LOCKED;
 
 	/*
@@ -656,7 +656,7 @@
 		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))) {
 			ipoib_path_lookup(skb, dev);
 			goto out;






More information about the general mailing list