Received: by 10.223.185.116 with SMTP id b49csp1076274wrg; Sat, 3 Mar 2018 14:54:13 -0800 (PST) X-Google-Smtp-Source: AG47ELutgalCL2pLgPDAMN6xl4oa0dw9dwQCsDTxBoH3iGqGgI7F+t2EicpqO8LdjtQpOlZyAQEg X-Received: by 10.99.110.133 with SMTP id j127mr8348916pgc.79.1520117653605; Sat, 03 Mar 2018 14:54:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520117653; cv=none; d=google.com; s=arc-20160816; b=jSU37OvsTqA/s3zQFKazstWb6xH5JQ1T8rKR2jMMsVA8Tt245HWe8rnAmzEO8oONk3 /BwhoD79cx8gJ8cWWDBtb2ZL8e1HCk7jCCZ4qb8oH2amn3Ex11bi83qn/ypx3kHJqBpq on9f84zeZNvT6RGngfDatkGD83MojEfT/PXFPsFYN/S96AJ0tgEb3N3E31GpcnuTweDO eQ8t1tKUytCr7ANQgRCzKgMX6RdH+QsibZaBiHKIwi9gBrg53mHJWzk5BMi4qVnUIZwR RV1AydBnupW5XapPK8bYTNcZMRECBis2EKwbVZCUyOtlpNbFSlws7JsyQgjVyEz0psEE 7JKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=5HdeLQYIqtVFKi3efjqp91xTmfAm68alR1c0w1Y2OgI=; b=ZwMla7cks/9l6t8H+avyzYySxEWA9/WhvbDEtlXFStF7KlLBSRKSNni8/7UMUlX+cg g+P7CQpQGcahdgDI4AayScgRe0YjWOWgHNrFjnI+FJtpJiW2OhsnK6m4AfBlcafU+R3i 5kweRfIt6NPSYQepdxa3erMsDVJRt52fMEi4yme5+kSSJIzF6+Ov/xzW6GnZAUFfr0nb LAK3nstXCPKsk816DKfLMZ+brrmhoq/jqRWCdbP7ovTk/rzNVFVnAtIA0WfLqoLnxvwZ d9F2flQfmaYlkmM7lXkBCrLLFYgOaIrsBIghCkiMgmr1v64T6NoU1dRc9SKePEvJPlga ELXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=e42DaTId; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k9si6123474pgo.42.2018.03.03.14.53.59; Sat, 03 Mar 2018 14:54:13 -0800 (PST) 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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=e42DaTId; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934154AbeCCWxO (ORCPT + 99 others); Sat, 3 Mar 2018 17:53:14 -0500 Received: from mail-by2nam01on0095.outbound.protection.outlook.com ([104.47.34.95]:48488 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935413AbeCCWlH (ORCPT ); Sat, 3 Mar 2018 17:41:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=5HdeLQYIqtVFKi3efjqp91xTmfAm68alR1c0w1Y2OgI=; b=e42DaTIdKC/i5Uh+8Y3yDKXnMYV2UFEzLUXzhy4X2iL6zPzFIsnU1tH0gKIgg5SAHtRJm0vWDw/DhbM6uBOx6TrWZuNs1YKHVqtJ/l9bHXYepmHHP6F367q9dAZMRPkTCaAH7rs1Tq8i97esYLGyDnalfs55a6b19fjefSbmix8= Received: from MW2PR2101MB1034.namprd21.prod.outlook.com (52.132.149.10) by MW2PR2101MB0940.namprd21.prod.outlook.com (52.132.146.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.5; Sat, 3 Mar 2018 22:41:04 +0000 Received: from MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0]) by MW2PR2101MB1034.namprd21.prod.outlook.com ([fe80::1d56:338f:e2b:cec0%3]) with mapi id 15.20.0567.006; Sat, 3 Mar 2018 22:41:04 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Davide Caratti , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 3.18 18/63] sched: act_csum: don't mangle TCP and UDP GSO packets Thread-Topic: [PATCH AUTOSEL for 3.18 18/63] sched: act_csum: don't mangle TCP and UDP GSO packets Thread-Index: AQHTsz+h3XhuJZmK2UCQFzwJMCWvEA== Date: Sat, 3 Mar 2018 22:33:19 +0000 Message-ID: <20180303223228.27323-18-alexander.levin@microsoft.com> References: <20180303223228.27323-1-alexander.levin@microsoft.com> In-Reply-To: <20180303223228.27323-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MW2PR2101MB0940;6:THkNUavZze5PiflbpaJ/NyNEuH0JrTnyE2LKPHmuIppNictImFJybGQII64oXbmHLOUvY1oQSmqiu7ArKm47eb0m38OwIFYs3PbgyWpl1IugoDkU0gUKTeAwNFv06PcRtPk4GedRrAI153bc26qLPKNkCi5d7UFEaDiCrmxnCd5BxCvyTAuUl50Xx68Lty/J0z2NmLb829Y0wGEz3VHFmfomzUf7i715ZBt+lzWoDkMhqfdG2i22QuJzy3GQlBPJO6j4l1qd5Kidv0T1LaqbWYMMPhUYnR/lmDmHUXW25idv6yo/JrkFNbd8iY+F4rAQphzlA/ShKiZPK8pkmVxSemzUNOy9HfvtL96yKKlBeTCH0tRWM6HzyLu1Xe0GQzba;5:a/XVwd9yCC44jf5bAk9lAlx4Q4aQ8ZFPdQ3O5FhCZVVwXoD1VVrE9X3+aSGkldM+k/byQ/wqLNW+z4P4BT/CDb5pPoBJicBVKuZuPuO1DtSEQjXUs6eg6hd/8fQLfqEEwyGiiWZq5IFDtmzSpRm+kh0zMCwWHc4/NSuGYYXqbUY=;24:/dDAq70bk0STvlzw0cMhcH7kQLG9ohoVdPtOZkYwxG5s+O9vefDYCje1NPn2VBZh/TUViFDxA4cM2PHQbTJkdArLRDhwrtqhDQKyNbU5h2g=;7:L8Ux37RUOaZ8hbSzlIhqr6IjzjtbNcL/C5Mi0aL1vCXh0fQYoXTcJq2Hk9FoB8MP7It85bHKLTfcM18bR1zJpurNlk2n6+jsSQZEivMNvwCt4/s/PzT7n+BJCeD7UPBhG5R1RYmlzvEJDF0u42eyfQUqOPk2+uFHk4uWC9ZsGkyNgJl2SfCJuvX0c96M+TAfDIXazhVzzm4Ufd3c8u4amHrRR81Htul/GlzKyOveDh+E1dxwjhXEUsCCldxUwoYe x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 5242d5d8-a2e2-4611-d735-08d58157d922 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7193020);SRVR:MW2PR2101MB0940; x-ms-traffictypediagnostic: MW2PR2101MB0940: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231220)(944501244)(52105095)(6055026)(61426038)(61427038)(6041288)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:MW2PR2101MB0940;BCL:0;PCL:0;RULEID:;SRVR:MW2PR2101MB0940; x-forefront-prvs: 0600F93FE1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(39380400002)(346002)(366004)(39860400002)(396003)(199004)(189003)(106356001)(68736007)(6486002)(25786009)(22452003)(6436002)(186003)(2906002)(81156014)(81166006)(10090500001)(66066001)(8676002)(36756003)(6512007)(2900100001)(316002)(97736004)(59450400001)(102836004)(53936002)(6506007)(3280700002)(26005)(4326008)(5250100002)(305945005)(2501003)(76176011)(2950100002)(86362001)(99286004)(3846002)(72206003)(14454004)(3660700001)(478600001)(1076002)(5660300001)(10290500003)(6666003)(6116002)(7736002)(86612001)(107886003)(110136005)(54906003)(105586002)(8936002)(575784001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:MW2PR2101MB0940;H:MW2PR2101MB1034.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: gWumRXtf6+Ygc2oZ7aGW0ua5qyk196XA5i/hxsosuLPbHQaxUDBCAWlQehsSy+tzI5SgCejIhKW5amPElr0NVo0k4C658r5FQW0xzEO1Z3ZiGrf1KqZ1NGd/V8f/nxe1ySA4W/Xxgc/z9JKKguRfHvegEStBfHHQx2ZU7Cu6AhU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5242d5d8-a2e2-4611-d735-08d58157d922 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2018 22:33:19.8878 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR2101MB0940 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Davide Caratti [ Upstream commit add641e7dee31b36aee83412c29e39dd1f5e0c9c ] after act_csum computes the checksum on skbs carrying GSO TCP/UDP packets, subsequent segmentation fails because skb_needs_check(skb, true) returns true. Because of that, skb_warn_bad_offload() is invoked and the following message is displayed: WARNING: CPU: 3 PID: 28 at net/core/dev.c:2553 skb_warn_bad_offload+0xf0/0x= fd <...> [] skb_warn_bad_offload+0xf0/0xfd [] __skb_gso_segment+0xec/0x110 [] validate_xmit_skb+0x12d/0x2b0 [] validate_xmit_skb_list+0x42/0x70 [] sch_direct_xmit+0xd0/0x1b0 [] __qdisc_run+0x120/0x270 [] __dev_queue_xmit+0x23d/0x690 [] dev_queue_xmit+0x10/0x20 Since GSO is able to compute checksum on individual segments of such skbs, we can simply skip mangling the packet. Signed-off-by: Davide Caratti Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/sched/act_csum.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c index edbf40dac709..72ff5d21f4a7 100644 --- a/net/sched/act_csum.c +++ b/net/sched/act_csum.c @@ -176,6 +176,9 @@ static int tcf_csum_ipv4_tcp(struct sk_buff *skb, struct tcphdr *tcph; const struct iphdr *iph; =20 + if (skb_is_gso(skb) && skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4) + return 1; + tcph =3D tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*tcph)); if (tcph =3D=3D NULL) return 0; @@ -197,6 +200,9 @@ static int tcf_csum_ipv6_tcp(struct sk_buff *skb, struct tcphdr *tcph; const struct ipv6hdr *ip6h; =20 + if (skb_is_gso(skb) && skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) + return 1; + tcph =3D tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*tcph)); if (tcph =3D=3D NULL) return 0; @@ -220,6 +226,9 @@ static int tcf_csum_ipv4_udp(struct sk_buff *skb, const struct iphdr *iph; u16 ul; =20 + if (skb_is_gso(skb) && skb_shinfo(skb)->gso_type & SKB_GSO_UDP) + return 1; + /* * Support both UDP and UDPLITE checksum algorithms, Don't use * udph->len to get the real length without any protocol check, @@ -273,6 +282,9 @@ static int tcf_csum_ipv6_udp(struct sk_buff *skb, const struct ipv6hdr *ip6h; u16 ul; =20 + if (skb_is_gso(skb) && skb_shinfo(skb)->gso_type & SKB_GSO_UDP) + return 1; + /* * Support both UDP and UDPLITE checksum algorithms, Don't use * udph->len to get the real length without any protocol check, --=20 2.14.1