lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 01 Feb 2012 15:07:42 +0100
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Or Gerlitz <or.gerlitz@...il.com>
Cc:	Herbert Xu <herbert@...dor.apana.org.au>,
	Roland Dreier <roland@...nel.org>, netdev@...r.kernel.org,
	linux-rdma <linux-rdma@...r.kernel.org>,
	Shlomo Pongratz <shlomop@...lanox.com>
Subject: Re: [PATCH 2/2] IB/ipoib: fix GRO merge failure for IPoIB
 originated TCP streams

Le mercredi 01 février 2012 à 11:43 +0200, Or Gerlitz a écrit :
> On Wed, Feb 1, 2012 at 10:38 AM, Herbert Xu <herbert@...dor.apana.org.au> wrote:
> > On Wed, Feb 01, 2012 at 10:23:22AM +0200, Or Gerlitz wrote:
> 
> >> So what would you recommend here? not sure if you saw that, but Shlomo
> >> suggested to add new entry to the header ops, compare_header e.g such
> >> that if skb->dev has this callback use it instead of
> >> compare_ether_header in __napi_gro_receive, makes sense?
> 
> > If we just turn it into a memcmp with a variable length would
> > that work for you?
> 
> I think yes, FWIW we will compare the IPoIB header, Roland is that okay for you?

A memcmp(xxx, yyy, variable_len) will be out of line and slow, its a bit
sad ...

Are skb_mac_header(p) / skb_gro_mac_header(skb) going to point to IPoIB
header ?

Maybe we can keep a fastpath for ethernet case...
(the "if (hlen == ETH_HLEN) being always predicted)

Maybe need to introduce gro_hard_header_len as well)

diff --git a/net/core/dev.c b/net/core/dev.c
index 115dee1..62abee4 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3500,14 +3500,20 @@ static inline gro_result_t
 __napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
 {
 	struct sk_buff *p;
+	unsigned int hlen = skb->dev->hard_header_len;
 
 	for (p = napi->gro_list; p; p = p->next) {
 		unsigned long diffs;
 
 		diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev;
 		diffs |= p->vlan_tci ^ skb->vlan_tci;
-		diffs |= compare_ether_header(skb_mac_header(p),
-					      skb_gro_mac_header(skb));
+		if (hlen == ETH_HLEN)
+			diffs |= compare_ether_header(skb_mac_header(p),
+						      skb_gro_mac_header(skb));
+		else if (!diffs)
+			diffs = memcmp(skb_mac_header(p),
+					skb_gro_mac_header(skb),
+					skb->dev->hard_header_len);
 		NAPI_GRO_CB(p)->same_flow = !diffs;
 		NAPI_GRO_CB(p)->flush = 0;
 	}


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ