[openib-general] [PATCH] replace grh_flag with ah_flags in ib_ah

Sean Hefty mshefty at ichips.intel.com
Wed Sep 8 13:07:17 PDT 2004


This patch replaces the u8 grh_flag with a more generic ah_flags for consistency with the rest of the API.

- Sean

--
Index: ulp/ipoib/ipoib_arp.c
===================================================================
--- ulp/ipoib/ipoib_arp.c	(revision 756)
+++ ulp/ipoib/ipoib_arp.c	(working copy)
@@ -411,7 +411,7 @@
 			.sl 	       = path->sl,
 			.src_path_bits = 0,
 			.static_rate   = 0,
-			.grh_flag      = 0,
+			.ah_flags      = 0,
 			.port_num      = priv->port
 		};
 
Index: ulp/ipoib/ipoib_multicast.c
===================================================================
--- ulp/ipoib/ipoib_multicast.c	(revision 756)
+++ ulp/ipoib/ipoib_multicast.c	(working copy)
@@ -247,7 +247,7 @@
 			.sl	       = mcast->mcast_member.sl,
 			.src_path_bits = 0,
 			.static_rate   = 0,
-			.grh_flag      = 1,
+			.ah_flags      = IB_AH_GRH,
 			.grh	       = {
 				.flow_label    = mcast->mcast_member.flowlabel,
 				.hop_limit     = mcast->mcast_member.hoplmt,
Index: include/ib_verbs.h
===================================================================
--- include/ib_verbs.h	(revision 756)
+++ include/ib_verbs.h	(working copy)
@@ -214,13 +214,17 @@
 	u8		traffic_class;
 };
 
+enum ib_ah_flags {
+	IB_AH_GRH	= 1
+};
+
 struct ib_ah_attr {
 	struct ib_global_route	grh;
 	u16			dlid;
 	u8			sl;
 	u8			src_path_bits;
 	u8			static_rate;
-	u8			grh_flag;
+	u8			ah_flags;
 	u8			port_num;
 };
 
Index: core/cm_path_migration.c
===================================================================
--- core/cm_path_migration.c	(revision 756)
+++ core/cm_path_migration.c	(working copy)
@@ -57,7 +57,7 @@
 	qp_attr->ah_attr.dlid          = connection->alternate_path.dlid;
 	qp_attr->ah_attr.src_path_bits = connection->alternate_path.slid & 0x7f;
 	qp_attr->ah_attr.static_rate   = 0;
-	qp_attr->ah_attr.grh_flag      = 0;
+	qp_attr->ah_attr.ah_flags      = 0;
 	qp_attr->path_mig_state        = IB_MIG_REARM;
 
 	if (ib_cached_gid_find(connection->alternate_path.sgid, NULL,
Index: core/mad_ib.c
===================================================================
--- core/mad_ib.c	(revision 756)
+++ core/mad_ib.c	(working copy)
@@ -73,11 +73,11 @@
 	av.dlid          = mad->dlid;
 	av.port_num      = mad->port;
 	av.src_path_bits = 0;
-	av.grh_flag      = mad->has_grh;
+	av.ah_flags      = (mad->has_grh ? IB_AH_GRH : 0);
 	av.sl            = mad->sl;
 	av.static_rate   = 0;
 
-	if (av.grh_flag) {
+	if (mad.has_grh) {
 		av.grh.sgid_index       = mad->gid_index;
 		av.grh.flow_label       = mad->flow_label;
 		av.grh.hop_limit        = mad->hop_limit;
Index: core/cm_passive.c
===================================================================
--- core/cm_passive.c	(revision 756)
+++ core/cm_passive.c	(working copy)
@@ -167,7 +167,7 @@
 	qp_attr->ah_attr.dlid             = connection->primary_path.dlid;
 	qp_attr->ah_attr.src_path_bits    = connection->primary_path.slid & 0x7f;
 	qp_attr->ah_attr.static_rate      = 0;
-	qp_attr->ah_attr.grh_flag         = 0;
+	qp_attr->ah_attr.ah_flags         = 0;
 
 	attr_mask =
 		IB_QP_STATE               |
@@ -283,7 +283,7 @@
 		qp_attr->alt_ah_attr.dlid             = connection->alternate_path.dlid;
 		qp_attr->alt_ah_attr.src_path_bits    = connection->alternate_path.slid & 0x7f;
 		qp_attr->alt_ah_attr.static_rate      = 0;
-		qp_attr->alt_ah_attr.grh_flag         = 0;
+		qp_attr->alt_ah_attr.ah_flags         = 0;
 		qp_attr->path_mig_state               = IB_MIG_REARM;
 
 		ib_cached_gid_find(connection->alternate_path.sgid, NULL, &qp_attr->alt_port_num, NULL);
Index: core/cm_active.c
===================================================================
--- core/cm_active.c	(revision 756)
+++ core/cm_active.c	(working copy)
@@ -288,7 +288,7 @@
 		qp_attr->alt_ah_attr.dlid          = connection->alternate_path.dlid;
 		qp_attr->alt_ah_attr.src_path_bits = connection->alternate_path.slid & 0x7f;
 		qp_attr->alt_ah_attr.static_rate   = 0;
-		qp_attr->alt_ah_attr.grh_flag      = 0;
+		qp_attr->alt_ah_attr.ah_flags      = 0;
 		qp_attr->path_mig_state            = IB_MIG_REARM;
 
 		ib_cached_gid_find(connection->alternate_path.sgid, NULL,
@@ -418,7 +418,7 @@
 	qp_attr->ah_attr.dlid             = connection->primary_path.dlid;
 	qp_attr->ah_attr.src_path_bits    = connection->primary_path.slid & 0x7f;
 	qp_attr->ah_attr.static_rate      = 0;
-	qp_attr->ah_attr.grh_flag         = 0;
+	qp_attr->ah_attr.ah_flags         = 0;
 
 	attr_mask =
 		IB_QP_STATE               |
Index: hw/mthca/mthca_av.c
===================================================================
--- hw/mthca/mthca_av.c	(revision 756)
+++ hw/mthca/mthca_av.c	(working copy)
@@ -82,12 +82,13 @@
 	memset(av, 0, MTHCA_AV_SIZE);
 
 	av->port_pd = cpu_to_be32(pd->pd_num | (ah_attr->port_num << 24));
-	av->g_slid  = (!!ah_attr->grh_flag << 7) | ah_attr->src_path_bits;
-	av->dlid       = cpu_to_be16(ah_attr->dlid);
-	av->msg_sr     = (3 << 4) | /* 2K message */
+	av->g_slid  = ah_attr->src_path_bits;
+	av->dlid    = cpu_to_be16(ah_attr->dlid);
+	av->msg_sr  = (3 << 4) | /* 2K message */
 		ah_attr->static_rate;
 	av->sl_tclass_flowlabel = cpu_to_be32(ah_attr->sl << 28);
-	if (ah_attr->grh_flag) {
+	if (ah_attr->ah_flags & IB_AH_GRH) {
+		av->g_slid |= 0x80;
 		av->gid_index = (ah_attr->port_num - 1) * dev->limits.gid_table_len +
 			ah_attr->grh.sgid_index;
 		av->hop_limit = ah_attr->grh.hop_limit;
Index: hw/mthca/mthca_qp.c
===================================================================
--- hw/mthca/mthca_qp.c	(revision 756)
+++ hw/mthca/mthca_qp.c	(working copy)
@@ -593,7 +593,7 @@
 		qp_context->pri_path.g_mylmc     = attr->ah_attr.src_path_bits & 0x7f;
 		qp_context->pri_path.rlid        = cpu_to_be16(attr->ah_attr.dlid);
 		qp_context->pri_path.static_rate = (!!attr->ah_attr.static_rate) << 3;
-		if (attr->ah_attr.grh_flag) {
+		if (attr->ah_attr.ah_flags & IB_AH_GRH) {
 			qp_context->pri_path.g_mylmc |= 1 << 7;
 			qp_context->pri_path.mgid_index = attr->ah_attr.grh.sgid_index;
 			qp_context->pri_path.hop_limit = attr->ah_attr.grh.hop_limit;




More information about the general mailing list