public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Ross Lagerwall <ross.lagerwall@citrix.com>
To: <netdev@vger.kernel.org>
Cc: Ross Lagerwall <ross.lagerwall@citrix.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Juergen Gross <jgross@suse.com>,
	"David S. Miller" <davem@davemloft.net>,
	<xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>,
	Liam Shepherd <liam@dancer.es>
Subject: [PATCH 2/2] xen-netfront: Update features after registering netdev
Date: Thu, 21 Jun 2018 14:00:21 +0100	[thread overview]
Message-ID: <20180621130021.27029-3-ross.lagerwall@citrix.com> (raw)
In-Reply-To: <20180621130021.27029-1-ross.lagerwall@citrix.com>

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

  parent reply	other threads:[~2018-06-21 13:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Ross Lagerwall [this message]
2018-06-21 13:12   ` [PATCH 2/2] xen-netfront: Update features after registering netdev Juergen Gross
2018-06-21 22:56 ` [PATCH 0/2] xen-netfront: Fix issues with commit f599c64fdf7d David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180621130021.27029-3-ross.lagerwall@citrix.com \
    --to=ross.lagerwall@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=davem@davemloft.net \
    --cc=jgross@suse.com \
    --cc=liam@dancer.es \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox