Received: by 10.223.185.116 with SMTP id b49csp1111431wrg; Sat, 3 Mar 2018 15:55:04 -0800 (PST) X-Google-Smtp-Source: AG47ELuA+PuwukAAD0A6YEwgvpeLtWL7krW6kNGMNyw/6MKlGt6ahKt4h+H/fiPX1w8o82y22pYD X-Received: by 10.101.97.207 with SMTP id j15mr8254319pgv.266.1520121304316; Sat, 03 Mar 2018 15:55:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520121304; cv=none; d=google.com; s=arc-20160816; b=kTsxVCXJoYhX73q1DU98LzrVxgpdzBDnqC0btgydF5aj0ua0N3TBs+gdCqBE3A0hhh m3bBs0epUG62Hjg0qmdLPuMBw3o+pBeVS27zXi389WvqLXYW8AmQ2YkhDyxRlP1AYRIb x4hoRD9xEhfnnbYyFXqdU1CK+BVOJ3aKkBMlQAO1OBmF0dZSQsm12c8WH6dNeTIFpM2h 0I7UlucOsQlVdpCu7w3yNav4CTjkfzoEmHpk2GRILesuB21n6MDFFLtPF/GDWI6lCFJn PShvudxb/kZwwmVxosQ8jxRSSIdQmE3/HM+bMV3jLl1JSW0noSgtMgruVtpfyT3p0zQw Ej+Q== 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=ofqXQDYOEyzMu6QMi4SHTEfwDScFi8ynvGvYB1s1NW4=; b=XVLHjbAnxvz3jUSDuy/6SjqCjLkedzGaQSV4d2i7uoQjqTFPNV2qzFPLkBVTWRT9dT TyAhrW3VqOm4DjoBYYxq3Dq4LvjROgkc6dH1PjiLimpcJZeLJDGL9ZhF78dCj4oYv8I6 Z6ohS2swaLRQty/5r1ENED+J/hbFDPoK5X8DAiOzsJeqKyHo3BV0fbEgydN1XogScwHI +qF4spVErBv/QQukOlNvd7WWqCgSG8CHwnxSoSURFiaAfd4BU2D33hiIyD4cRQydxdkX Gijexb6xspWdSm/iBE2bfkqr3WB3QaHDsWzBL47ee7DW3N3VrYcGunpjxTeQNmDm++4w K2jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=ARxyamXB; 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 y28si7530897pfk.273.2018.03.03.15.54.50; Sat, 03 Mar 2018 15:55:04 -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=ARxyamXB; 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 S933481AbeCCWc6 (ORCPT + 99 others); Sat, 3 Mar 2018 17:32:58 -0500 Received: from mail-cys01nam02on0126.outbound.protection.outlook.com ([104.47.37.126]:47215 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932419AbeCCWcv (ORCPT ); Sat, 3 Mar 2018 17:32:51 -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=ofqXQDYOEyzMu6QMi4SHTEfwDScFi8ynvGvYB1s1NW4=; b=ARxyamXBSCRpBLsXCXqrpuRQQr0gOjTX3jiQ3ZVlIWzMdj30o69/sRrZsX/eoDcCmCPQkRzOYXTFrhhIzSj5wQbjl0E7N8Aza1T/L1hwRLSpN/Gx1v7zvIvqLdtzfiYpS3Q5w72mDDSi5sX/v7tBRoQfREguDUwxyq8MMp8PFv4= Received: from MW2PR2101MB1034.namprd21.prod.outlook.com (52.132.149.10) by MW2PR2101MB1098.namprd21.prod.outlook.com (52.132.149.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.2; Sat, 3 Mar 2018 22:32:49 +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:32:49 +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 4.9 061/219] sched: act_csum: don't mangle TCP and UDP GSO packets Thread-Topic: [PATCH AUTOSEL for 4.9 061/219] sched: act_csum: don't mangle TCP and UDP GSO packets Thread-Index: AQHTsz71A1IZ9HcaVEuLjKGcrKkRVg== Date: Sat, 3 Mar 2018 22:28:31 +0000 Message-ID: <20180303222716.26640-61-alexander.levin@microsoft.com> References: <20180303222716.26640-1-alexander.levin@microsoft.com> In-Reply-To: <20180303222716.26640-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;MW2PR2101MB1098;6:1OO32LjOmM3q4cTA4+0YcvKUUW+TFh95E/BBhvoMCLPYijGAl9tZ7isD+A51K727z+kqrggSoFZTaJLSktBujP7/vH9QBCxrZ7jssgckkMtOnNu7XLZHyqwLsGBNSSKi6q3Fr3zzWfGXVUm9i9SppY3+10DeJqQqk42tlSTfedQB/OshY9V105FyQHIUmiY53mk1grFvwXd9Y++eW11o9Ust+be8fbVgj8FWbQSp/tgjQqcCIarKAE/HPhuKM6zZjVXpMcqURBej9gEg8DB/CBR1mgblcL290jn6lVOyJD3Nbt3fdmMIlL6z9j5A2lGiIuCjWfaRgZmF9v0QIytdX1+SDusPJpARHJOlyv1gGqZMkn6U+uBC8YbL8NurQj92;5:pLtR3JYf5pnAp+6tPGv/Ys3a3Di5movunn0cbqtHJ4QslB5oCv08eohVBW7ipKNUX3X/vTovg2MAB/ZAwMcYi9cG93hRorwgQuLT/IQURobUpV6/HyFx+Fy7ObKbhL7XWGXRqhW/cQZ3QQ+a0e6RQ/0zu4SRx4xgt6llvdaQCLs=;24:uKR5vwQGZ4/andKhvBZbGFv7Xi1qPXadSgx2+05RaKF00WCIHUK/C1YGKSPX8/6YhOo6/6xXhLo/imBvjHeo27uQzHpND4ktWq+jg9pbVgA=;7:Fl1Lv1RhhdRhtKtO7Ide1hVb1sLer9ZuRKcBHMl0Y8BTPCgqcWo0h6yngKsQ8iF+x5BjTyKihAs522iCLGtdVR9W5maqozqmBD8QZFMtss/ygUGNUw/D0jMQVZh8vEbYcFcqvZnMHY1N9iVnbAZ6W/qNgQ29ggQw443a9BBjjdbWxqlH1+4Z+S1yTvN7hNMaojZRXC5yJGR2QkN3YmHxQ3IoSJpmiH/bdkatMq0r+xWUUjns8jnOlicoB65KsEac x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: d357e49a-82a5-43fc-570a-08d58156b1d8 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:MW2PR2101MB1098; x-ms-traffictypediagnostic: MW2PR2101MB1098: 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)(3231220)(944501244)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(61426038)(61427038)(6041288)(20161123562045)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:MW2PR2101MB1098;BCL:0;PCL:0;RULEID:;SRVR:MW2PR2101MB1098; x-forefront-prvs: 0600F93FE1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(979002)(39860400002)(376002)(39380400002)(366004)(396003)(346002)(199004)(189003)(2906002)(8936002)(36756003)(6512007)(81156014)(10290500003)(81166006)(99286004)(6436002)(68736007)(478600001)(3846002)(22452003)(53936002)(8676002)(110136005)(54906003)(4326008)(316002)(76176011)(6116002)(7736002)(105586002)(305945005)(3660700001)(1076002)(14454004)(97736004)(575784001)(25786009)(186003)(72206003)(26005)(102836004)(86362001)(6666003)(2501003)(3280700002)(6506007)(5660300001)(10090500001)(59450400001)(66066001)(106356001)(5250100002)(2900100001)(2950100002)(86612001)(6486002)(107886003)(22906009)(217873001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:MW2PR2101MB1098;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: jSKhJb8mzcmiLD1bqjb2JGh416fx+/YqS0TXlkCrO49/Lf1IGvBNuXMlAGf4hj39yEiSKzcZjEnghzm5mKvO6PKO2pWLupn8f9EUVpI+QzHxgVIFDVwgMMPSiqcAItNZ5qA8tpujnvPR2IuGOuLz/euoC+DRCbDF3VyyBexbDkQ= 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: d357e49a-82a5-43fc-570a-08d58156b1d8 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2018 22:28:31.6663 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR2101MB1098 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 e0defcef376d..24a0c66394a0 100644 --- a/net/sched/act_csum.c +++ b/net/sched/act_csum.c @@ -180,6 +180,9 @@ static int tcf_csum_ipv4_tcp(struct sk_buff *skb, unsig= ned int ihl, 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; @@ -201,6 +204,9 @@ static int tcf_csum_ipv6_tcp(struct sk_buff *skb, unsig= ned int ihl, 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; @@ -224,6 +230,9 @@ static int tcf_csum_ipv4_udp(struct sk_buff *skb, unsig= ned int ihl, 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, @@ -277,6 +286,9 @@ static int tcf_csum_ipv6_udp(struct sk_buff *skb, unsig= ned int ihl, 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