Received: by 10.213.65.68 with SMTP id h4csp1720064imn; Mon, 19 Mar 2018 11:22:52 -0700 (PDT) X-Google-Smtp-Source: AG47ELtiTpk5ENyvInMK2moTvDj7HJQqPZQStkxO6Km0VwW6EyB4g1b1kOnsFoWYZlZALKnVgefe X-Received: by 10.99.119.15 with SMTP id s15mr9940099pgc.211.1521483772420; Mon, 19 Mar 2018 11:22:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521483772; cv=none; d=google.com; s=arc-20160816; b=S7ghlfqyz2omg87mYKAq+n745xP0BvT2JSTaB8UzAwGuroEwTpya7GZ+Rhe++0m7PI aihe5EwStdwmKuJXRZ/L1UmKtxEPJBqB6j9LSb37FqRKnewQ2Xl2J8ZDL3ofA0wzNZGE y5OC5NArrjLm59dywo8zXs2+xCRc6/zlsuOMBF6mIU4VQRRfJRlL974xlcF+8lYeLCsM pKWTnGkrvcbkH0nbAnDIPEidP/Xoushs9GzTRSkX75rka0mw8OPFwQPhkRHGaX5CWoU5 Ab+2ingnruMRruLiiFu/z+M0aaUFyr/gG36P1tbFvgqcl2miIT28PSQf193AdDdM0SIA 9Guw== 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=Czu3otyTjWISn+OKqMq10G1irgilU2r7ck5pMlK9nKM=; b=nBD6DmoLMou20NFQakQMtbDkigRd7IzmtIB15NyzMCFJ4Ulc4sed02d3tfHuvKNk/b TtFLqPrqa0D20FdufTXLH+OCe1phFp7xRE0PvkPBcBiLOf30Q0SCJky/MkqP1FDb8jux hwYOEcEL+yf2jgEXjZLvFRKaxzwTPBCxKHTO4UNikCR+Qp+4iS/VeWkMMifq9NfTQBG8 /cqXO6eIPxY2NMecWUko42NALhCxkyrlpnT062Y9YQYeic+2dGfrK+6b9aUyPNLNNK0u k22pKBSHVzukLtjOGWR07VGZth8aB1gRxfeTXCE44PkiDvg6Rj8jgFxv/Wn0GqxMwWjZ 2Bxw== 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 u10si304678pgr.164.2018.03.19.11.22.38; Mon, 19 Mar 2018 11:22:52 -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 S1030945AbeCSST6 (ORCPT + 99 others); Mon, 19 Mar 2018 14:19:58 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47398 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030927AbeCSSTt (ORCPT ); Mon, 19 Mar 2018 14:19:49 -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 1DC221070; Mon, 19 Mar 2018 18:19:48 +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.9 044/241] net/8021q: create device with all possible features in wanted_features Date: Mon, 19 Mar 2018 19:05:09 +0100 Message-Id: <20180319180753.017795559@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@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.9-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 @@ -562,8 +562,7 @@ static int vlan_dev_init(struct net_devi NETIF_F_HIGHDMA | NETIF_F_SCTP_CRC | 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; dev->gso_max_segs = real_dev->gso_max_segs; if (dev->features & NETIF_F_VLAN_FEATURES)