From patchwork Mon Jun 3 22:36:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ariel Levkovich X-Patchwork-Id: 1109544 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="aLmawRKK"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45Hqfz4N7nz9s4Y for ; Tue, 4 Jun 2019 08:36:59 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726561AbfFCWg6 (ORCPT ); Mon, 3 Jun 2019 18:36:58 -0400 Received: from mail-eopbgr70070.outbound.protection.outlook.com ([40.107.7.70]:6068 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726163AbfFCWgw (ORCPT ); Mon, 3 Jun 2019 18:36:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IwX+38+H+tk8sc6X1RXbf/70tWby43NBe4Jprh7iXIc=; b=aLmawRKKx3S+RhHFeS8Y0ZNWugGzgduIU5lVKcOuJLVHeXv/viX1/3qajUUyOG2+3XsaTdy7cseuTb0rhx5rBW/W1B3jrCY8JBERqbPV4/IRAd8j3gorGHz+qss4R9hczE7HMcn/KGOzH2zmYYVvzYwbWEGN2Nfuz6Khdlahpr0= Received: from AM4PR05MB3313.eurprd05.prod.outlook.com (10.171.189.29) by AM4PR05MB3250.eurprd05.prod.outlook.com (10.170.126.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1943.18; Mon, 3 Jun 2019 22:36:46 +0000 Received: from AM4PR05MB3313.eurprd05.prod.outlook.com ([fe80::55c3:8aaf:20f6:5899]) by AM4PR05MB3313.eurprd05.prod.outlook.com ([fe80::55c3:8aaf:20f6:5899%5]) with mapi id 15.20.1922.021; Mon, 3 Jun 2019 22:36:46 +0000 From: Ariel Levkovich To: "netdev@vger.kernel.org" CC: Ariel Levkovich , Jay Vosburgh , Veaceslav Falico , Andy Gospodarek Subject: [PATCH net-next 1/2] net: bonding: Inherit MPLS features from slave devices Thread-Topic: [PATCH net-next 1/2] net: bonding: Inherit MPLS features from slave devices Thread-Index: AQHVGlzTb0sVHTqHN0+KjtGPCs6Ttg== Date: Mon, 3 Jun 2019 22:36:46 +0000 Message-ID: <1559601394-5363-2-git-send-email-lariel@mellanox.com> References: <1559601394-5363-1-git-send-email-lariel@mellanox.com> In-Reply-To: <1559601394-5363-1-git-send-email-lariel@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [141.226.120.58] x-mailer: git-send-email 1.8.3.1 x-clientproxiedby: LO2P265CA0106.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:c::22) To AM4PR05MB3313.eurprd05.prod.outlook.com (2603:10a6:205:9::29) authentication-results: spf=none (sender IP is ) smtp.mailfrom=lariel@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5680ab3c-c77c-49f2-8da0-08d6e873f5c6 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600148)(711020)(4605104)(1401327)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:AM4PR05MB3250; x-ms-traffictypediagnostic: AM4PR05MB3250: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-forefront-prvs: 0057EE387C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(396003)(39860400002)(346002)(376002)(189003)(199004)(14454004)(86362001)(3846002)(256004)(186003)(6116002)(2501003)(4720700003)(99286004)(4326008)(2351001)(25786009)(66476007)(26005)(386003)(6506007)(11346002)(6916009)(52116002)(36756003)(446003)(71200400001)(76176011)(71190400001)(316002)(305945005)(508600001)(66066001)(486006)(5640700003)(14444005)(2616005)(68736007)(476003)(81166006)(73956011)(8676002)(1730700003)(81156014)(6512007)(8936002)(2906002)(7736002)(5660300002)(66446008)(64756008)(66556008)(6436002)(50226002)(66946007)(54906003)(102836004)(53936002)(6486002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3250; H:AM4PR05MB3313.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: DANH4tfA8o/n9xOCFcsP8QwmfPQkvUdFckgOQsrUYyXrbQ0vCItIiP8lWmRY2JVersdLwihkWX12tS0UO2xnrbBqU0K7bEgCgV+Fv/QnuhFVkv7568cRjanr9XszXBYmRqHteMpxVPckmrtfsDlhi/Q0Cnl0FHa+FFPbLN+WUTrEiPmDNtv9I6mIJy/THZd0FMPxjjOL/ZRuwL3oa2Ms6RsNWUqzQo6W5IHpn+Bwv273j9BPnvq1a3lZ9l7tkf4ch4Hw8EnpkbCsbiaCECQvmj6CuddnbNeZbeDjexv9KhsCPrYTYeT+NxkRji50Pn3wYARDEYywk1p5M9u5GzzKl7GZQcYM9QddXAeEHiddmh71UJapNsUf/76bNOvFuEW1JAQxWJhp6zKgap3+fn181odPbFyIGA7uN2c1yWQFlNU= MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5680ab3c-c77c-49f2-8da0-08d6e873f5c6 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2019 22:36:46.4455 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: lariel@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3250 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When setting the bonding interface net device features, the kernel code doesn't address the slaves' MPLS features and doesn't inherit them. Therefore, HW offloads that enhance performance such as checksumming and TSO are disabled for MPLS tagged traffic flowing via the bonding interface. The patch add the inheritance of the MPLS features from the slave devices with a similar logic to setting the bonding device's VLAN and encapsulation features. CC: Jay Vosburgh CC: Veaceslav Falico CC: Andy Gospodarek Signed-off-by: Ariel Levkovich --- drivers/net/bonding/bond_main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 062fa7e..46b5f6d 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1077,12 +1077,16 @@ static netdev_features_t bond_fix_features(struct net_device *dev, #define BOND_ENC_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ NETIF_F_RXCSUM | NETIF_F_ALL_TSO) +#define BOND_MPLS_FEATURES (NETIF_F_HW_CSUM | NETIF_F_SG | \ + NETIF_F_ALL_TSO) + static void bond_compute_features(struct bonding *bond) { unsigned int dst_release_flag = IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM; netdev_features_t vlan_features = BOND_VLAN_FEATURES; netdev_features_t enc_features = BOND_ENC_FEATURES; + netdev_features_t mpls_features = BOND_MPLS_FEATURES; struct net_device *bond_dev = bond->dev; struct list_head *iter; struct slave *slave; @@ -1093,6 +1097,7 @@ static void bond_compute_features(struct bonding *bond) if (!bond_has_slaves(bond)) goto done; vlan_features &= NETIF_F_ALL_FOR_ALL; + mpls_features &= NETIF_F_ALL_FOR_ALL; bond_for_each_slave(bond, slave, iter) { vlan_features = netdev_increment_features(vlan_features, @@ -1101,6 +1106,11 @@ static void bond_compute_features(struct bonding *bond) enc_features = netdev_increment_features(enc_features, slave->dev->hw_enc_features, BOND_ENC_FEATURES); + + mpls_features = netdev_increment_features(mpls_features, + slave->dev->mpls_features, + BOND_MPLS_FEATURES); + dst_release_flag &= slave->dev->priv_flags; if (slave->dev->hard_header_len > max_hard_header_len) max_hard_header_len = slave->dev->hard_header_len; @@ -1114,6 +1124,7 @@ static void bond_compute_features(struct bonding *bond) bond_dev->vlan_features = vlan_features; bond_dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL | NETIF_F_GSO_UDP_L4; + bond_dev->mpls_features = mpls_features; bond_dev->gso_max_segs = gso_max_segs; netif_set_gso_max_size(bond_dev, gso_max_size); From patchwork Mon Jun 3 22:36:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ariel Levkovich X-Patchwork-Id: 1109543 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="SwCJwaFR"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45Hqfy1DXyz9s5c for ; Tue, 4 Jun 2019 08:36:58 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726490AbfFCWg4 (ORCPT ); Mon, 3 Jun 2019 18:36:56 -0400 Received: from mail-eopbgr70070.outbound.protection.outlook.com ([40.107.7.70]:6068 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726463AbfFCWgy (ORCPT ); Mon, 3 Jun 2019 18:36:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vHTpNX/9HtwuZ2OPp+C+3MdRhI8Sb79JfX2p81AA7t0=; b=SwCJwaFR1HTk3wia2bmU/iO4zb+NT/byWTlzxhe48rmaGHnf+f6xLgYhQjzZW43DpvZsGaTQ90WQ7YGTBlrtj5i95fyXfycFNw5Yq4oROOY6JRBB1tl+lpJYTbsTM7DcI/woAM9uK7CPch4oqaQ6mv3EYZKbl3vQ+5bKimyOTgs= Received: from AM4PR05MB3313.eurprd05.prod.outlook.com (10.171.189.29) by AM4PR05MB3250.eurprd05.prod.outlook.com (10.170.126.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1943.18; Mon, 3 Jun 2019 22:36:47 +0000 Received: from AM4PR05MB3313.eurprd05.prod.outlook.com ([fe80::55c3:8aaf:20f6:5899]) by AM4PR05MB3313.eurprd05.prod.outlook.com ([fe80::55c3:8aaf:20f6:5899%5]) with mapi id 15.20.1922.021; Mon, 3 Jun 2019 22:36:47 +0000 From: Ariel Levkovich To: "netdev@vger.kernel.org" CC: Ariel Levkovich Subject: [PATCH net-next 2/2] net: vlan: Inherit MPLS features from parent device Thread-Topic: [PATCH net-next 2/2] net: vlan: Inherit MPLS features from parent device Thread-Index: AQHVGlzT2OnZmiBtIk6HdG4jK+ELag== Date: Mon, 3 Jun 2019 22:36:47 +0000 Message-ID: <1559601394-5363-3-git-send-email-lariel@mellanox.com> References: <1559601394-5363-1-git-send-email-lariel@mellanox.com> In-Reply-To: <1559601394-5363-1-git-send-email-lariel@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [141.226.120.58] x-mailer: git-send-email 1.8.3.1 x-clientproxiedby: LO2P265CA0106.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:c::22) To AM4PR05MB3313.eurprd05.prod.outlook.com (2603:10a6:205:9::29) authentication-results: spf=none (sender IP is ) smtp.mailfrom=lariel@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7233167b-378c-4533-56b5-08d6e873f62d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600148)(711020)(4605104)(1401327)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:AM4PR05MB3250; x-ms-traffictypediagnostic: AM4PR05MB3250: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 0057EE387C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(396003)(39860400002)(346002)(376002)(189003)(199004)(14454004)(86362001)(3846002)(256004)(186003)(6116002)(2501003)(4720700003)(99286004)(4326008)(107886003)(2351001)(25786009)(66476007)(26005)(386003)(6506007)(11346002)(6916009)(52116002)(36756003)(446003)(71200400001)(76176011)(71190400001)(316002)(305945005)(508600001)(66066001)(486006)(5640700003)(14444005)(2616005)(68736007)(476003)(81166006)(73956011)(8676002)(1730700003)(81156014)(6512007)(8936002)(2906002)(7736002)(5660300002)(66446008)(64756008)(66556008)(6436002)(50226002)(66946007)(102836004)(53936002)(6486002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3250; H:AM4PR05MB3313.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: knH1+inQn6LRkX7UMzuvIt5gGfXrEg+RuqSsLNiv579For3V3JJNo7D8MGfysGsNQF0Y6FCV763Yw3lrzMxhSEXL3xYQwn76Z+ez1bl3PS2Ry5AZtFZo2xhZS+EuThSY5DkeZsX2mQ9jOyOPngcA5yPBo0GXDYyd1wN+6vGxTR5WEZ+Y/IqyMYY7kO0RPRaQE0+fcqhyeH5kB8O7R8f1CMcBgiF43hpRwLHVCI2qNFKr6hUAb1ZZZIsTQaq3L4+4NlBDbj1u4i+yOQCfNwKzB8inxwsWMlFgkVYCs+pqwgw0VEOYGb7v9OpiQp5kYRLGBSLUNJVio+N/ZIU5FTMq8qyAwLzn8c2kffOoer92pW1WHIxnxFvCvZg+qo5fTDp+0CqGhnafUAa5iYbIj5Hr8Nttgv3P90un4ZH3EdCDy4E= MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7233167b-378c-4533-56b5-08d6e873f62d X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2019 22:36:47.2291 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: lariel@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3250 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org During the creation of the VLAN interface net device, the various device features and offloads are being set based on the parent device's features. The code initiates the basic, vlan and encapsulation features but doesn't address the MPLS features set and they remain blank. As a result, all device offloads that have significant performance effect are disabled for MPLS traffic going via this VLAN device such as checksumming and TSO. This patch makes sure that MPLS features are also set for the VLAN device based on the parent which will allow HW offloads of checksumming and TSO to be performed on MPLS tagged packets. Signed-off-by: Ariel Levkovich --- net/8021q/vlan_dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index f044ae5..585e73d 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c @@ -582,6 +582,7 @@ static int vlan_dev_init(struct net_device *dev) dev->vlan_features = real_dev->vlan_features & ~NETIF_F_ALL_FCOE; dev->hw_enc_features = vlan_tnl_features(real_dev); + dev->mpls_features = real_dev->mpls_features; /* ipv6 shared card related stuff */ dev->dev_id = real_dev->dev_id;