提交 433c08ac 编写于 作者: Y Yufeng Mo 提交者: Xie XiuQi

net: hns3: modify the err log when setting invalid vf id

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

This patch optimizes error log when entering invalid vfid to make
it more reasonable.

Fixes: 61bc2779e10b ("net: hns3: change the range of vf id set by ip link set")

Feature or Bugfix:Bugfix
Signed-off-by: NYufeng Mo <moyufeng@huawei.com>
Reviewed-by: Nlipeng <lipeng321@huawei.com>
Reviewed-by: NYunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 33ada986
...@@ -2885,10 +2885,16 @@ static int hclge_get_status(struct hnae3_handle *handle) ...@@ -2885,10 +2885,16 @@ static int hclge_get_status(struct hnae3_handle *handle)
static struct hclge_vport *hclge_get_vf_vport(struct hclge_dev *hdev, int vf) static struct hclge_vport *hclge_get_vf_vport(struct hclge_dev *hdev, int vf)
{ {
if (pci_num_vf(hdev->pdev) == 0) {
dev_err(&hdev->pdev->dev,
"SRIOV is disabled, can not get vport(%d) info.\n", vf);
return NULL;
}
if (vf < 0 || vf >= pci_num_vf(hdev->pdev)) { if (vf < 0 || vf >= pci_num_vf(hdev->pdev)) {
dev_err(&hdev->pdev->dev, dev_err(&hdev->pdev->dev,
"Out-of-range(1 < vfid < %d) or Invalid VF(=%d) specified.\n", "vf id(%d) is out of range(0 <= vfid < %d)\n",
pci_num_vf(hdev->pdev), vf); vf, pci_num_vf(hdev->pdev));
return NULL; return NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册