Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5656910img; Wed, 27 Mar 2019 12:34:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQbgWJSZ3q0UWbqpjO7jm7XpK8sOxOs0iXD/6VTbn5Bvv1tBy2Grhee1+guRAjvAtBM1uh X-Received: by 2002:a62:1197:: with SMTP id 23mr36826625pfr.210.1553715286637; Wed, 27 Mar 2019 12:34:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553715286; cv=none; d=google.com; s=arc-20160816; b=jLyGMDB/2h9/E89djo0A9XJDuK826GjwiJfuNMUCLS6xlECn5w3UYXV0ilDb7U+4YV LpXhuslSqS+DYAt59nyOyJEPJjb0C78AGql6EZw8cj8IUVfi6p94Okg6j15h9PF7RiSR 82pO9j6HnHANBiKmQ3+iKIPZY1k2F7DZ5Zq2msoIFceyShyFvz729W22pQgr72tMnuwt HeHdKBxMWB4I+8/MQwijDO/E09Yj+KmhpDxPVneKi0OQMkBiwsn5GvxVnFEOOfRrGSn9 Smvf2RjzEE25BNBRCs6WUjoRcoJTQv+CvLpqlXDqPVN7qX2FhzLN+/bF7I/yvuaNWogq bEAw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=E8vkCbIbHRo5z5CKDTURrzio7VzqqOrNMH4ArAA60Vg=; b=aSNJ55UafuW6CChe+r2G8QS6cRiZUaDyBUhC0pOr45csngyE2QzgkwMJLzexFMUnqU zenpRXXbKEb6Q5xkLjuTsKRBHYwmCNJhrxzYyMTRylrAH3RUoLvUKj/40LzrSLUOlD8F QgIqfa61PVoi5XwPcMkb33qgNwzynKDgE53hnWpuInYc2cG+G3c4rPt8opsFZVMIV4GM i4UW03LMAILpJWsHo9UeMyNyk3nl3wmi/SUlk1MkYEQQY4foUYH8dz/Bidf3Bb117FtL ZqsiIT2/XLEA+ixHQblf9SqWqJgDcz5m25wDoUMArD/2tNLkW2iioTHTU9d1TAEjr4Om 0lkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YSmiaLcT; 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 1si21095024plw.390.2019.03.27.12.34.31; Wed, 27 Mar 2019 12:34:46 -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=YSmiaLcT; 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 S1732628AbfC0Td5 (ORCPT + 99 others); Wed, 27 Mar 2019 15:33:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:42118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729816AbfC0SCR (ORCPT ); Wed, 27 Mar 2019 14:02:17 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (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 DCA5F21734; Wed, 27 Mar 2019 18:02:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553709736; bh=fTJ5sigosUFcvXFovi0MUeq7sBYVYoNRN8gRAjPn7kU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YSmiaLcTb2L6kbyRKtV/KUOIEu/HRM+SC+c13XQcZHKbBklk36R3IIYrwWe0yNE9B ubwAtucadd+ioz3TpUjcBxzTwhDcW5CxDQwtikpYF52oOBIcAt/x8HBu8HA2BTtAok e/tqXpffdBfzK12ZDHRMbq96A8Y/uOmqu9Bn5wdE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tariq Toukan , Saeed Mahameed , Sasha Levin , netdev@vger.kernel.org, linux-rdma@vger.kernel.org Subject: [PATCH AUTOSEL 5.0 012/262] net/mlx5e: Fix access to non-existing receive queue Date: Wed, 27 Mar 2019 13:57:47 -0400 Message-Id: <20190327180158.10245-12-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tariq Toukan [ Upstream commit c475e11e82d16133304321bae285c5c1d4cfc856 ] In case number of channels is changed while interface is down, RSS indirection table is mistakenly not modified accordingly, causing access to out-of-range non-existing object. Fix by updating the RSS indireciton table also in the early return flow of interface down. Fixes: fb35c534b788 ("net/mlx5e: Fix NULL pointer derefernce in set channels error flow") Fixes: bbeb53b8b2c9 ("net/mlx5e: Move RSS params to a dedicated struct") Reported-by: Or Gerlitz Tested-by: Maria Pasechnik Signed-off-by: Tariq Toukan Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c index 47233b9a4f81..e6099f51d25f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c @@ -357,6 +357,9 @@ int mlx5e_ethtool_set_channels(struct mlx5e_priv *priv, if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) { priv->channels.params = new_channels.params; + if (!netif_is_rxfh_configured(priv->netdev)) + mlx5e_build_default_indir_rqt(priv->rss_params.indirection_rqt, + MLX5E_INDIR_RQT_SIZE, count); goto out; } -- 2.19.1