Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp648857pxb; Tue, 2 Feb 2021 14:19:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrkhbu1x2fbJZUzDKcbQWozp8kScyJHgjYDphsE788pFCf2LvLS+Q2kJckLCemdCq2AD0P X-Received: by 2002:a17:906:e43:: with SMTP id q3mr115004eji.493.1612304354269; Tue, 02 Feb 2021 14:19:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612304354; cv=none; d=google.com; s=arc-20160816; b=UicUm9fjPxuQr/XVqIdgO/XGzu1km1JXsYdwhDnef5xO1CpHWvUmIjgoRB4GSMC2rx EDtrHP+LewG/7+ti6CEQXau3rNv35/kByjygRvQi4oMrjE8X7pwSPCtVUX51gPj9m5Nj Kg6xjFXnucLHMDA0TpeN4GIBZNjmiww9MhDrcALMtfVEo61PD8e7nF1iEsqCt4LaOGpe j4vloKlDeNu3G7Y1J3rHFQJvdWrcNz/yuOCpBth9jUOCPSmFcBrGH0sjpbRgDFs8U7LM Zgj/PGPBfSuhOYPmhsamVPHFCPCpdL99YM7sNK4KdbwF6B6oRzLcko9roeIMiZPUXKhc bhnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ivYM2kOeKepcJQFsQtrs2gPk8OwwNkQZpE/WG4AtkLs=; b=1HMGUccKjLUe4an1YYXPLHzwKjULTQ9NB2KYA00eICE3k/vLbO9hmzXzCIM8M0gCwk JluaIp0LV+DzCNGb6LkFHOGW8Lu27Ir4oUL06IO3/LvVGr3iS3l9ZvGFUfzJ8LRqhluU vInoOtmHfqx1geEvawvwhy+rWN8DZy9zf4BQDtzi/TXf7G7IN0i/HZ3ORl8bmAjlauS/ l5KtXGccBx9sGfJpb6boptoqna05rqD27u/QoM8QueYJK3WQjL7F11Kxv9lYTnBIvnyg qI5DERsR/4TTIZR2pOMwB2rubKU+lKMFYtas36z8pvBboK9JuZjwLSXkev0vIC37EI+u qegA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wCQzdsz3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o11si86586ejn.707.2021.02.02.14.18.46; Tue, 02 Feb 2021 14:19:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wCQzdsz3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233644AbhBBOCC (ORCPT + 99 others); Tue, 2 Feb 2021 09:02:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:42464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233315AbhBBNy0 (ORCPT ); Tue, 2 Feb 2021 08:54:26 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 012F864FD5; Tue, 2 Feb 2021 13:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612273474; bh=98rbjxgAR5G3OpCfYFTSl96R6LSqbUY+msmbIe8BH6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wCQzdsz34qY0r3dSzvwNJbOvygvrvl0ffabbQ3TCQ8t4peA4xvNy5evhxMOxj6jiB jzovxxa8QBCpEve6QeZBJI760DXRL2f7ptCr2i7bQAGrzIlguAuxkJWYoL6u35qlb6 f1UA1fZhlqkghWaz4FKvP+F4DRsZi2IheHPhXIL8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxim Mikityanskiy , Tariq Toukan , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.10 121/142] net/mlx5e: Correctly handle changing the number of queues when the interface is down Date: Tue, 2 Feb 2021 14:38:04 +0100 Message-Id: <20210202133002.701434154@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210202132957.692094111@linuxfoundation.org> References: <20210202132957.692094111@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maxim Mikityanskiy [ Upstream commit 57ac4a31c48377a3e675b2a731ceacbefefcd34d ] This commit addresses two issues related to changing the number of queues when the channels are closed: 1. Missing call to mlx5e_num_channels_changed to update real_num_tx_queues when the number of TCs is changed. 2. When mlx5e_num_channels_changed returns an error, the channel parameters must be reverted. Two Fixes: tags correspond to the first commits where these two issues were introduced. Fixes: 3909a12e7913 ("net/mlx5e: Fix configuration of XPS cpumasks and netdev queues in corner cases") Fixes: fa3748775b92 ("net/mlx5e: Handle errors from netif_set_real_num_{tx,rx}_queues") Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 8 +++++++- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c index f01395a9fd8df..e596f050c4316 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c @@ -444,12 +444,18 @@ int mlx5e_ethtool_set_channels(struct mlx5e_priv *priv, goto out; } - new_channels.params = priv->channels.params; + new_channels.params = *cur_params; new_channels.params.num_channels = count; if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) { + struct mlx5e_params old_params; + + old_params = *cur_params; *cur_params = new_channels.params; err = mlx5e_num_channels_changed(priv); + if (err) + *cur_params = old_params; + goto out; } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index ba6c75618a710..000dacaa3333c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -3580,7 +3580,14 @@ static int mlx5e_setup_tc_mqprio(struct mlx5e_priv *priv, new_channels.params.num_tc = tc ? tc : 1; if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) { + struct mlx5e_params old_params; + + old_params = priv->channels.params; priv->channels.params = new_channels.params; + err = mlx5e_num_channels_changed(priv); + if (err) + priv->channels.params = old_params; + goto out; } -- 2.27.0