Received: by 10.223.185.116 with SMTP id b49csp1068646wrg; Sat, 3 Mar 2018 14:39:50 -0800 (PST) X-Google-Smtp-Source: AG47ELugw4DiJ30KBlhB3MteS3NFZPzyUPf+X3LbTz0Hwnmi709TZHL+NjSrRrYOqRjdioJ8eXq3 X-Received: by 2002:a17:902:365:: with SMTP id 92-v6mr8958351pld.127.1520116790081; Sat, 03 Mar 2018 14:39:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520116790; cv=none; d=google.com; s=arc-20160816; b=ivVNTD1pCeeWueCdvTm3oUU7jHQWPXAMJ5GGohFQOJFhVJfVrC8dls7ixuim4aYNm4 aRjY8dgfPpylKY4ktiWq95SWj7Uqt3J5uI2/BtBHM5tB/LJWQzSP770tAb6y0jPyL5pV kqWubg/ucjKi03q+iZnGvmyOImqD/ncoJ7GvO6W0gzTJbMtnzg0pGW24LOLhXvV8CUqE Vc7+m0DIuo7aOmIBzIUoyNat/y6yGfPbRhca0MmrpeMDPai6bIM7srv4INhPwGw+N3LK ZAZsHG15iX4QbIfrbIgmrylTM5U4v4INWrN90cWozGWnjAEEkA+pFPli6AKE1AzQZLt/ C2jg== 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=O63wNfU4S8UKh4pPmss7UzdY22nn6sXIq4uqssm/AKs=; b=lNs8/CiViJP7Fi8XRT+0bDc7c8qzzxn6EmYhzowz5rM3aQrt9mjbWWQsEqbyxkr9KF 7/eYXwuJFAokljK49i2BNtl/zV137TXlJ0+5wY6EPL1Msz6DGkcrXlEqrWWni1fbKLbc /bH/mUm7q6bOoXhIw242zdZR7cLnXm/Sm8RmGD8Hw38fWladmLhgRUGpwve5e0hZeMAO 1BROHZMKMz8EaECMWYKXnQlR7qkAvZSDF6vILNH8Ueqof6nz1iTU+A3PCWNOntwzjbZz ghK8JpF0RWh3vpNXJzihERN8SG5Z7bK7OPk65GujJgoasODggPGCazC1OQGAi4geErZZ Uimg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=jg+45PJK; 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 z124si6072007pgb.677.2018.03.03.14.39.36; Sat, 03 Mar 2018 14:39:50 -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=jg+45PJK; 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 S934973AbeCCWiY (ORCPT + 99 others); Sat, 3 Mar 2018 17:38:24 -0500 Received: from mail-cys01nam02on0126.outbound.protection.outlook.com ([104.47.37.126]:19904 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934564AbeCCWiQ (ORCPT ); Sat, 3 Mar 2018 17:38:16 -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=O63wNfU4S8UKh4pPmss7UzdY22nn6sXIq4uqssm/AKs=; b=jg+45PJKXaeNpu57OSCYuc7CfgF5wT4o5jF4b7yTK9m3JVuXPe/NkP0ZxqaUW/Dlp/ICM62CFWHvsCpnQ5GPL462jctCuzpxJHG6flmfotXjXP9OTL/H24Xhu4p6ulyeVHQJuH9CjYJnJ10UV/l4lTLpMrVkgrFJVk0tMKiIZNk= Received: from MW2PR2101MB1034.namprd21.prod.outlook.com (52.132.149.10) by MW2PR2101MB1067.namprd21.prod.outlook.com (52.132.149.20) 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:38:11 +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:38:11 +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.4 030/115] sched: act_csum: don't mangle TCP and UDP GSO packets Thread-Topic: [PATCH AUTOSEL for 4.4 030/115] sched: act_csum: don't mangle TCP and UDP GSO packets Thread-Index: AQHTsz9RyiTXxVWar0Oy+3Punnyw9A== Date: Sat, 3 Mar 2018 22:31:06 +0000 Message-ID: <20180303223010.27106-30-alexander.levin@microsoft.com> References: <20180303223010.27106-1-alexander.levin@microsoft.com> In-Reply-To: <20180303223010.27106-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;MW2PR2101MB1067;6:IUXO9yTI1mpx5XrfU+gKeFfanaeRCq4ZSW1RCpwbmVBp1211egTAJ+4aHmKgWRar2spHAW2+gZWbKBqdkrYrDm8Nqebsi7572YefTK8lPaFjX9Qaa1fz8YFUp9SAhULNM0v2FyHHU5Gm8mXHC+5qEr/OhLBwLXT4kYiUJ3ziXrKKN/nJkN26wdxWzt93ztEpuolKIBdcAYC2oi/rmq102t3WJfs6RetW0sryoBCZtZEh/laOPiyRAJPQ1HP9QDL7tFZ/ozKEkhW96FwbABMnR+sHuDK+FzEF11/v/YjDTQokRpgHEYoFy49lAI5znEQRckYS7jLMSlOgAkZE3qOiR97a6wuZXdDWaKPNgPhxspueXFPJgINuC//VEzjJev1V;5:wYzJt2ndOoZguRnroBzHGR6AGDaKZEbBwQ1kh7UJRam3lVdAweXgo+Uik23jU/sEGrQCGOAdRkeeu9gtksH95XOLGrmUos8ITdaqMUw6FhqCTMfd/Pqko/5xPhYsawO+M/zVkbN7Qp5A2/sStOOy0CbkGQrTPsz1TIpkL/gElJY=;24:xjzcnOlSYc/0bv8QgpiI+pygLeBMmUu7EM6hjfnCi8WJfL/H9/HwwWn4iK77yL0+j07tKnKzSB/z34X1iBay6lABy6pZiYVd3dLDDsuIZ0o=;7:REReA6Vd3xsl1AVWjahltyrPgq00aXVaI7UIw7JYBKsOtT7bUaNNYjgtylWtLGMzXpPDxYZaKY2bmiGqpwd9OKuQIJaaRTvEF1u1z6MY6Le6HFlwHtyuZpGh4OV22f4T8PNDHnbJ6SU3wUz6MT94j927ycn+M/bLHruTiIOnTP8hNwn1jxy3KO9mdOVZTZTX9SwXT3s4xIZDGAem7dyk03ePSCs8xwVvsw7LwYVInACfOj/MJbRGj12mUmjCVjPN x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 39a8b9c7-777f-4a9d-7b88-08d5815771a5 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:MW2PR2101MB1067; x-ms-traffictypediagnostic: MW2PR2101MB1067: 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)(3002001)(10201501046)(93006095)(93001095)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011);SRVR:MW2PR2101MB1067;BCL:0;PCL:0;RULEID:;SRVR:MW2PR2101MB1067; x-forefront-prvs: 0600F93FE1 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(366004)(376002)(39860400002)(39380400002)(346002)(199004)(189003)(4326008)(5250100002)(86362001)(1076002)(2501003)(110136005)(6666003)(81156014)(2906002)(8936002)(305945005)(81166006)(2950100002)(7736002)(10290500003)(26005)(186003)(3660700001)(478600001)(72206003)(107886003)(8676002)(3280700002)(59450400001)(2900100001)(76176011)(6116002)(25786009)(3846002)(102836004)(575784001)(6506007)(5660300001)(97736004)(10090500001)(86612001)(106356001)(99286004)(6512007)(66066001)(316002)(53936002)(14454004)(105586002)(36756003)(6486002)(54906003)(6436002)(68736007)(22452003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:MW2PR2101MB1067;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: rju1CbypE3JHGMlFeJW8V/RyoLD7nlm2XABtIsKnNmsqxjJjaerCbOigRAMxSPl+EqR8Eq85CblAKXDXVl12X6lhIrn42UxL8wkZoAqv/y1FPs2Yv9lUQRopWgWapZ8FgbMl68hqgiUjP6aJJvlx6FKn/NUAQBz6mZyHjZ+lwF4= 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: 39a8b9c7-777f-4a9d-7b88-08d5815771a5 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2018 22:31:06.2602 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR2101MB1067 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 eeb3eb3ea9eb..024d6cf342c5 100644 --- a/net/sched/act_csum.c +++ b/net/sched/act_csum.c @@ -175,6 +175,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; @@ -196,6 +199,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; @@ -219,6 +225,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, @@ -272,6 +281,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