From patchwork Sat Oct 6 06:32:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 189666 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 19E712C0330 for ; Sat, 6 Oct 2012 16:32:35 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752254Ab2JFGcc (ORCPT ); Sat, 6 Oct 2012 02:32:32 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:49599 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750853Ab2JFGcb (ORCPT ); Sat, 6 Oct 2012 02:32:31 -0400 Received: by mail-bk0-f46.google.com with SMTP id jk13so1265471bkc.19 for ; Fri, 05 Oct 2012 23:32:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=bNlFqYmGqLCFADqRdVxIN4F5N1OrYdwWIVH3RyZjRUk=; b=YmeVuphJ/7z3qSlCDHqeSca7Xy5FbK0BHu4wxbEen5pW0T8EOtm2z9koHHfue6oNzN Q/pZuYhtO/fcxlale7/MiFFbmgC0Va74Jx77ZQuGWk1IQgf5JkLduiJibiqMn7VXTgUO vSC5fFdS2lY90UnbAyog/MWFXaY05N6xznmAOICUCVOpuQSf+GMrxtogOPkRwj3eV6up g0WzHreo+WRZDxyJ9iHypcXjETdgiWAb9fp5w7cXAHRjTbbx2/Vak6AVrS/rioC/IB4S l9bxUov6p6tfJ4wGil83fBv+Vxt7HsHin8zNLF13qe1JWDcZGro1zVYAN9p6fkCtnM3p lvrA== Received: by 10.204.148.202 with SMTP id q10mr3342548bkv.55.1349505149814; Fri, 05 Oct 2012 23:32:29 -0700 (PDT) Received: from [172.28.90.176] ([172.28.90.176]) by mx.google.com with ESMTPS id 1sm5891632bks.3.2012.10.05.23.32.27 (version=SSLv3 cipher=OTHER); Fri, 05 Oct 2012 23:32:28 -0700 (PDT) Subject: [PATCH] ipv6: GRO should be ECN friendly From: Eric Dumazet To: David Miller Cc: Herbert Xu , netdev Date: Sat, 06 Oct 2012 08:32:26 +0200 Message-ID: <1349505146.21172.190.camel@edumazet-glaptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eric Dumazet IPv4 side of the problem was addressed in commit a9e050f4e7f9d (net: tcp: GRO should be ECN friendly) This patch does the same, but for IPv6 : A Traffic Class mismatch doesnt mean flows are different, but instead should force a flush of previous packets. This patch removes artificial packet reordering problem. Signed-off-by: Eric Dumazet Cc: Herbert Xu --- net/ipv6/af_inet6.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index e22e6d8..7739d28 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c @@ -880,22 +880,25 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head, nlen = skb_network_header_len(skb); for (p = *head; p; p = p->next) { - struct ipv6hdr *iph2; + const struct ipv6hdr *iph2; + u32 first_word; /* */ if (!NAPI_GRO_CB(p)->same_flow) continue; iph2 = ipv6_hdr(p); + first_word = *(u32 *)iph ^ *(u32 *)iph2 ; - /* All fields must match except length. */ + /* All fields must match except length and Traffic Class. */ if (nlen != skb_network_header_len(p) || - memcmp(iph, iph2, offsetof(struct ipv6hdr, payload_len)) || + (first_word & htonl(0xF00FFFFF)) || memcmp(&iph->nexthdr, &iph2->nexthdr, nlen - offsetof(struct ipv6hdr, nexthdr))) { NAPI_GRO_CB(p)->same_flow = 0; continue; } - + /* flush if Traffic Class fields are different */ + NAPI_GRO_CB(p)->flush |= (first_word & htonl(0x0FF00000)); NAPI_GRO_CB(p)->flush |= flush; }