[PATCH 0/2] xen-netfront: Fix issues with commit f599c64fdf7d

STALE2973d

6 messages, 3 authors, 2018-06-21 · open the first message on its own page

[PATCH 0/2] xen-netfront: Fix issues with commit f599c64fdf7d

From: Ross Lagerwall <hidden>
Date: 2018-06-21 13:00:40

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

[PATCH 2/2] xen-netfront: Update features after registering netdev

From: Ross Lagerwall <hidden>
Date: 2018-06-21 13:00:43

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 <redacted>
Signed-off-by: Ross Lagerwall <redacted>
---
 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

[PATCH 1/2] xen-netfront: Fix mismatched rtnl_unlock

From: Ross Lagerwall <hidden>
Date: 2018-06-21 13:01:09

Fixes: f599c64fdf7d ("xen-netfront: Fix race between device setup and open")
Reported-by: Ben Hutchings <redacted>
Signed-off-by: Ross Lagerwall <redacted>
---
 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

Re: [PATCH 1/2] xen-netfront: Fix mismatched rtnl_unlock

From: Juergen Gross <jgross@suse.com>
Date: 2018-06-21 13:05:44

On 21/06/18 15:00, Ross Lagerwall wrote:
Fixes: f599c64fdf7d ("xen-netfront: Fix race between device setup and open")
Reported-by: Ben Hutchings <redacted>
Signed-off-by: Ross Lagerwall <redacted>
Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

Re: [PATCH 2/2] xen-netfront: Update features after registering netdev

From: Juergen Gross <jgross@suse.com>
Date: 2018-06-21 13:12:44

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 <redacted>
Signed-off-by: Ross Lagerwall <redacted>
Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

Re: [PATCH 0/2] xen-netfront: Fix issues with commit f599c64fdf7d

From: David Miller <davem@davemloft.net>
Date: 2018-06-21 22:56:44

From: Ross Lagerwall <redacted>
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help