Commit 91bc0d52 authored by Jian Shen's avatar Jian Shen Committed by David S. Miller

net: hns3: fix inconsistent vf id print

The vf id from ethtool is added 1 before configured to driver.
So it's necessary to minus 1 when printing it, in order to
keep consistent with user's configuration.

Fixes: dd74f815 ("net: hns3: Add support for rule add/delete for flow director")
Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
Signed-off-by: default avatarGuangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e184cec5
...@@ -6642,10 +6642,13 @@ static int hclge_fd_parse_ring_cookie(struct hclge_dev *hdev, u64 ring_cookie, ...@@ -6642,10 +6642,13 @@ static int hclge_fd_parse_ring_cookie(struct hclge_dev *hdev, u64 ring_cookie,
u8 vf = ethtool_get_flow_spec_ring_vf(ring_cookie); u8 vf = ethtool_get_flow_spec_ring_vf(ring_cookie);
u16 tqps; u16 tqps;
/* To keep consistent with user's configuration, minus 1 when
* printing 'vf', because vf id from ethtool is added 1 for vf.
*/
if (vf > hdev->num_req_vfs) { if (vf > hdev->num_req_vfs) {
dev_err(&hdev->pdev->dev, dev_err(&hdev->pdev->dev,
"Error: vf id (%u) > max vf num (%u)\n", "Error: vf id (%u) should be less than %u\n",
vf, hdev->num_req_vfs); vf - 1, hdev->num_req_vfs);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment