From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 087F52264B8; Tue, 26 Aug 2025 13:39:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756215580; cv=none; b=BDwsBhr8IgQWlyrKbrJXmaeIzIP3BNu2QrzxBE8xMgNhoBvyrndw4bkLnATWVHOypFkhTZvk6xhV4B6WltVJcZCwuqaHEVT5DwDeaKGPynxxtspPI0y3NSTpqP/94KRnE49E4ScMByo96y4mSbu7KJoyJcV+kfWS7bT8n+7CCt0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756215580; c=relaxed/simple; bh=Mn9WCSfdWsCOLSnMrvC0cLXcUIvTWwj3X+KE1jJdD5s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SOttOgJbXWkgFlWD10+c2hclArf7f+2duGE1fUxq4aw8caCUffjgRRD62r1IeoW+yoSE630scwNxlUj0fHFLlF3Iz5UNtHMTBk3A8tFF9Yw/RkYub8won8NXlUe5vel2DNR6BKxxjnehalztzayJvkgUzZL8LIbDkEbsAL37n14= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0srtNlRu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="0srtNlRu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8298FC113CF; Tue, 26 Aug 2025 13:39:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756215579; bh=Mn9WCSfdWsCOLSnMrvC0cLXcUIvTWwj3X+KE1jJdD5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0srtNlRukfPR6H1WQWvqdNaBPdMBxvrScByqSOB5vObi1xwvNhw1zx0HqiiI6fiMV g7iGCqys/N9h+4NzlBY+4b5OKdguniu756hkesbQpRdywXn5Hm1xmvGr1TQ6ezIZuy cjPxy846l6up5qiBVUDv7BirK4NnZgld08IkJiSA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jian Shen , Hao Lan , Jijie Shao , Simon Horman , Paolo Abeni , Sasha Levin Subject: [PATCH 5.15 087/644] net: hns3: fixed vf get max channels bug Date: Tue, 26 Aug 2025 13:02:58 +0200 Message-ID: <20250826110948.652990568@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110946.507083938@linuxfoundation.org> References: <20250826110946.507083938@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jian Shen [ Upstream commit b3e75c0bcc53f647311960bc1b0970b9b480ca5a ] Currently, the queried maximum of vf channels is the maximum of channels supported by each TC. However, the actual maximum of channels is the maximum of channels supported by the device. Fixes: 849e46077689 ("net: hns3: add ethtool_ops.get_channels support for VF") Signed-off-by: Jian Shen Signed-off-by: Hao Lan Signed-off-by: Jijie Shao Reviewed-by: Simon Horman Link: https://patch.msgid.link/20250722125423.1270673-4-shaojijie@huawei.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index 628d5c5ad75de..94e615177ff14 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -3571,11 +3571,7 @@ static void hclgevf_uninit_ae_dev(struct hnae3_ae_dev *ae_dev) static u32 hclgevf_get_max_channels(struct hclgevf_dev *hdev) { - struct hnae3_handle *nic = &hdev->nic; - struct hnae3_knic_private_info *kinfo = &nic->kinfo; - - return min_t(u32, hdev->rss_size_max, - hdev->num_tqps / kinfo->tc_info.num_tc); + return min(hdev->rss_size_max, hdev->num_tqps); } /** -- 2.39.5