Skip to content

Commit 311c0aa

Browse files
zhangjiarandavem330
authored andcommitted
net: hns3: fix misuse vf id and vport id in some logs
vport_id include PF and VFs, vport_id = 0 means PF, other values mean VFs. So the actual vf id is equal to vport_id minus 1. Some VF print logs are actually vport, and logs of vf id actually use vport id, so this patch fixes them. Fixes: ac887be ("net: hns3: change print level of RAS error log from warning to error") Fixes: adcf738 ("net: hns3: cleanup some print format warning") Signed-off-by: Jiaran Zhang <[email protected]> Signed-off-by: Guangbin Huang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 91bc0d5 commit 311c0aa

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2445,12 +2445,12 @@ static void hclge_handle_over_8bd_err(struct hclge_dev *hdev,
24452445
return;
24462446
}
24472447

2448-
dev_err(dev, "PPU_PF_ABNORMAL_INT_ST over_8bd_no_fe found, vf_id(%u), queue_id(%u)\n",
2448+
dev_err(dev, "PPU_PF_ABNORMAL_INT_ST over_8bd_no_fe found, vport(%u), queue_id(%u)\n",
24492449
vf_id, q_id);
24502450

24512451
if (vf_id) {
24522452
if (vf_id >= hdev->num_alloc_vport) {
2453-
dev_err(dev, "invalid vf id(%u)\n", vf_id);
2453+
dev_err(dev, "invalid vport(%u)\n", vf_id);
24542454
return;
24552455
}
24562456

@@ -2463,8 +2463,8 @@ static void hclge_handle_over_8bd_err(struct hclge_dev *hdev,
24632463

24642464
ret = hclge_inform_reset_assert_to_vf(&hdev->vport[vf_id]);
24652465
if (ret)
2466-
dev_err(dev, "inform reset to vf(%u) failed %d!\n",
2467-
hdev->vport->vport_id, ret);
2466+
dev_err(dev, "inform reset to vport(%u) failed %d!\n",
2467+
vf_id, ret);
24682468
} else {
24692469
set_bit(HNAE3_FUNC_RESET, reset_requests);
24702470
}

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3661,7 +3661,8 @@ static int hclge_set_all_vf_rst(struct hclge_dev *hdev, bool reset)
36613661
if (ret) {
36623662
dev_err(&hdev->pdev->dev,
36633663
"set vf(%u) rst failed %d!\n",
3664-
vport->vport_id, ret);
3664+
vport->vport_id - HCLGE_VF_VPORT_START_NUM,
3665+
ret);
36653666
return ret;
36663667
}
36673668

@@ -3676,7 +3677,8 @@ static int hclge_set_all_vf_rst(struct hclge_dev *hdev, bool reset)
36763677
if (ret)
36773678
dev_warn(&hdev->pdev->dev,
36783679
"inform reset to vf(%u) failed %d!\n",
3679-
vport->vport_id, ret);
3680+
vport->vport_id - HCLGE_VF_VPORT_START_NUM,
3681+
ret);
36803682
}
36813683

36823684
return 0;
@@ -11467,11 +11469,11 @@ static void hclge_clear_resetting_state(struct hclge_dev *hdev)
1146711469
struct hclge_vport *vport = &hdev->vport[i];
1146811470
int ret;
1146911471

11470-
/* Send cmd to clear VF's FUNC_RST_ING */
11472+
/* Send cmd to clear vport's FUNC_RST_ING */
1147111473
ret = hclge_set_vf_rst(hdev, vport->vport_id, false);
1147211474
if (ret)
1147311475
dev_warn(&hdev->pdev->dev,
11474-
"clear vf(%u) rst failed %d!\n",
11476+
"clear vport(%u) rst failed %d!\n",
1147511477
vport->vport_id, ret);
1147611478
}
1147711479
}

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ static int hclge_reset_vf(struct hclge_vport *vport)
566566
struct hclge_dev *hdev = vport->back;
567567

568568
dev_warn(&hdev->pdev->dev, "PF received VF reset request from VF %u!",
569-
vport->vport_id);
569+
vport->vport_id - HCLGE_VF_VPORT_START_NUM);
570570

571571
return hclge_func_reset_cmd(hdev, vport->vport_id);
572572
}

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ int hclge_tm_qs_shaper_cfg(struct hclge_vport *vport, int max_tx_rate)
581581
ret = hclge_cmd_send(&hdev->hw, &desc, 1);
582582
if (ret) {
583583
dev_err(&hdev->pdev->dev,
584-
"vf%u, qs%u failed to set tx_rate:%d, ret=%d\n",
584+
"vport%u, qs%u failed to set tx_rate:%d, ret=%d\n",
585585
vport->vport_id, shap_cfg_cmd->qs_id,
586586
max_tx_rate, ret);
587587
return ret;

0 commit comments

Comments
 (0)