[ofa-general] [PATCH] ib/ipoib: Reduce comparison size in data path
Eli Cohen
eli at mellanox.co.il
Mon Dec 31 02:44:44 PST 2007
In the majority of cases, if the neighbour will change, it will
be reflected in the guid part of the GID (bytes 8-15). If the GID
prefix will change as well (bytes 0-7) it will be because the master
SM has changed, in which case we will get an SM change event resulting
in all paths flushed.
Signed-off-by: Eli Cohen <eli at mellanox.co.il>
---
drivers/infiniband/ulp/ipoib/ipoib_main.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index c9f6077..e9a4f96 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -693,10 +693,9 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
goto out;
}
} else if (neigh->ah) {
- if (unlikely((memcmp(&neigh->dgid.raw,
- skb->dst->neighbour->ha + 4,
- sizeof(union ib_gid))) ||
- (neigh->dev != dev))) {
+ if (unlikely((memcmp(&neigh->dgid.raw[8],
+ skb->dst->neighbour->ha + 12, 8)) ||
+ (neigh->dev != dev))) {
spin_lock(&priv->lock);
/*
* It's safe to call ipoib_put_ah() inside
--
1.5.3.6
More information about the general
mailing list