Received: by 10.223.185.116 with SMTP id b49csp1091912wrg; Sat, 3 Mar 2018 15:19:21 -0800 (PST) X-Google-Smtp-Source: AG47ELv9xl6ehYxmdYFvOrMShrodL1plj8pW1sl6KGuaMRgCeqdwGM30H9lNAu6XU9tD19Sfthq0 X-Received: by 2002:a17:902:167:: with SMTP id 94-v6mr9031394plb.294.1520119161387; Sat, 03 Mar 2018 15:19:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520119161; cv=none; d=google.com; s=arc-20160816; b=Z9xRnE1GKCgaK7TwnUNTbLKu7JGCWTPTbQ7s+S9Z4OEBGsb6g2hqT5Xp+AUtg4SvdE eX6ud9rvwCSHLsq6xOvdN3wBWKhm3Gi37qUxlYHjH+6VeJlSEZTHIS8CURzkLyMWGXhS dyIVrXbx2lhJ5J8dyIzor3KDSArNHyK8PZi4JY0eH7ITJDN3JiZbCESVa3+WgKo1/DIF aPuGzT3UW2IsehKucjvfRX78SKZD4erYSR8fQH1r7AfwiU7FqcuEAppPsfhUapiZ/+0u sESZzCxQTiHw27n3uXGKY8xG8UoMkmGuOxEtV1P6bVZ6uPNnDeFjpbo/cYFwNWC4fMh+ hVFg== 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=mmd6uBVTK2LUv1wy4WKqRxoNdciDxqEfVbfIe1XNLRk=; b=EllF93uF/N4MbbUS4gVtyM7/whaOkOjXclGp5hIdfDMY5HhO8SihQ9930D4LD2dnm4 10P1Bbrmk9HQq+GIMLaVo1v8LEcyG4Zr4IaKy0+K+fZTrhxQm5bN1vARpOOnnLWSuMaI PpOLSlZCyDd7fgZaN3qFNcyBuYxv71AP4dKyR74pre6ZpwzvdkQ97V3QlbZZxRKoN7q7 gufdJUwpUjeS0pTSYCH2jNw1k24SNgeM9LroMKaQADJOl/1drvYUK4q3IuOx+Foa0g9K 1itRcES6OSJeccUFkY26sVP0rGm5erFQHN9GtBMeGgF3jLUvQEbhKqsNcaCxznOZiUQu 3JEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=k9k82LeH; 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 t13si7376286pfa.294.2018.03.03.15.19.07; Sat, 03 Mar 2018 15:19:21 -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=k9k82LeH; 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 S932606AbeCCXRY (ORCPT + 99 others); Sat, 3 Mar 2018 18:17:24 -0500 Received: from mail-cys01nam02on0114.outbound.protection.outlook.com ([104.47.37.114]:41081 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934883AbeCCWiL (ORCPT ); Sat, 3 Mar 2018 17:38:11 -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=mmd6uBVTK2LUv1wy4WKqRxoNdciDxqEfVbfIe1XNLRk=; b=k9k82LeHnFf49RYDwAny8fQRYklCNYBn2PpHAvNmNsDwhyWFrCOervqurZkimS7CiG0pHYju7X13Vdh/L/Csl8YTXWZrNkLiVPtydBG1aEF5tkphi5e5khg/+FnLZHROX6ah7ojCxQ0SjL/rZUaegnGhisHgGK2nXrcR36l96Pg= 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:06 +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:06 +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.4 020/115] net/8021q: create device with all possible features in wanted_features Thread-Topic: [PATCH AUTOSEL for 4.4 020/115] net/8021q: create device with all possible features in wanted_features Thread-Index: AQHTsz9NJzezMZKepUGwp4cc897VcA== Date: Sat, 3 Mar 2018 22:30:59 +0000 Message-ID: <20180303223010.27106-20-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:oDyCZUoxp/AZk374tAcn4aW9T/Nsjz9t7eIEyi7LlKC86q9GSoHog9fbyIDkOdX5w+fwSDgY4qx4R92fiPN2Ank5Wt1Z51Pf9JQUX/maESUGYP0sBjpXSlPMepevf3Z2KRaJILzYnaUD5ia23pg88Kefh7W7MV2xNEGNW58+ivZW0nJE0XEo8nW6SDmz9VoBfmWsStwjxnS8UJujJQAv/MZjyM0WhIQ4qT1tXaV0xlM4cDUlHMG68mkKMGTxNwn6Kch6w3U4O1i8+FOcmS69xCEG8AzftYSEeA1FBblU6rPY7FXp8ledk1sE6cIMGnF1FtfqRX1HfYMpITMRY1Oc4lYk3LmZpkMnkcSRdxjw2ID52zDyxDOpCR7CX4aI8+f3;5:Ob6dnQbRGvmXGRgt/9loj4B72xxHCuFVwZCH8Mr5eWecUdEz+8ujJ2sTvBOrvjSzCNTqciRMTcSqiXVNRi+LqyuMiYags86y51oXCS6ZvcCXjBpQvmiAYwRoB5R9XXDoN2H50E9QLn5uSd2UOzcYzPOI2GtJg1Hp8UX3wSfeBYc=;24:oIv3W+Hz8CDxdc57YRk+K8YBk4AAwqr/oMHtEwgY1TtbuJTts0RomQwLlBiamxxdGvPK6YiakObSgBMEjSJ+mG7JuNBsxMpMRh2B+dqCZxI=;7:/txjgO9Y06Y4ptpWNV8KeTi9CuwXpzQSGAzChgVPEuxJ4+XwtmUPZ0jFAfeXo+/8aKLeCSmpLIfg4edqdT3vqxXZWVLs46vshnUz8Pn0OBc7N5z83c/HnXCh8FJ3dRXdtkPu9/78f8AhtZLI1ON/Y6YgFR/LzayncrUCldhFCHjr9GYyEu71pBqb/+e6MtDuOgWBVDOHti5AXrCNwoqEJfDpLs6C5UYohx2aiNpATLgk68CxhPV/FNWI2uvXoD8D x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 24eb1d15-7579-4cea-389b-08d581576ebb 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)(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: 2mNSEN5acu2TS3npIOGkwJe7dWISVbGuCLCPOq6Sx7T33mXDUCIgiJI4FAdTzOCDECmoU8B9iDkGMBjmaxUfdzZEU/ReGuantjn230Uk8Xv42iDlXvWdFc3HDecAVbw15FbmRPP/JmlTWOZYxIHzYamwt1X7O6x4P0/KJdAknug= 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: 24eb1d15-7579-4cea-389b-08d581576ebb X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2018 22:30:59.4634 (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: 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 ca4dc9031073..89da689b6433 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c @@ -559,8 +559,7 @@ static int vlan_dev_init(struct net_device *dev) NETIF_F_HIGHDMA | NETIF_F_SCTP_CSUM | 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; if (dev->features & NETIF_F_VLAN_FEATURES) netdev_warn(real_dev, "VLAN features are set incorrectly. Q-in-Q config= urations may not work correctly.\n"); --=20 2.14.1