[ofa-general] [PATCH 3/3]: IB/ipoib: use lockless SRQ in IPOIB CM

Eli Cohen eli at mellanox.co.il
Wed Oct 10 08:55:47 PDT 2007


Modify IPOIB CM to use a lockless SRQ

IPOIB CM uses NAPI which allows the poll function to be lockless.
This patches modifies IPOIB to utilize this.

Signed-off-by: Eli Cohen <eli at mellanox.co.il>

---

Index: ofa_kernel-1.2.5/drivers/infiniband/ulp/ipoib/ipoib_cm.c
===================================================================
--- ofa_kernel-1.2.5.orig/drivers/infiniband/ulp/ipoib/ipoib_cm.c	2007-10-10 15:10:30.000000000 +0200
+++ ofa_kernel-1.2.5/drivers/infiniband/ulp/ipoib/ipoib_cm.c	2007-10-10 15:28:52.000000000 +0200
@@ -1292,6 +1292,9 @@ int ipoib_cm_dev_init(struct net_device 
 			.max_sge = IPOIB_CM_RX_SG
 		}
 	};
+	struct ib_srq_attr attr = {
+		.use_lock = 0,
+	};
 	int ret, i;
 
 	INIT_LIST_HEAD(&priv->cm.passive_ids);
@@ -1316,6 +1319,12 @@ int ipoib_cm_dev_init(struct net_device 
 		return ret;
 	}
 
+	ret = ib_modify_srq(priv->cm.srq, &attr, IB_SRQ_LOCKNESS);
+	if (ret) {
+		ipoib_cm_dev_cleanup(dev);
+                return ret;
+	}
+
 	priv->cm.srq_ring = kzalloc(ipoib_recvq_size * sizeof *priv->cm.srq_ring,
 				    GFP_KERNEL);
 	if (!priv->cm.srq_ring) {




More information about the general mailing list