[ofw] [IPoIB_NDIS6_CM] [Patch 3/3] Improper IPoIB behavior during simultaneous sends on both sides

Alex Naslednikov xalex at mellanox.co.il
Tue Nov 9 09:24:26 PST 2010


Signed-off by: Alexander Naslednikov (xalex at mellanox.co.il)

Index: ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp
===================================================================
--- ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp	(revision 2984)
+++ ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp	(working copy)
@@ -1112,8 +1112,13 @@
 	qp_create.sq_depth = p_port->p_adapter->params.sq_depth;
 
 #define UD_QP_USED_SGE 3
-	qp_create.sq_sge = MAX_SEND_SGE < p_port->p_ca_attrs->max_sges ? 
-			MAX_SEND_SGE  : ( p_port->p_ca_attrs->max_sges - UD_QP_USED_SGE );
+	if ( MAX_SEND_SGE < p_port->p_ca_attrs->max_sges )
+	{
+		p_port->p_ca_attrs->max_sges = MAX_SEND_SGE;
+	}
+	p_port->p_ca_attrs->max_sges -= UD_QP_USED_SGE;
+	qp_create.sq_sge =  p_port->p_ca_attrs->max_sges;
+	
 	if ( !p_port->p_ca_attrs->ipoib_csum ) 
 	{ 
 		/* checksum is not supported by device
@@ -3799,7 +3804,7 @@
 	}
 
 	/* Remember that one of the DS entries is reserved for the IPoIB header. */
-	if( num_pages >= MAX_SEND_SGE )
+	if( num_pages >= p_port->p_ca_attrs->max_sges )
 	{
 		IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_SEND,
 			("Too many buffers to fit in WR ds_array.  Copying data.\n") );
@@ -4270,13 +4275,13 @@
 	   Copy only N+1-MAX_SEND_SGE, where N is a lenght of SG List
 	   Remember that one of the DS entries is reserved for the IPoIB header.
 	*/
-	if( ( p_sgl->NumberOfElements >= MAX_SEND_SGE ||
+	if( ( p_sgl->NumberOfElements >=  s_buf->p_port->p_ca_attrs->max_sges  ||
 		p_sgl->Elements[0].Length < sizeof(eth_hdr_t)) )
 	{
 		IPOIB_PRINT( TRACE_LEVEL_WARNING, IPOIB_DBG_SEND,
 			("Too many buffers %d to fit in WR ds_array[%d] \
 			 Or buffer[0] length %d < Eth header. Copying data.\n",
-			p_sgl->NumberOfElements, MAX_SEND_SGE, p_sgl->Elements[0].Length ) );
+			p_sgl->NumberOfElements,  s_buf->p_port->p_ca_attrs->max_sges , p_sgl->Elements[0].Length ) );
 
 		if( !s_buf->p_port->p_adapter->params.cm_enabled )
 		{
-------------- next part --------------
A non-text attachment was scrubbed...
Name: large_send_3.patch
Type: application/octet-stream
Size: 1904 bytes
Desc: large_send_3.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20101109/c33f16da/attachment.obj>


More information about the ofw mailing list