[ofw] [Patch][IPoIB_NDIS6_CM] Offset calculation bug at __send_gen()

Alex Naslednikov xalex at mellanox.co.il
Wed Dec 22 02:48:09 PST 2010


Fix the situation when ETH header fully contained at first SG element
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 3033)
+++ ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp	(working copy)
@@ -4337,10 +4337,12 @@
 	 * while (N+1) element may contain only part of it
 	 */
 	 	
-	while( total_offset >= p_sgl->Elements[i].Length  )
+	while( total_offset >= p_sgl->Elements[i].Length - DataOffset )
 	{
 		// skip the current element and increment the index
-		total_offset -= p_sgl->Elements[i++].Length;
+		total_offset -= ( p_sgl->Elements[i].Length - DataOffset);
+		DataOffset = 0;
+		i++;
 	}
 
 	



More information about the ofw mailing list