xen-netfront: Update features after registering netdev
commit45c8184c1b
upstream. 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:f599c64fdf
("xen-netfront: Fix race between device setup and open") Reported-by: Liam Shepherd <liam@dancer.es> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com> Reviewed-by: Juergen Gross <jgross@suse.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Nobuhiro Iwamatsu (CIP) <nobuhiro1.iwamatsu@toshiba.co.jp> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
731563186f
commit
f379ca6fec
@ -1982,10 +1982,6 @@ static int xennet_connect(struct net_device *dev)
|
|||||||
/* talk_to_netback() sets the correct number of queues */
|
/* talk_to_netback() sets the correct number of queues */
|
||||||
num_queues = dev->real_num_tx_queues;
|
num_queues = dev->real_num_tx_queues;
|
||||||
|
|
||||||
rtnl_lock();
|
|
||||||
netdev_update_features(dev);
|
|
||||||
rtnl_unlock();
|
|
||||||
|
|
||||||
if (dev->reg_state == NETREG_UNINITIALIZED) {
|
if (dev->reg_state == NETREG_UNINITIALIZED) {
|
||||||
err = register_netdev(dev);
|
err = register_netdev(dev);
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -1995,6 +1991,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
|
* All public and private state should now be sane. Get
|
||||||
* ready to start sending and receiving packets and give the driver
|
* ready to start sending and receiving packets and give the driver
|
||||||
|
Reference in New Issue
Block a user