[ofw] [Patch] [IPoIB_NDIS6_CM] LSO bug fix

Alex Naslednikov xalex at mellanox.co.il
Sun Sep 19 08:16:43 PDT 2010


LSO bug fix

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

Index: B:/users/xalex/MLNX_VPI_trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp
===================================================================
--- B:/users/xalex/MLNX_VPI_trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp	(revision 5274)
+++ B:/users/xalex/MLNX_VPI_trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp	(revision 5275)
@@ -3989,7 +3989,8 @@
 	NDIS_STATUS		status;
 	uint32_t		i, j 		= 1;
 	ULONG 			DataOffset	= 0; 	
-	uint32_t		offset 		= sizeof(eth_hdr_t);
+	uint32_t		EthHeaderOffset 		= sizeof(eth_hdr_t);
+	static const 	EthIPoIBHeaderOffset 	= EthHeaderOffset - sizeof(ipoib_hdr_t);
 	
 	PERF_DECLARE( SendCopy );
 
@@ -4047,27 +4048,27 @@
 			****************************/
 			
 			p_desc->send_wr[0].local_ds[j].vaddr = 
-				p_sgl->Elements[0].Address.QuadPart + lso_header_size;
+				p_sgl->Elements[0].Address.QuadPart + lso_header_size + DataOffset + EthIPoIBHeaderOffset;
 			p_desc->send_wr[0].local_ds[j].length = 
-				p_sgl->Elements[0].Length - lso_header_size;
+				p_sgl->Elements[0].Length - lso_header_size - DataOffset - EthIPoIBHeaderOffset;
 			p_desc->send_wr[0].local_ds[j].lkey = s_buf->p_port->ib_mgr.lkey;
 			/* Set the number of data segments. */
 			p_desc->send_wr[0].wr.num_ds = 1;
 			return NDIS_STATUS_SUCCESS;
 		}		
 	}
-	else while( offset )
+	else while( EthHeaderOffset )
 	{
-		if( p_sgl->Elements[i].Length <= offset )
+		if( p_sgl->Elements[i].Length <= EthHeaderOffset )
 		{
-			offset -= p_sgl->Elements[i++].Length;
+			EthHeaderOffset -= p_sgl->Elements[i++].Length;
 		}
 		else
 		{
 			p_desc->send_wr[0].local_ds[j].vaddr =
-				p_sgl->Elements[i].Address.QuadPart + offset + DataOffset;
+				p_sgl->Elements[i].Address.QuadPart + EthHeaderOffset + DataOffset;
 			p_desc->send_wr[0].local_ds[j].length =
-				p_sgl->Elements[i].Length - offset - DataOffset;
+				p_sgl->Elements[i].Length - EthHeaderOffset - DataOffset;
 			p_desc->send_wr[0].local_ds[j].lkey = s_buf->p_port->ib_mgr.lkey;
 			i++;
 			j++;



More information about the ofw mailing list