Thread (1 message) 1 message, 1 author, 2012-01-30

RE: [PATCH 2/2] IB/ipoib: fix GRO merge failure for IPoIB originated TCP streams

From: Shlomo Pongratz <hidden>
Date: 2012-01-30 07:44:09
Also in: linux-rdma

Hi Roland,

I see this fix as part of a more general fix, one that will enable more protocols (e.g. X25, PPP) to enjoy the benefit of GRO.
I think that the more general fix should include adding a MAC comparison function to the header_ops structure in netdev.h.
Then network drivers which are not Ethernet will register their own comparison function, and the GRO code will check if such routine exists and if so will use it.
The problem with this approach is that until such a major fix is integrated the IPoIB performance will suffer.
This simple fix will enable us to use the benefit of GRO until the more general fix is integrated.

Best regards,

S.P.
 

-----Original Message-----
From: <redacted> [mailto:<redacted>] On Behalf Of Roland Dreier
Sent: Monday, January 30, 2012 6:44 AM
To: Or Gerlitz
Cc: linux-rdma; Shlomo Pongratz; <redacted>
Subject: Re: [PATCH 2/2] IB/ipoib: fix GRO merge failure for IPoIB originated TCP streams

On Thu, Jan 26, 2012 at 6:43 AM, Or Gerlitz [off-list ref] wrote:
From: Shlomo Pongratz <redacted>

The GRO flow makes a check in every layer to ensure the packets are 
actually merged only if they match at all layers.

The first GRO check, at L2 always fails for IPoIB, since it assumes 
that all packets have 14 bytes of Ethernet link layer header. Using 
the IPoIB header will not help here either, since its only four bytes. 
To overcome this, the skb mac header pointer is set to an area within 
the packet IB GRH headroom, such that later, the L2 check done by GRO 
succeeds and it can move to checks at the network and transport layers.
quoted hunk
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c 
b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index 4115be5..89cfaf7 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -286,10 +287,20 @@ static void ipoib_ib_handle_rx_wc(struct 
net_device *dev, struct ib_wc *wc)
       else
               skb->pkt_type = PACKET_MULTICAST;

-       skb_pull(skb, IB_GRH_BYTES);
+       /*
+        * GRO first does L2 compares (14 bytes). We must not let it 
+ start from
+        * the IPoIB header as ten octets of the IP header, containing 
+ fields
+        * which vary from packet to packet will cause non-merging of packets.
+        * from the same TCP stream.
+        */
+       psgid = skb_pull(skb, offsetof(struct ib_grh, sgid));
+       /* if there's no GRH, that area could contain random data */
+       if (!(wc->wc_flags & IB_WC_GRH))
+               memset(psgid, 0, 16);
+       skb_reset_mac_header(skb);
+       skb_pull(skb, IB_GRH_BYTES - offsetof(struct ib_grh, sgid));

       skb->protocol = ((struct ipoib_header *) skb->data)->proto;
-       skb_reset_mac_header(skb);
This seems like a really weird place to fix this.  Wouldn't it make more sense to fix the GRO check to handle non-ethernet
L2 headers?

 - R.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help