Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13475537ybl; Sun, 29 Dec 2019 12:48:48 -0800 (PST) X-Google-Smtp-Source: APXvYqy+TjjlWLX2lLByPJvt23hmvvwp5fr9WnNbHd+4sKYnBWyMYP9BivDl7J2R9mevRMwPEhDr X-Received: by 2002:a9d:3bc4:: with SMTP id k62mr61378455otc.186.1577652528089; Sun, 29 Dec 2019 12:48:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577652528; cv=none; d=google.com; s=arc-20160816; b=e4q+AVDovfo+EUTBpWtqooE4fMvvyVqwB2GXaMvGD7xdBX9ODPXuWPhFKdbKEqWxKg ZMJl7YiHbBwvNw1hYJUSJNhjaN6lYbh9XClOAEOIWYX/yNkRzcDhiS4U7GkrVQUS3cg4 +ZO+T+yFOu2GovX++RdlIkPs8B8vE4UzU3YRD3d99XZ5BHlFpnftXN4kZsaSTT4UwkLl SlBny+a47f8O8bIhql4frzGgM50deDn8DGZmDTvT4lZYAvdk34OVIfuuW2bzmHq5TV2R kGQm1E/SO8HmgTNxtJIKcl7/wVyWrbXGF5yFRGCd3j400jvBKWfFMJWLqX4aV1DG2dEZ IuBw== 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=CZgNyZdXZgg0srab+FmODLQjnNOxYORfrC3PDMfbWBQ=; b=xbyr8apSp2zG5GlpFhf/Obw6LCh08UWjRpPxU9m3IdxLv0QmHW/1lNS4bzVB6Wle82 KQvwYEgbqNlaEDBaSGnLqTnqwkdgylTbL5oL14F0GfPqIQp6jYMnMxZS4qJyr1LCOqsl S1FFVkRD7iRmzJBXTlYH3iCVaHb14Qv4cTytNJP/uR9qaYI34n1hKYjbvl3abTtdYzhm 509MYdx3YJoFtusk1s2taNLdlsLw8+V44zT6QOS547XX4zBV9CGzfawbW1V1n3hLNP3w +u+HAG+sEnVvkTStQtuZYGrLyjktyPwloLOlFRAuwPLmGaYSkSl5bHE+ABYkvp520WS5 OyQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LAEtH8dB; 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 x16si22558625otp.184.2019.12.29.12.48.37; Sun, 29 Dec 2019 12:48:48 -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; dkim=pass header.i=@kernel.org header.s=default header.b=LAEtH8dB; 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 S1732907AbfL2RzZ (ORCPT + 99 others); Sun, 29 Dec 2019 12:55:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:43992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732895AbfL2RzX (ORCPT ); Sun, 29 Dec 2019 12:55:23 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 1C815206A4; Sun, 29 Dec 2019 17:55:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577642122; bh=kQCJ1CGG0XjTRC2oSuq4B1B38huGDZTAd4kGmk8mnCo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LAEtH8dBqMATXNVTqB5uQq/gCp2lZmayjP5MI6StovNBUBrJd7PybAwXIFtBrcVNG o7ZHGTXlNnnxeqsfpP2I4qopXb8mF0OYqH5uWuDg+yRWg/Jk0ADcxaupbn9/t/pxMg B69W1ktFOkyEvisMumvU2y6LatYCqhlWjDy3j3fw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Brett Creeley , Andrew Bowers , Jeff Kirsher , Sasha Levin Subject: [PATCH 5.4 351/434] ice: Fix setting coalesce to handle DCB configuration Date: Sun, 29 Dec 2019 18:26:44 +0100 Message-Id: <20191229172725.286507970@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Brett Creeley [ Upstream commit e25f9152bc07de534b2b590ce6c052ea25dd8900 ] Currently there can be a case where a DCB map is applied and there are more interrupt vectors (vsi->num_q_vectors) than Rx queues (vsi->num_rxq) and Tx queues (vsi->num_txq). If we try to set coalesce settings in this case it will report a false failure. Fix this by checking if vector index is valid with respect to the number of Tx and Rx queues configured. Signed-off-by: Brett Creeley Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_ethtool.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c index 7e23034df955..1fe9f6050635 100644 --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c @@ -3368,10 +3368,17 @@ __ice_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec, struct ice_vsi *vsi = np->vsi; if (q_num < 0) { - int i; + int v_idx; + + ice_for_each_q_vector(vsi, v_idx) { + /* In some cases if DCB is configured the num_[rx|tx]q + * can be less than vsi->num_q_vectors. This check + * accounts for that so we don't report a false failure + */ + if (v_idx >= vsi->num_rxq && v_idx >= vsi->num_txq) + goto set_complete; - ice_for_each_q_vector(vsi, i) { - if (ice_set_q_coalesce(vsi, ec, i)) + if (ice_set_q_coalesce(vsi, ec, v_idx)) return -EINVAL; } goto set_complete; -- 2.20.1