Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 174D0C433FE for ; Wed, 24 Nov 2021 13:34:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352738AbhKXNhm (ORCPT ); Wed, 24 Nov 2021 08:37:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:43334 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352301AbhKXNfh (ORCPT ); Wed, 24 Nov 2021 08:35:37 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0F76061C11; Wed, 24 Nov 2021 12:54:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637758487; bh=BKKNssPgceiAwUeUN0eDDKXoM9SXXQBk6b/fkVXOKZc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AIymtHusu9esApgT+LhkJRfujjqCmugpmxADePPwKinGiFaIu4dT/hxdMriou1LaB ET1hiSWsEImp1lcepwMcIHQfutpfTS1GqYa3986SIU5aqo2a1CWd6UXw4U3uFFshB/ pDwwZjjfhzJ0gLGyFt8dyczNtzYYqvwZSGWJZdnU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Grzegorz Szczurek , Tony Brelinski , Tony Nguyen , Sasha Levin Subject: [PATCH 5.10 087/154] iavf: Fix for setting queues to 0 Date: Wed, 24 Nov 2021 12:58:03 +0100 Message-Id: <20211124115705.125791928@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115702.361983534@linuxfoundation.org> References: <20211124115702.361983534@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: Grzegorz Szczurek [ Upstream commit 9a6e9e483a9684a34573fd9f9e30ecfb047cb8cb ] Now setting combine to 0 will be rejected with the appropriate error code. This has been implemented by adding a condition that checks the value of combine equal to zero. Without this patch, when the user requested it, no error was returned and combine was set to the default value for VF. Fixes: 5520deb15326 ("iavf: Enable support for up to 16 queues") Signed-off-by: Grzegorz Szczurek Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c index 5508ccbf9f57b..ea85b06857fa2 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c +++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c @@ -903,7 +903,7 @@ static int iavf_set_channels(struct net_device *netdev, /* All of these should have already been checked by ethtool before this * even gets to us, but just to be sure. */ - if (num_req > adapter->vsi_res->num_queue_pairs) + if (num_req == 0 || num_req > adapter->vsi_res->num_queue_pairs) return -EINVAL; if (num_req == adapter->num_active_queues) -- 2.33.0