]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: hns3: using the num_tqps to check whether tqp_index is out of range when vf...
authorJian Shen <shenjian15@huawei.com>
Thu, 11 Dec 2025 02:37:36 +0000 (10:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:09:45 +0000 (13:09 +0100)
commitc9bbeca124e9149edcccc2081d67e7f53ce807dc
tree7f4ea55b796ff64c70f886c2b7a304df6c030067
parentde631a0f98725b1e18cc9b25d07988b0707e0c10
net: hns3: using the num_tqps to check whether tqp_index is out of range when vf get ring info from mbx

[ Upstream commit d180c11aa8a6fa735f9ac2c72c61364a9afc2ba7 ]

Currently, rss_size = num_tqps / tc_num. If tc_num is 1, then num_tqps
equals rss_size. However, if the tc_num is greater than 1, then rss_size
will be less than num_tqps, causing the tqp_index check for subsequent TCs
using rss_size to always fail.

This patch uses the num_tqps to check whether tqp_index is out of range,
instead of rss_size.

Fixes: 326334aad024 ("net: hns3: add a check for tqp_index in hclge_get_ring_chain_from_mbx()")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20251211023737.2327018-3-shaojijie@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c