Received: by 10.213.65.68 with SMTP id h4csp1799957imn; Mon, 19 Mar 2018 13:36:47 -0700 (PDT) X-Google-Smtp-Source: AG47ELvctwZU1NLrTBILfNA3DAcaRRnIpP7Bbhf3AFHgz+f8wIDfZmecKYU6+02bUA4lllYUsQoI X-Received: by 2002:a17:902:207:: with SMTP id 7-v6mr14131085plc.261.1521491807043; Mon, 19 Mar 2018 13:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521491807; cv=none; d=google.com; s=arc-20160816; b=Ti81MVL9Z4L5/+UhAH/fjLMMFGNSYVBYFZ6ugK4rkn9m4rE61wXRi4aSMImO9JQ8oX 5m2cjBnQI9xI2daDFQInK9gd5OU8M3oDFLcdUtVCVfBtMHZJeF0QfzbOPO0WV+YhcR/n KUI0kaWW9oV9NPoTNisPvDKCNxdnDiE4l9EhSLt556riuxxJ7/54Ome2+8xhPB/fxp3L 705FNdy2h2Ho1sDNik10TlAA2wCcsf4XNFHDNUKaAm/R2i+wGcC1oEmtsvbaKudG0zSu 09AR//V2kw2CbYpbw9GbAUYkG44nqLuiwPRODAawcqlAHrAa2b3KPx2NhzrSRhxiVpCh LawQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=vc7V/v2ipCpfTTB812+v0l1sU+dUoLCCJOHrFaUnHtA=; b=aN9Ci8rZ44tfScfZUQOvxvZKQx9FGx7WSaatThZ5f90cmol2KnS/ZDRZGYBsImqgHU PhF3DqPvWI+eJTTSFVqR0iKyXRKzF6jmIJL6htczs+nT01iWJ/Vz1FMcfVAT+x21JHIb Aim/jvpCX83nu+s4a/HXCfJQPKqEz09yk3DbPtkarlLm41Zlfces5pQ+8GQKhD4xGG1H b6CyO2Ybz2l/6gP1sLoav3YxDoLdDjOUItcvOamU4NSToyK2QgIeRSPrnFxb+e2INNUx vCqUvUSq+jthtGBjllLvr+eO40pScp7UHhPfTmRbJ4HJXoa83Jf6IWFSFk/wHb0b+TwV 9R+Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3si22615pge.715.2018.03.19.13.36.02; Mon, 19 Mar 2018 13:36:47 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935629AbeCSUcb (ORCPT + 99 others); Mon, 19 Mar 2018 16:32:31 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42848 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933279AbeCSSMi (ORCPT ); Mon, 19 Mar 2018 14:12:38 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F088011B4; Mon, 19 Mar 2018 18:12:37 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Kuznetsov , Patrick McHardy , "David S. Miller" , Andrei Vagin , Sasha Levin Subject: [PATCH 4.4 020/134] net/8021q: create device with all possible features in wanted_features Date: Mon, 19 Mar 2018 19:05:03 +0100 Message-Id: <20180319171852.070705529@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319171849.024066323@linuxfoundation.org> References: <20180319171849.024066323@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ 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 = 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 |= dev->hw_features; ... dev->wanted_features = 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 Signed-off-by: Greg Kroah-Hartman --- net/8021q/vlan_dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c @@ -559,8 +559,7 @@ static int vlan_dev_init(struct net_devi NETIF_F_HIGHDMA | NETIF_F_SCTP_CSUM | NETIF_F_ALL_FCOE; - dev->features |= real_dev->vlan_features | NETIF_F_LLTX | - NETIF_F_GSO_SOFTWARE; + dev->features |= dev->hw_features | NETIF_F_LLTX; dev->gso_max_size = real_dev->gso_max_size; if (dev->features & NETIF_F_VLAN_FEATURES) netdev_warn(real_dev, "VLAN features are set incorrectly. Q-in-Q configurations may not work correctly.\n");