Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2464557imd; Fri, 2 Nov 2018 11:52:32 -0700 (PDT) X-Google-Smtp-Source: AJdET5f4JF+6lRFlf8OzzlKbztiqLUxIRv5Er/7dTUIoULBTfJaJ6F+l/mboUEn/Q0eeks5LXvL0 X-Received: by 2002:a62:9702:: with SMTP id n2-v6mr12769373pfe.222.1541184752165; Fri, 02 Nov 2018 11:52:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184752; cv=none; d=google.com; s=arc-20160816; b=mRYoW66k8Ec06FQEZX30evo/jKJ5RrSknTQ96rxk3umEGPSBJUOhAPzBj0g/edN3oH 2mu7GiyBFh1DxOxqDdnwYWGCkU5bpc8Fp/3BRbGF/goODGW9Q56XUXrScuV6cgrym6oi GbhJF8MUQ1m35aJ/vkT2CNcsVNjCV95hjwW4nF5UsyW3Q40XiYu3cUsj9+eSjn87aV5t zTbOb/Hh1zC54hKwV3L85Paix21xjcmQhpzP/jXlE9qBlNLmQZN+mUeUqK3ElMaIHtRb v6+jvfJR54MnuckKXCMa7tsBEIR2+8H9J040trGZ6u8WTimpA5eEujisP+06F3wBi4Pr tPMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3jWvg7rlP0W244jqqSlCd6CcFhe1GnUEYC5QozkCeBM=; b=0OlFhp7YmtPDCYSAjd0D2NIehA9SlgyWOAcjL5UXsDmIeM24bNNWaC90zoiCSHKGMF yRkMYEyxw9IFEUSuZXskGXNA4qfLlpM7uwFC1flwItc+S1etuFVRxjoK7euF39L5FNoA 2cW3G+zcGcxUnZgnGxbFUy7ZKXGctb0mbmKFtbnSWvfXyB7v5U440BFUF1J1/+qB0IwV rz0E5HS+MDR5R+xO6Gt6DvIPe2GjbW/v/dxZsp3hrE+V9vpJUtyS4u9YIEE8ctl3Y9ik sZBkkoFo8Ut/XNWFLykKaI+752YvpxJ7PZKe3o1WuHixIR5rkDPkCrV08nY5x0y2VVPg ztJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PSG88Kje; 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 88-v6si14287398plb.57.2018.11.02.11.52.17; Fri, 02 Nov 2018 11:52:32 -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=PSG88Kje; 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 S1726780AbeKCEAL (ORCPT + 99 others); Sat, 3 Nov 2018 00:00:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:55938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbeKCEAK (ORCPT ); Sat, 3 Nov 2018 00:00:10 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 491B620848; Fri, 2 Nov 2018 18:51:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184716; bh=MN3rKJNnCgjyqj5ycGkjWHstkaKpnzVt6rYVZh5Bzh4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PSG88KjekPAMqrgcvMKG0/Ee0906hWBqBQqkiF9yXBjh3487dyB1Lgkwe1doprF1M b3ihn/GgsL+x2gUMGe9y7+Q26KCuj7FscK970TRwjkd7b2w4fT2zxi5URsgD+b9Tep JT1FY3bkU96fOuSsHVM6TeXioK7vU/FkE4/tbebM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liam Shepherd , Ross Lagerwall , Juergen Gross , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 078/143] xen-netfront: Update features after registering netdev Date: Fri, 2 Nov 2018 19:34:23 +0100 Message-Id: <20181102182903.759323328@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182857.064326086@linuxfoundation.org> References: <20181102182857.064326086@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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 1a40fc3517a8..ca239912c0e6 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c @@ -1964,10 +1964,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) { @@ -1977,6 +1973,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