Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1965178ima; Thu, 25 Oct 2018 07:40:27 -0700 (PDT) X-Google-Smtp-Source: AJdET5cWTEMnos2JsXvirv623CXy16irwiqedELUyFKOb8bVNxCzEss2WqjQbY47lBdN6c6a+u8B X-Received: by 2002:a63:c341:: with SMTP id e1-v6mr1735545pgd.452.1540478427832; Thu, 25 Oct 2018 07:40:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540478427; cv=none; d=google.com; s=arc-20160816; b=XXuUZkfiaf364YsGCVhbO2889XutsfORatYXnGXFi0m++FsAb5u+DvyMsN42RLt7Cd Tu2ov1djuOvaobr961IWcYX+cYD98VGFRmVv8oJsTsSDoIpLo2jj/jMm+VYYmo4tHgYx UJ5jIqti0SKb5LUFYr0cSurbXQuboUs8oeed6cAtWrc6BAGEvC/4RPUavcxx4t0vdVde aYblot8vxSaiXiAbFRXjBExAdKO+F9BGc5ZbAorpgKkoONDOZiA/X764IM4vGEwNpcov mq1CAfv3lRzLCYvKXPpiBk4jW/hkHmaKgjRteoDkBbb1eoxsNcTHKd0YwW3H8et8dtp7 0Fpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=7wZbqQYme69OsBQTCTc6V8NMncyVo0doFHD0qIcTa0Y=; b=OtmgoeCiBx6NuAWWTai/z7ATUx62p5rxmFwElG90XkzQtOGzmwW3ZJdsZ3+LrMUCie /XXEew0GVnDcqDnqz2bL2mcs5t2YvgfieJKKb+wRWE70m5j8ScYT7u5rs9g4IwVG9Kir LXeV4zec3aITtTpkxXekPeZ0U724o0qGCK0FuvNvw6w94vptRHldPKQe682IbIjHhFoD 0q1pjf4EqoD0e0PFK0m9/Mdk2Vz0cKYnPG4YvbFQbhV9mHuhcaXvj2OaVqcMCw83GxhC Lfnc/GZhCa1iYp6Q99HxWD6MMAe2jTVdUvOrqx8B16UOu91UWtcsvk55ryM4P//NvO8t 3Pew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QiGgq40k; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w64-v6si8317972pfb.247.2018.10.25.07.40.11; Thu, 25 Oct 2018 07:40:27 -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; dkim=pass header.i=@kernel.org header.s=default header.b=QiGgq40k; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727770AbeJYXKU (ORCPT + 99 others); Thu, 25 Oct 2018 19:10:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:58596 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728121AbeJYWt1 (ORCPT ); Thu, 25 Oct 2018 18:49:27 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 591B620848; Thu, 25 Oct 2018 14:16:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540476990; bh=r32V81HF3ZnRXsXtWiKa6cyCSeThcJd7sXm1y5XuwGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QiGgq40kOuaJwaohy5tpdS3S4Fe2LgiNehlFIqcA9FYw4LboZvDhhuZsQ3HgvdC7x qmmUF9PvtNfR9antlGZIgyFTFOsQtWnnpEeDRUKgumb3/QLc8Kjvz/87w0TSLIaqRt zFr6mEASJ0eo2jsLvPu1K34MFgqRrq4eJ1wwbtw4= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ross Lagerwall , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.9 86/98] xen-netfront: Update features after registering netdev Date: Thu, 25 Oct 2018 10:14:11 -0400 Message-Id: <20181025141423.213774-86-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141423.213774-1-sashal@kernel.org> References: <20181025141423.213774-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ross Lagerwall [ Upstream commit 45c8184c1bed1ca8a7f02918552063a00b909bf5 ] 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 Reviewed-by: Juergen Gross Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 3c1adb38412b..c85edd161a6c 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -1994,10 +1994,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) { @@ -2007,6 +2003,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.17.1