[openib-general] [PATCH] mthca: fix sgid for port 2 mad

Hal Rosenstock halr at voltaire.com
Wed Jan 18 02:23:19 PST 2006


One comment/question on this is that while I know ib_get_cached_gid _should_ not fail here, it did because of this. Should the return be checked and handled just in case ? Actually, this (prior to this patch) had an interesting effect to send a GRH with an SGID of 0 on port 2.
 
-- Hal

________________________________

From: openib-general-bounces at openib.org on behalf of Michael S. Tsirkin
Sent: Wed 1/18/2006 4:13 AM
To: openib-general at openib.org; Roland Dreier
Subject: [openib-general] [PATCH] mthca: fix sgid for port 2 mad



mthca_create_ah includes the port number in the gid index. The
reverse needs to be done in mthca_read_ah.

Noted by Hal Rosenstock.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: openib/drivers/infiniband/hw/mthca/mthca_av.c
===================================================================
--- openib.orig/drivers/infiniband/hw/mthca/mthca_av.c  2006-01-14 18:40:12.000000000 +0200
+++ openib/drivers/infiniband/hw/mthca/mthca_av.c       2006-01-18 02:35:18.000000000 +0200
@@ -182,7 +182,7 @@ int mthca_read_ah(struct mthca_dev *dev,
                        ah->av->sl_tclass_flowlabel & cpu_to_be32(0xfffff);
                ib_get_cached_gid(&dev->ib_dev,
                                  be32_to_cpu(ah->av->port_pd) >> 24,
-                                 ah->av->gid_index,
+                                 ah->av->gid_index % dev->limits.gid_table_len,
                                  &header->grh.source_gid);
                memcpy(header->grh.destination_gid.raw,
                       ah->av->dgid, 16);

--
MST
_______________________________________________
openib-general mailing list
openib-general at openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general





More information about the general mailing list