[ofa-general] [PATCH] IB/ipoib: fix bug in LRO

Vladimir Sokolovsky vlad at mellanox.co.il
Sun Jul 6 05:32:14 PDT 2008


lro_flush_all() has to be called prior to calling netif_rx_complete.
Failure to do this may cause ipoib_poll() to get called again while
lro_flush_all() takes place and result in data corruption.

Signed-off-by: Eli Cohen <eli at mellanox.co.il>
Signed-off-by: Vladimir Sokolovsky <vlad at mellanox.co.il>
---
 drivers/infiniband/ulp/ipoib/ipoib_ib.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index ca5afcd..c0fffe9 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -443,6 +443,10 @@ poll_more:
 	}
 
 	if (done < budget) {
+
+		if (dev->features & NETIF_F_LRO)
+			lro_flush_all(&priv->lro.lro_mgr);
+
 		netif_rx_complete(dev, napi);
 		if (unlikely(ib_req_notify_cq(priv->recv_cq,
 					      IB_CQ_NEXT_COMP |
@@ -451,9 +455,6 @@ poll_more:
 			goto poll_more;
 	}
 
-	if (dev->features & NETIF_F_LRO)
-		lro_flush_all(&priv->lro.lro_mgr);
-
 	return done;
 }
 
-- 
1.5.5.1




More information about the general mailing list