net: hns3: add failure logs in hclge_set_vport_mtu
authorJie Wang <wangjie125@huawei.com>
Tue, 19 Apr 2022 03:27:04 +0000 (11:27 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Apr 2022 09:45:50 +0000 (10:45 +0100)
Currently, There is a low probability that pf mtu configuration fails, but
the information in logs is insufficient for problem locating when the VF
mtu value is illegally modified.

So record the vf index and vf mtu value at the failure scenario.

Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

index 8cebb180c812f2a795101ad0c293b9e0b4a7a165..a5dd2c8c244a963bc49880f4de6f60be83e60114 100644 (file)
@@ -10449,6 +10449,9 @@ int hclge_set_vport_mtu(struct hclge_vport *vport, int new_mtu)
        /* PF's mps must be greater then VF's mps */
        for (i = 1; i < hdev->num_alloc_vport; i++)
                if (max_frm_size < hdev->vport[i].mps) {
+                       dev_err(&hdev->pdev->dev,
+                               "failed to set pf mtu for less than vport %d, mps = %u.\n",
+                               i, hdev->vport[i].mps);
                        mutex_unlock(&hdev->vport_lock);
                        return -EINVAL;
                }