Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2014063imm; Thu, 21 Jun 2018 06:01:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLfpj3bckq29RzZjG09AS+5QAE8AMZK0iQoOPas+8kgHwSn5o9G7g/Uz40st6HWlqBfMGcz X-Received: by 2002:a63:370f:: with SMTP id e15-v6mr22200896pga.192.1529586104764; Thu, 21 Jun 2018 06:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529586104; cv=none; d=google.com; s=arc-20160816; b=DiK5f/7uTbn/7VPC1018d3pZObaPajFikKtdgMJUKau4YwCnRZha+qZugLGse6L5wq w0snnRMcP4P2L3azN1iD01TVqhHWIF2DL4qnvp92wktcjXU9Tj1R8X//8Irj/JBDCSSc ttPfRH13PiYMfhH3f21Q+OfufrlxoLKHQAectXwi2HTDevg8kapvoBOnOekRqhPXs3Nx mGE7D3I3BW2O2U4OXicFO4aIOJrdodfClpjeg8C0lPwFoGX5Y2nbHqtZllWiomG2UM4s UZDYk2iMSr1Zqw3NkRoz7VZ1oAuifxthdqAlrK0M+n7dyXTUt7AbifJCJhEv3RGGpyKa q5qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=w07RVA15fuz+fCY+XLZYGhbKL1rzzl2YOYdAlkDDBP8=; b=yo4wZy3GMU8IpfzRImTPHrMv6Gtf6fRgve26kiQ6HWF617KwfSDzQFQ0jIkZTMx8Sq LamT3+aLimaV+yR+IBfo8vE8fqKK33TUiVDxdXZrexW1RuD5XrYtu9rFpgf6SKmouYG4 Fm9PUjQd6sSr54VFuPJUotB0NW7uU5ksU3XSyGrgEnv+Tos6MX/2HT/wNtR5hImTAfMT 4DFCBw+JiVJb6ly4H4065NhYvozVaI0kXLJ7MIvkUvcI2bf91kGgIoT6ugoAo2F8YoG4 w9dShk08eXdI/osS3nPBFa/hmAfDhI9udnTWkPCaEUSfeA7t9aiaynujcpTcH35E34Gg cZHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc12-v6si4680819plb.373.2018.06.21.06.01.28; Thu, 21 Jun 2018 06:01:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933331AbeFUNAk (ORCPT + 99 others); Thu, 21 Jun 2018 09:00:40 -0400 Received: from smtp03.citrix.com ([162.221.156.55]:63762 "EHLO SMTP03.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933221AbeFUNAg (ORCPT ); Thu, 21 Jun 2018 09:00:36 -0400 X-IronPort-AV: E=Sophos;i="5.51,251,1526342400"; d="scan'208";a="58220315" From: Ross Lagerwall To: CC: Ross Lagerwall , Boris Ostrovsky , Juergen Gross , "David S. Miller" , , , Liam Shepherd Subject: [PATCH 2/2] xen-netfront: Update features after registering netdev Date: Thu, 21 Jun 2018 14:00:21 +0100 Message-ID: <20180621130021.27029-3-ross.lagerwall@citrix.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180621130021.27029-1-ross.lagerwall@citrix.com> References: <20180621130021.27029-1-ross.lagerwall@citrix.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Ross Lagerwall --- 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