提交 37478aa8 编写于 作者: G Grzegorz Szczurek 提交者: Zheng Zengkai

iavf: Fix for setting queues to 0

stable inclusion
form stable-v5.10.82
commit a61f90b2162d0378db55f2234cb53c1af4bcb7f0
bugzilla: 185877 https://gitee.com/openeuler/kernel/issues/I4QU6V

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

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

[ Upstream commit 9a6e9e48 ]

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: 5520deb1 ("iavf: Enable support for up to 16 queues")
Signed-off-by: NGrzegorz Szczurek <grzegorzx.szczurek@intel.com>
Tested-by: NTony Brelinski <tony.brelinski@intel.com>
Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 9d023fcc
...@@ -919,7 +919,7 @@ static int iavf_set_channels(struct net_device *netdev, ...@@ -919,7 +919,7 @@ static int iavf_set_channels(struct net_device *netdev,
/* All of these should have already been checked by ethtool before this /* All of these should have already been checked by ethtool before this
* even gets to us, but just to be sure. * 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; return -EINVAL;
if (num_req == adapter->num_active_queues) if (num_req == adapter->num_active_queues)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册