Received: by 10.192.165.156 with SMTP id m28csp33232imm; Tue, 10 Apr 2018 15:48:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+312fAnCzcS/OSNVmx2budXCjfDh8gDKllDB6KmktxGkEY5C4dcZZWnLQABuNK56on3vtg X-Received: by 2002:a17:902:bc89:: with SMTP id bb9-v6mr2269357plb.285.1523400534755; Tue, 10 Apr 2018 15:48:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523400534; cv=none; d=google.com; s=arc-20160816; b=TzdRlq78DeIKyipUWfPpMjoF8WGd5QQZRD73qZBDxiRZjJoL91sh8i1zlT217qycqR PnN48UXJGsAcUlkL2tWxQTmlTRJJmwacKY/DH7WmPDdjuAxlwOxIAJsX0FFGOJDOXVzw jcQYHygq7aDT98vKIdXjXvKaOA3w3PqwPdI8SGOH8/95Hql+N37dpn1x3qr+I+4vjFVY 7dO3s12tZROX/56MMw2kBNWOZTCGcqKENurEY4mBVbtISBYeBxmYgyRmwpcECw5FKUyW 7WiUyrTBCvrQzpZvWwcjqB0bQXnbPb0aJPkIgn4Ucio7E7emhe5+kUzlyrBeInoZUoTa ZxRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=v29F7x/V4G8OVCWugBIA+yTQAH9BL/iebSfi61ky/d8=; b=yCR8Y2fzn/yZbeBeorLebSZUCEupHV/uMWLA+4o3i4meyebRdhN1VKh3zqdbSOxz+S rBOsFXfa73QwQafavY+d0Fre8R3VLmGj9r/B1RoDbp+CIcYdZgvdzTvcaSV6cDVabg+C W7z72Rmt+moe1dtsrJyiB/god5rpTmfpPgFIkIkHGYCGEOsoA7J0Ikqy5f+QTFQDUUap fuLJUSsLf7/RxDuEw0QR82nlLJghOX+WvIYtUZQRPVN2FFGLpFpM99TipVWMIMGfSKDu P31msY3UR01dI9JTBU2GFL9vrvKftJcQ+8jevuEusdggi6BvzKi9ubvnVwBe8m9rs+We 70mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n8si2464342pgt.480.2018.04.10.15.48.17; Tue, 10 Apr 2018 15:48:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932618AbeDJWj2 (ORCPT + 99 others); Tue, 10 Apr 2018 18:39:28 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45212 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932601AbeDJWjZ (ORCPT ); Tue, 10 Apr 2018 18:39:25 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E9CBED61; Tue, 10 Apr 2018 22:39:24 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Herbert , David Lebrun , "David S. Miller" Subject: [PATCH 4.14 126/138] ipv6: sr: fix seg6 encap performances with TSO enabled Date: Wed, 11 Apr 2018 00:25:16 +0200 Message-Id: <20180410212916.819488015@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212902.121524696@linuxfoundation.org> References: <20180410212902.121524696@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Lebrun [ Upstream commit 5807b22c9164a21cd1077a9bc587f0bba361f72d ] Enabling TSO can lead to abysmal performances when using seg6 in encap mode, such as with the ixgbe driver. This patch adds a call to iptunnel_handle_offloads() to remove the encapsulation bit if needed. Before: root@comp4-seg6bpf:~# iperf3 -c fc00::55 Connecting to host fc00::55, port 5201 [ 4] local fc45::4 port 36592 connected to fc00::55 port 5201 [ ID] Interval Transfer Bandwidth Retr Cwnd [ 4] 0.00-1.00 sec 196 KBytes 1.60 Mbits/sec 47 6.66 KBytes [ 4] 1.00-2.00 sec 304 KBytes 2.49 Mbits/sec 100 5.33 KBytes [ 4] 2.00-3.00 sec 284 KBytes 2.32 Mbits/sec 92 5.33 KBytes After: root@comp4-seg6bpf:~# iperf3 -c fc00::55 Connecting to host fc00::55, port 5201 [ 4] local fc45::4 port 43062 connected to fc00::55 port 5201 [ ID] Interval Transfer Bandwidth Retr Cwnd [ 4] 0.00-1.00 sec 1.03 GBytes 8.89 Gbits/sec 0 743 KBytes [ 4] 1.00-2.00 sec 1.03 GBytes 8.87 Gbits/sec 0 743 KBytes [ 4] 2.00-3.00 sec 1.03 GBytes 8.87 Gbits/sec 0 743 KBytes Reported-by: Tom Herbert Fixes: 6c8702c60b88 ("ipv6: sr: add support for SRH encapsulation and injection with lwtunnels") Signed-off-by: David Lebrun Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/seg6_iptunnel.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) --- a/net/ipv6/seg6_iptunnel.c +++ b/net/ipv6/seg6_iptunnel.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -211,11 +212,6 @@ static int seg6_do_srh(struct sk_buff *s tinfo = seg6_encap_lwtunnel(dst->lwtstate); - if (likely(!skb->encapsulation)) { - skb_reset_inner_headers(skb); - skb->encapsulation = 1; - } - switch (tinfo->mode) { case SEG6_IPTUN_MODE_INLINE: if (skb->protocol != htons(ETH_P_IPV6)) @@ -224,10 +220,12 @@ static int seg6_do_srh(struct sk_buff *s err = seg6_do_srh_inline(skb, tinfo->srh); if (err) return err; - - skb_reset_inner_headers(skb); break; case SEG6_IPTUN_MODE_ENCAP: + err = iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6); + if (err) + return err; + if (skb->protocol == htons(ETH_P_IPV6)) proto = IPPROTO_IPV6; else if (skb->protocol == htons(ETH_P_IP)) @@ -239,6 +237,8 @@ static int seg6_do_srh(struct sk_buff *s if (err) return err; + skb_set_inner_transport_header(skb, skb_transport_offset(skb)); + skb_set_inner_protocol(skb, skb->protocol); skb->protocol = htons(ETH_P_IPV6); break; case SEG6_IPTUN_MODE_L2ENCAP: @@ -262,8 +262,6 @@ static int seg6_do_srh(struct sk_buff *s ipv6_hdr(skb)->payload_len = htons(skb->len - sizeof(struct ipv6hdr)); skb_set_transport_header(skb, sizeof(struct ipv6hdr)); - skb_set_inner_protocol(skb, skb->protocol); - return 0; }