* [PATCH 0/2] xen-netfront: Fix issues with commit f599c64fdf7d
@ 2018-06-21 13:00 Ross Lagerwall
2018-06-21 13:00 ` [PATCH 1/2] xen-netfront: Fix mismatched rtnl_unlock Ross Lagerwall
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Ross Lagerwall @ 2018-06-21 13:00 UTC (permalink / raw)
To: netdev
Cc: Ross Lagerwall, Boris Ostrovsky, Juergen Gross, David S. Miller,
xen-devel, linux-kernel
Fix a couple of issues with commit f599c64fdf7d ("xen-netfront: Fix race
between device setup and open").
Ross Lagerwall (2):
xen-netfront: Fix mismatched rtnl_unlock
xen-netfront: Update features after registering netdev
drivers/net/xen-netfront.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
--
2.9.5
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] xen-netfront: Fix mismatched rtnl_unlock
2018-06-21 13:00 [PATCH 0/2] xen-netfront: Fix issues with commit f599c64fdf7d Ross Lagerwall
@ 2018-06-21 13:00 ` Ross Lagerwall
2018-06-21 13:05 ` Juergen Gross
2018-06-21 13:00 ` [PATCH 2/2] xen-netfront: Update features after registering netdev Ross Lagerwall
2018-06-21 22:56 ` [PATCH 0/2] xen-netfront: Fix issues with commit f599c64fdf7d David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Ross Lagerwall @ 2018-06-21 13:00 UTC (permalink / raw)
To: netdev
Cc: Ross Lagerwall, Boris Ostrovsky, Juergen Gross, David S. Miller,
xen-devel, linux-kernel
Fixes: f599c64fdf7d ("xen-netfront: Fix race between device setup and open")
Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
drivers/net/xen-netfront.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 922ce0a..ee4cb6c 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1810,7 +1810,7 @@ static int talk_to_netback(struct xenbus_device *dev,
err = xen_net_read_mac(dev, info->netdev->dev_addr);
if (err) {
xenbus_dev_fatal(dev, err, "parsing %s/mac", dev->nodename);
- goto out;
+ goto out_unlocked;
}
rtnl_lock();
@@ -1925,6 +1925,7 @@ static int talk_to_netback(struct xenbus_device *dev,
xennet_destroy_queues(info);
out:
rtnl_unlock();
+out_unlocked:
device_unregister(&dev->dev);
return err;
}
--
2.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] xen-netfront: Update features after registering netdev
2018-06-21 13:00 [PATCH 0/2] xen-netfront: Fix issues with commit f599c64fdf7d Ross Lagerwall
2018-06-21 13:00 ` [PATCH 1/2] xen-netfront: Fix mismatched rtnl_unlock Ross Lagerwall
@ 2018-06-21 13:00 ` Ross Lagerwall
2018-06-21 13:12 ` Juergen Gross
2018-06-21 22:56 ` [PATCH 0/2] xen-netfront: Fix issues with commit f599c64fdf7d David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Ross Lagerwall @ 2018-06-21 13:00 UTC (permalink / raw)
To: netdev
Cc: Ross Lagerwall, Boris Ostrovsky, Juergen Gross, David S. Miller,
xen-devel, linux-kernel, Liam Shepherd
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: f599c64fdf7d ("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>
---
drivers/net/xen-netfront.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index ee4cb6c..a57daec 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -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
--
2.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] xen-netfront: Fix mismatched rtnl_unlock
2018-06-21 13:00 ` [PATCH 1/2] xen-netfront: Fix mismatched rtnl_unlock Ross Lagerwall
@ 2018-06-21 13:05 ` Juergen Gross
0 siblings, 0 replies; 6+ messages in thread
From: Juergen Gross @ 2018-06-21 13:05 UTC (permalink / raw)
To: Ross Lagerwall, netdev
Cc: Boris Ostrovsky, David S. Miller, xen-devel, linux-kernel
On 21/06/18 15:00, Ross Lagerwall wrote:
> Fixes: f599c64fdf7d ("xen-netfront: Fix race between device setup and open")
> Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Juergen
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] xen-netfront: Update features after registering netdev
2018-06-21 13:00 ` [PATCH 2/2] xen-netfront: Update features after registering netdev Ross Lagerwall
@ 2018-06-21 13:12 ` Juergen Gross
0 siblings, 0 replies; 6+ messages in thread
From: Juergen Gross @ 2018-06-21 13:12 UTC (permalink / raw)
To: Ross Lagerwall, netdev
Cc: Boris Ostrovsky, David S. Miller, xen-devel, linux-kernel, Liam Shepherd
On 21/06/18 15:00, Ross Lagerwall wrote:
> 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: f599c64fdf7d ("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>
Juergen
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] xen-netfront: Fix issues with commit f599c64fdf7d
2018-06-21 13:00 [PATCH 0/2] xen-netfront: Fix issues with commit f599c64fdf7d Ross Lagerwall
2018-06-21 13:00 ` [PATCH 1/2] xen-netfront: Fix mismatched rtnl_unlock Ross Lagerwall
2018-06-21 13:00 ` [PATCH 2/2] xen-netfront: Update features after registering netdev Ross Lagerwall
@ 2018-06-21 22:56 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2018-06-21 22:56 UTC (permalink / raw)
To: ross.lagerwall; +Cc: netdev, boris.ostrovsky, jgross, xen-devel, linux-kernel
From: Ross Lagerwall <ross.lagerwall@citrix.com>
Date: Thu, 21 Jun 2018 14:00:19 +0100
> Fix a couple of issues with commit f599c64fdf7d ("xen-netfront: Fix race
> between device setup and open").
Series applied and queued up for -stable.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-06-21 22:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-21 13:00 [PATCH 0/2] xen-netfront: Fix issues with commit f599c64fdf7d Ross Lagerwall
2018-06-21 13:00 ` [PATCH 1/2] xen-netfront: Fix mismatched rtnl_unlock Ross Lagerwall
2018-06-21 13:05 ` Juergen Gross
2018-06-21 13:00 ` [PATCH 2/2] xen-netfront: Update features after registering netdev Ross Lagerwall
2018-06-21 13:12 ` Juergen Gross
2018-06-21 22:56 ` [PATCH 0/2] xen-netfront: Fix issues with commit f599c64fdf7d David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).