Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1934643ima; Thu, 25 Oct 2018 07:15:02 -0700 (PDT) X-Google-Smtp-Source: AJdET5cKMVUDYwrJd497X4DDKGsjefnsQbEVpI4OLlO9MzX9krgn51F4Cn5jyZVSsBKEqMi3yVgX X-Received: by 2002:a63:e442:: with SMTP id i2-v6mr1651627pgk.381.1540476902875; Thu, 25 Oct 2018 07:15:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540476902; cv=none; d=google.com; s=arc-20160816; b=EeQSaWJ+9OjgBkFiG/u4NBfiKR6bW9dwMkvCQGFADH1eBEYe0cKGcmgRFs4BAfS4kf dIJncz6ztSuLVxFu/KvnUlc2CdcXq9kGviCMP9fMlB+B3zulNhZuw9g3SOr8ywfMt4JS ry73PglMt+6eQdqG9LL3k8P7dnSyVFgF+4dXTHpwVn1zCA8iuRETccRXN0Q/tXgaAdTX QQxa6V4QTvWaaKIf6jQ3U8uVt3yX+fZjPAmvVpMTYJiCfmboBSyD3T3y9Kg517IGgsM1 4ndz6DOLAbriqiYPpJFwCbYiY59wPQ00o3fg4El14vT14C0ZCsrrLkhrRJA8T5wvPHMW pbtg== 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=1qypFcThZqkX6IwunWnc4/ksjthZFJo6eHASgf/jnyg=; b=XgR5dQOfSK6aYBfMJTJKEZ91pTB/2JGrHyTFzWD6uxvmz4CJon04wPfq87WrTGGalY 5ao9I6Od+nzUCeeHgt4rwDSflXjXQVIbqKOgV9efGf1E2HS42Lh6uFSia4qUiiJN+0xY uaKtGuoAGe67EholyBAiwkGqG6FX7m7mizOvRM4Sj7POLxkxqfAGBydFG2pe9QJrjtnA hgFImguJ9+e/AXL9kgSRbz/BUhbpeGWsgb8d49ttXl6UIB94J8ZBD7ZdAQW1M8kIT6GT Eu0hAD1Qx4ozLK2hu1JQneQWHAQbXeJsczV+Lg0PV7foRyMUl1V6TXDyzi2q8RGaUhdg YWig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Zm2uhnj2; 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 v124-v6si7846587pfv.1.2018.10.25.07.14.33; Thu, 25 Oct 2018 07:15:02 -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=Zm2uhnj2; 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 S1728245AbeJYWob (ORCPT + 99 others); Thu, 25 Oct 2018 18:44:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:53392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727531AbeJYWob (ORCPT ); Thu, 25 Oct 2018 18:44:31 -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 D9DD420868; Thu, 25 Oct 2018 14:11:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540476695; bh=0cxbgjxg22jFj49zjD77FNVZidUJ6PeA+VNHqT+fcOU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zm2uhnj2Rzv1oPIXmKBtHyfi3kVgyxGV83qXiMAl0nA0B5yGnCDs2frU12hVce3T4 DdtxuzPi/hOrXYI+Ljus2mFw192X7JnFdfy3paM9Q9dTJIZY/ScBR9Ylur0Yn4qoGb 5D12yZ35DqMHnzSwmtbwcgU7rrtwMB6WRhH7m2DA= 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.14 29/46] xen-netfront: Update features after registering netdev Date: Thu, 25 Oct 2018 10:10:36 -0400 Message-Id: <20181025141053.213330-29-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141053.213330-1-sashal@kernel.org> References: <20181025141053.213330-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 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