[Devel] [PATCH RHEL7 COMMIT] ve/net: Fix vlan NETIF_F_VIRTUAL feature initialization

Konstantin Khorenko khorenko at virtuozzo.com
Fri Aug 28 15:30:47 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-229.7.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.6.3
------>
commit 3e11f3abe191cb393cd8c025913e6a9b739fcabe
Author: Kirill Tkhai <ktkhai at odin.com>
Date:   Sat Aug 29 02:30:46 2015 +0400

    ve/net: Fix vlan NETIF_F_VIRTUAL feature initialization
    
    vlan_setup() is called when dev's net hasn't been set yet:
    
    rtnl_create_link
        alloc_netdev_mqs
            dev_net_set(dev, &init_net)
            vlan_setup
               ...
               if (!ve_is_super(dev_net(dev)->owner_ve))
                  dev->features |= NETIF_F_VIRTUAL
               ...
        dev_net_set(dev, net)
    
    So vlan's dev has no NETIF_F_VIRTUAL feature, and further
    check of ve_is_dev_movable() fails.
    
    Patch makes the feature to be set always, independent
    of dev_net(). Anyway, in further we test it only if
    ve is not super. Also, others (loopback for exmple) set
    it always too.
    
    https://jira.sw.ru/browse/PSBM-35266
    
    Signed-off-by: Kirill Tkhai <ktkhai at odin.com>
    Acked-by: Andrew Vagin <avagin at odin.com>
---
 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 80fa918..09205c3 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -794,6 +794,5 @@ void vlan_setup(struct net_device *dev)
 	dev->ethtool_ops	= &vlan_ethtool_ops;
 
 	memset(dev->broadcast, 0, ETH_ALEN);
-	if (!ve_is_super(dev_net(dev)->owner_ve))
-		dev->features |= NETIF_F_VIRTUAL;
+	dev->features |= NETIF_F_VIRTUAL;
 }



More information about the Devel mailing list