[ofa-general] [PATCH]: IB/ipoib control LRO with a module param

Eli Cohen eli at mellanox.co.il
Mon Oct 15 01:01:32 PDT 2007


Allow to control LRO

Use a module parameter to control whether LRO is enabled or disabled.
This is required when the host is configured as a router, in which
case using LRO would cause IP packets to be forwarded with wrong
TCP checksum. 

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

---

Index: ofa_1_3_dev_kernel/drivers/infiniband/ulp/ipoib/ipoib_ib.c
===================================================================
--- ofa_1_3_dev_kernel.orig/drivers/infiniband/ulp/ipoib/ipoib_ib.c	2007-10-14 12:10:17.000000000 +0200
+++ ofa_1_3_dev_kernel/drivers/infiniband/ulp/ipoib/ipoib_ib.c	2007-10-14 12:34:16.000000000 +0200
@@ -52,6 +52,10 @@ MODULE_PARM_DESC(data_debug_level,
 		 "Enable data path debug tracing if > 0");
 #endif
 
+static int lro_enabled = 1;
+module_param(lro_enabled, int, 0644);
+MODULE_PARM_DESC(lro_enabled, "Enable LRO when > 1");
+
 static DEFINE_MUTEX(pkey_mutex);
 
 struct ipoib_ah *ipoib_create_ah(struct net_device *dev,
@@ -245,7 +249,7 @@ static void ipoib_ib_handle_rx_wc(struct
 		   checksum offload I put it here */
 		if ((((struct iphdr *)(skb->data))->ihl) == 5) {
 			skb->ip_summed = CHECKSUM_UNNECESSARY;
-			if (!ipoib_lro_rx(priv, skb))
+			if (lro_enabled && !ipoib_lro_rx(priv, skb))
 				goto repost;
 		}
 	}




More information about the general mailing list