[openib-general] [PATCH 2 of 3] ipoib: static rate encoding change support

Jack Morgenstein jackm at mellanox.co.il
Thu Mar 9 07:01:14 PST 2006


Changes to support new verbs layer static rate encoding in ipoib.

Signed-off-by: Jack Morgenstein <jackm at mellanox.co.il>

Index: src/drivers/infiniband/ulp/ipoib/ipoib_main.c
===================================================================
--- src.orig/drivers/infiniband/ulp/ipoib/ipoib_main.c	2006-03-05 
12:39:33.639464000 +0200
+++ src/drivers/infiniband/ulp/ipoib/ipoib_main.c	2006-03-05 
12:48:51.232870000 +0200
@@ -368,16 +368,9 @@ static void path_rec_completion(int stat
 		struct ib_ah_attr av = {
 			.dlid 	       = be16_to_cpu(pathrec->dlid),
 			.sl 	       = pathrec->sl,
-			.port_num      = priv->port
+			.port_num      = priv->port,
+			.static_rate   = pathrec->rate
 		};
-		int path_rate = ib_sa_rate_enum_to_int(pathrec->rate);
-
-		if (path_rate > 0 && priv->local_rate > path_rate)
-			av.static_rate = (priv->local_rate - 1) / path_rate;
-
-		ipoib_dbg(priv, "static_rate %d for local port %dX, path %dX\n",
-			  av.static_rate, priv->local_rate,
-			  ib_sa_rate_enum_to_int(pathrec->rate));
 
 		ah = ipoib_create_ah(dev, priv->pd, &av);
 	}
Index: src/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
===================================================================
--- src.orig/drivers/infiniband/ulp/ipoib/ipoib_multicast.c	2006-03-05 
12:40:47.777393000 +0200
+++ src/drivers/infiniband/ulp/ipoib/ipoib_multicast.c	2006-03-05 
12:48:51.244868000 +0200
@@ -252,6 +252,7 @@ static int ipoib_mcast_join_finish(struc
 			.port_num      = priv->port,
 			.sl	       = mcast->mcmember.sl,
 			.ah_flags      = IB_AH_GRH,
+			.static_rate   = mcast->mcmember.rate,
 			.grh	       = {
 				.flow_label    = be32_to_cpu(mcast->mcmember.flow_label),
 				.hop_limit     = mcast->mcmember.hop_limit,
@@ -259,17 +260,8 @@ static int ipoib_mcast_join_finish(struc
 				.traffic_class = mcast->mcmember.traffic_class
 			}
 		};
-		int path_rate = ib_sa_rate_enum_to_int(mcast->mcmember.rate);
-
 		av.grh.dgid = mcast->mcmember.mgid;
 
-		if (path_rate > 0 && priv->local_rate > path_rate)
-			av.static_rate = (priv->local_rate - 1) / path_rate;
-
-		ipoib_dbg_mcast(priv, "static_rate %d for local port %dX, mcmember %dX\n",
-				av.static_rate, priv->local_rate,
-				ib_sa_rate_enum_to_int(mcast->mcmember.rate));
-
 		ah = ipoib_create_ah(dev, priv->pd, &av);
 		if (!ah) {
 			ipoib_warn(priv, "ib_address_create failed\n");
Index: src/drivers/infiniband/ulp/ipoib/ipoib_fs.c
===================================================================
--- src.orig/drivers/infiniband/ulp/ipoib/ipoib_fs.c	2006-03-05 
12:39:33.902465000 +0200
+++ src/drivers/infiniband/ulp/ipoib/ipoib_fs.c	2006-03-05 12:48:51.273872000 
+0200
@@ -213,7 +213,7 @@ static int ipoib_path_seq_show(struct se
 		   gid_buf, path.pathrec.dlid ? "yes" : "no");
 
 	if (path.pathrec.dlid) {
-		rate = ib_sa_rate_enum_to_int(path.pathrec.rate) * 25;
+		rate = ib_rate_to_mult(path.pathrec.rate) * 25;
 
 		seq_printf(file,
 			   "  DLID:     0x%04x\n"



More information about the general mailing list