提交 45c8184c 编写于 作者: R Ross Lagerwall 提交者: David S. Miller

xen-netfront: Update features after registering netdev

Update the features after calling register_netdev() otherwise the
device features are not set up correctly and it not possible to change
the MTU of the device. After this change, the features reported by
ethtool match the device's features before the commit which introduced
the issue and it is possible to change the device's MTU.

Fixes: f599c64f ("xen-netfront: Fix race between device setup and open")
Reported-by: NLiam Shepherd <liam@dancer.es>
Signed-off-by: NRoss Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: NJuergen Gross <jgross@suse.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 cb257783
......@@ -1951,10 +1951,6 @@ static int xennet_connect(struct net_device *dev)
/* talk_to_netback() sets the correct number of queues */
num_queues = dev->real_num_tx_queues;
rtnl_lock();
netdev_update_features(dev);
rtnl_unlock();
if (dev->reg_state == NETREG_UNINITIALIZED) {
err = register_netdev(dev);
if (err) {
......@@ -1964,6 +1960,10 @@ static int xennet_connect(struct net_device *dev)
}
}
rtnl_lock();
netdev_update_features(dev);
rtnl_unlock();
/*
* All public and private state should now be sane. Get
* ready to start sending and receiving packets and give the driver
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册