Received: by 10.223.185.116 with SMTP id b49csp1115057wrg; Sat, 3 Mar 2018 16:01:40 -0800 (PST) X-Google-Smtp-Source: AG47ELsFMx/COC5A7ExBuBLSnnUJBtXDO4Q7RULmLVPO5POt4Ya1QZhbHrEAb3UCM9D8z7iUMZ4a X-Received: by 2002:a17:902:7082:: with SMTP id z2-v6mr5690067plk.130.1520121700089; Sat, 03 Mar 2018 16:01:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520121700; cv=none; d=google.com; s=arc-20160816; b=ohtRZuwtncmi7qoH7JjoNvoiTQIzb+bHDXhvj6TOH0mb3Ki9Au4zm6kSwFxOnfQSPr qEZcgMBzJSzK2dkB2EDuhq/+Be0uFNB5TEhQOnsTEQpky0TVw6CShsPxIjltGqk3uErq /5AY0R4YKtJer+kcMOrbLNob9ht9d0G+EkDLOMbKoOGTPU7b2cRbYdGalR43yybKIivs 3xSHOILtNS0B9falAOomJSNc7WNPBu5XM+qwiacu/SVUASAe4sZfmg74nq73FGrMVLe/ luGzGx09ANOJdjohTOb1X2MSuIGcFHpbk6cN1cVEcYTpO3KTqQtE28Zg48rkht3ulbiA aPlw== 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=ERE9Pnq+UkgSznftqWZk2g586kzP1wVWrCY16ocgTV8=; b=RnTRliEcz1LzDSELx1BNrI18gSWzaHjvcb+Me4NV3/UVRY/1bqm/xYxpX70KgOnLnS 3Rda1BxZq0tnrdtYoVKWCfw6O+nydiv8gghoLVO7OU9R4knnkyviQQWOelSVyFo5oPci SHslSQQSWruzdylqttLQr8kU4CxPQFScX8Pq2XltyA4KOkeF8mM2ULfzBl+TGnmWYHP2 46FlgwMMVQbvWFiVRKkYX5L/mReTNKAUq/IhR1VAFKVLLQjiTPsDcfb09rq1m6roBppp zgNDobThmmRdL9Avw7nMnLxUMAkaJrCtIByvFft4SnMQf90no5ysBDDXEalxh+h4BCA8 I6YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=CqF9JXEM; 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 y64si7616642pfj.47.2018.03.03.16.01.25; Sat, 03 Mar 2018 16:01:40 -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=CqF9JXEM; 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 S932956AbeCDAAL (ORCPT + 99 others); Sat, 3 Mar 2018 19:00:11 -0500 Received: from mail-cys01nam02on0122.outbound.protection.outlook.com ([104.47.37.122]:12928 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933379AbeCCWcJ (ORCPT ); Sat, 3 Mar 2018 17:32:09 -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=ERE9Pnq+UkgSznftqWZk2g586kzP1wVWrCY16ocgTV8=; b=CqF9JXEMawKGA6y1VkskGdKz4uZqo4Hk8gztGwKRMMvYjzXo0AW4eWVDj6p4yT/4Mz+2YLRjv3mvfr2KINwgjX3dveCm9A+ooDesLDdw2R26sFbc1/0sojUE1LOoxVr2Z24A1MSUvYndLQY2Z0Sj31yjjHIXHpvHbxKhQVCbKtY= 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: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:32:04 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Andrey Vagin , Alexey Kuznetsov , Patrick McHardy , "David S. Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 046/219] net/8021q: create device with all possible features in wanted_features Thread-Topic: [PATCH AUTOSEL for 4.9 046/219] net/8021q: create device with all possible features in wanted_features Thread-Index: AQHTsz7wpqU0iSxCwUS1LvAVnJB7qA== Date: Sat, 3 Mar 2018 22:28:22 +0000 Message-ID: <20180303222716.26640-46-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;7:qepBWM3xZ9pgmTJnvNwVKWrcM6ZY7Y+aGl563qlNk0+TDptwYxYHGuOlTMeR30r2vNNmtYMCGXjxr0GygRhLU5E8RMvWschy3bqfq1HKqYog+v6c9VQ/zfdWUBcILO8z7LhbDRYQc/oxOXVAnIQ7J7Fj5K3W1ZfZL33mc5N6RwEVL+/z0PGqoXai9jpvlEZ6N8ut6MZdj7k2PbWn62epSA77L5IRgv/Ej7wT/WqU/TzAvnpelB1YFuJSQ2mpkaSV x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 2fd2cf3b-4492-4914-b474-08d58156975b 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)(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)(25786009)(186003)(72206003)(26005)(102836004)(86362001)(6666003)(2501003)(3280700002)(6506007)(5660300001)(10090500001)(59450400001)(66066001)(106356001)(5250100002)(2900100001)(2950100002)(86612001)(6486002)(107886003)(22906009)(217873001);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: PlkfxSGUl2YJsO4Aa5LBixhIPSRKKRGKZr/nNt7wqcAXiNv+7GAVaDsNGDyGN//OhKFbnxVT3M1ucHObKUHvaTMJ7iyIml7ErmyTyZcxEbGCRDzMdTiZNI5NsEJicPN3Y/yhQZLSVSftdli9ERpKegVXhtsbsmP1vuu/HlK+5xY= 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: 2fd2cf3b-4492-4914-b474-08d58156975b X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2018 22:28:22.7444 (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: Andrey Vagin [ Upstream commit 88997e4208aea117627898e5f6f9801cf3cd42d2 ] wanted_features is a set of features which have to be enabled if a hardware allows that. Currently when a vlan device is created, its wanted_features is set to current features of its base device. The problem is that the base device can get new features and they are not propagated to vlan-s of this device. If we look at bonding devices, they doesn't have this problem and this patch suggests to fix this issue by the same way how it works for bonding devices. We meet this problem, when we try to create a vlan device over a bonding device. When a system are booting, real devices require time to be initialized, so bonding devices created without slaves, then vlan devices are created and only then ethernet devices are added to the bonding device. As a result we have vlan devices with disabled scatter-gather. * create a bonding device $ ip link add bond0 type bond $ ethtool -k bond0 | grep scatter scatter-gather: off tx-scatter-gather: off [requested on] tx-scatter-gather-fraglist: off [requested on] * create a vlan device $ ip link add link bond0 name bond0.10 type vlan id 10 $ ethtool -k bond0.10 | grep scatter scatter-gather: off tx-scatter-gather: off tx-scatter-gather-fraglist: off * Add a slave device to bond0 $ ip link set dev eth0 master bond0 And now we can see that the bond0 device has got the scatter-gather feature, but the bond0.10 hasn't got it. [root@laptop linux-task-diag]# ethtool -k bond0 | grep scatter scatter-gather: on tx-scatter-gather: on tx-scatter-gather-fraglist: on [root@laptop linux-task-diag]# ethtool -k bond0.10 | grep scatter scatter-gather: off tx-scatter-gather: off tx-scatter-gather-fraglist: off With this patch the vlan device will get all new features from the bonding device. Here is a call trace how features which are set in this patch reach dev->wanted_features. register_netdevice vlan_dev_init ... dev->hw_features =3D NETIF_F_HW_CSUM | NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_GSO_SOFTWARE | NETIF_F_HIGHDMA | NETIF_F_SCTP_CRC | NETIF_F_ALL_FCOE; dev->features |=3D dev->hw_features; ... dev->wanted_features =3D dev->features & dev->hw_features; __netdev_update_features(dev); vlan_dev_fix_features ... Cc: Alexey Kuznetsov Cc: Patrick McHardy Cc: "David S. Miller" Signed-off-by: Andrei Vagin Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/8021q/vlan_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index fbfacd51aa34..767144128b95 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c @@ -562,8 +562,7 @@ static int vlan_dev_init(struct net_device *dev) NETIF_F_HIGHDMA | NETIF_F_SCTP_CRC | NETIF_F_ALL_FCOE; =20 - dev->features |=3D real_dev->vlan_features | NETIF_F_LLTX | - NETIF_F_GSO_SOFTWARE; + dev->features |=3D dev->hw_features | NETIF_F_LLTX; dev->gso_max_size =3D real_dev->gso_max_size; dev->gso_max_segs =3D real_dev->gso_max_segs; if (dev->features & NETIF_F_VLAN_FEATURES) --=20 2.14.1