Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3335297imu; Sun, 11 Nov 2018 12:38:01 -0800 (PST) X-Google-Smtp-Source: AJdET5ed7PaZ8clFp6ltfFUMMRgji90bJgroRypmqRq/qNVryRkmghvuUQJ4HO86zY/96DqDlyGg X-Received: by 2002:a62:4b4b:: with SMTP id y72-v6mr14551719pfa.67.1541968681755; Sun, 11 Nov 2018 12:38:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541968681; cv=none; d=google.com; s=arc-20160816; b=mgeasMevj/lsZ3esAOGAuI2HMMZobG2FJBC4K8qXutT9AwJ2kCj1E/8SEaGqxzBmZY 4GXj8Kvos5W/J4lNWoQ7jRAvgKvVa3LpmjaaJ6FpMhJAQOv9Zuh8uSdbeDyMQO1W7EFb yPXgZ5vqrnFR7Ib8PxGsq2ZqtYc3YM3xSR6OFo9yUyLsaTwz9riw2v+K/sRwx+g190a4 ONkI7qYQsb+oYb0cUuwcTcd0FMLLKKJrfWGog5AaQR9A8mCHWd5GoPgN0WYnchdppTMv CGAKxFAQCIN31Wq5KlOoBLrV1JXFeKEWnK+QGA1aEZJncub9ToD57pAAQkI/t5j11uQu HxXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=YkHzUFXMOmTK5RtOHL8Mpc4hG3TY1iSIS0I99Xm69zM=; b=m5PjsvZ46jjRaoCiGJqY3fcjoE3mYXz5IYwBN5qSoALXJbsdxqVdnVzFXuYwZxm/Op m7hhoudCIJ1nqw75n760c6ISCSsN+LuSzSi3W/3UERH0rga5BCuMUkK+Vsy1SaA9pVNT s8+jaX+oDTDPUCc3g9Hf+iuXWVmkmd40UC1OZcTjE5dsvqO0LuICYf6ZUVzAwJZIlYtD ws4xa0krMd44K8T8gHQQ1cdlYjytOPXUPa1e5rmrJzkvPsDXEIVgyXY4YKJmL1XVopL1 3oSK0Ak6IQ9K5AXX1dJoR03RNGNJGuYpfm7+GjjRUoTlnaN8bWrdR7+2hA9NrORJekfH iWWw== 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 r14si4453167pgh.39.2018.11.11.12.37.47; Sun, 11 Nov 2018 12:38:01 -0800 (PST) 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 S1730430AbeKLG0l (ORCPT + 99 others); Mon, 12 Nov 2018 01:26:41 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:49732 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730072AbeKLFsK (ORCPT ); Mon, 12 Nov 2018 00:48:10 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsW-0000l7-CV; Sun, 11 Nov 2018 19:58:40 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsT-0001bc-Ck; Sun, 11 Nov 2018 19:58:37 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Juergen Gross" , "David S. Miller" , "Ross Lagerwall" , "Liam Shepherd" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 174/366] xen-netfront: Update features after registering netdev In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Ross Lagerwall commit 45c8184c1bed1ca8a7f02918552063a00b909bf5 upstream. 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: Ben Hutchings --- drivers/net/xen-netfront.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -2001,10 +2001,6 @@ static int xennet_connect(struct net_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) { @@ -2014,6 +2010,10 @@ static int xennet_connect(struct net_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