[openib-general] [PATCH] ib_mad: Reduce QP send max_sge

Hal Rosenstock halr at voltaire.com
Fri Sep 10 16:26:07 PDT 2004


Reduce QP send max_sge

Index: ib_mad.c
===================================================================
--- ib_mad.c	(revision 775)
+++ ib_mad.c	(working copy)
@@ -1119,7 +1119,6 @@
 		.addr = 0,
 		.size = (unsigned long) high_memory - PAGE_OFFSET
 	};
-	struct ib_device_attr device_attr;
 	struct ib_qp_init_attr qp_init_attr;
 	struct ib_qp_cap qp_cap;
 	struct ib_mad_port_private *entry, *priv = NULL,
@@ -1180,12 +1179,6 @@
 		goto error5;
 	}
 
-	/* Query device to obtain max_sge */
-	if (ib_query_device(device, &device_attr)) {
-		printk(KERN_ERR "Could not ib_query_device\n");
-		device_attr.max_sge = IB_MAD_SEND_REQ_MAX_SG;
-	}
-
 	for (i = 0; i < 2; i++) {
 		memset(&qp_init_attr, 0, sizeof qp_init_attr);
 		qp_init_attr.send_cq = priv->cq;
@@ -1194,7 +1187,7 @@
 		qp_init_attr.rq_sig_type = IB_SIGNAL_ALL_WR;
 		qp_init_attr.cap.max_send_wr = IB_MAD_QP_SEND_SIZE;
 		qp_init_attr.cap.max_recv_wr = IB_MAD_QP_RECV_SIZE;
-		qp_init_attr.cap.max_send_sge = device_attr.max_sge;
+		qp_init_attr.cap.max_send_sge = IB_MAD_SEND_REQ_MAX_SG;
 		qp_init_attr.cap.max_recv_sge = IB_MAD_RECV_REQ_MAX_SG;
 		if (i == 0)
 			qp_init_attr.qp_type = IB_QPT_SMI;
Index: ib_mad_priv.h
===================================================================
--- ib_mad_priv.h	(revision 769)
+++ ib_mad_priv.h	(working copy)
@@ -62,7 +62,7 @@
 /* QP and CQ parameters */
 #define IB_MAD_QP_SEND_SIZE	2048
 #define IB_MAD_QP_RECV_SIZE	512
-#define IB_MAD_SEND_REQ_MAX_SG	1
+#define IB_MAD_SEND_REQ_MAX_SG	2
 #define IB_MAD_RECV_REQ_MAX_SG	1
 
 #define IB_MAD_SEND_Q_PSN	0





More information about the general mailing list