提交 3c4100ba 编写于 作者: G Grzegorz Szczurek 提交者: Zheng Zengkai

i40e: Fix calculating the number of queue pairs

stable inclusion
from stable-v5.10.124
commit 43dfd1169cc07128c2dc3fecd89fc2f34bf35b15
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6E7

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=43dfd1169cc07128c2dc3fecd89fc2f34bf35b15

--------------------------------

[ Upstream commit 0bb05067 ]

If ADQ is enabled for a VF, then actual number of queue pair
is a number of currently available traffic classes for this VF.

Without this change the configuration of the Rx/Tx queues
fails with error.

Fixes: d29e0d23 ("i40e: missing input validation on VF message handling by the PF")
Signed-off-by: NGrzegorz Szczurek <grzegorzx.szczurek@intel.com>
Signed-off-by: NJedrzej Jagielski <jedrzej.jagielski@intel.com>
Tested-by: NBharathi Sreenivas <bharathi.sreenivas@intel.com>
Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 0466adc9
...@@ -2228,7 +2228,7 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg) ...@@ -2228,7 +2228,7 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg)
} }
if (vf->adq_enabled) { if (vf->adq_enabled) {
for (i = 0; i < I40E_MAX_VF_VSI; i++) for (i = 0; i < vf->num_tc; i++)
num_qps_all += vf->ch[i].num_qps; num_qps_all += vf->ch[i].num_qps;
if (num_qps_all != qci->num_queue_pairs) { if (num_qps_all != qci->num_queue_pairs) {
aq_ret = I40E_ERR_PARAM; aq_ret = I40E_ERR_PARAM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册