Skip to content

Commit b7b5d25

Browse files
Guojia Liaodavem330
authored andcommitted
net: hns3: fix for VLAN config when reset failed
When device is resetting or reset failed, firmware is unable to handle mailbox. VLAN should not be configured in this case. Fixes: fe4144d ("net: hns3: sync VLAN filter entries when kill VLAN ID failed") Signed-off-by: Guojia Liao <[email protected]> Signed-off-by: Huazhong Tan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent efe3fa4 commit b7b5d25

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9042,11 +9042,12 @@ int hclge_set_vlan_filter(struct hnae3_handle *handle, __be16 proto,
90429042
bool writen_to_tbl = false;
90439043
int ret = 0;
90449044

9045-
/* When device is resetting, firmware is unable to handle
9046-
* mailbox. Just record the vlan id, and remove it after
9045+
/* When device is resetting or reset failed, firmware is unable to
9046+
* handle mailbox. Just record the vlan id, and remove it after
90479047
* reset finished.
90489048
*/
9049-
if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state) && is_kill) {
9049+
if ((test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state) ||
9050+
test_bit(HCLGE_STATE_RST_FAIL, &hdev->state)) && is_kill) {
90509051
set_bit(vlan_id, vport->vlan_del_fail_bmap);
90519052
return -EBUSY;
90529053
}

drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,11 +1592,12 @@ static int hclgevf_set_vlan_filter(struct hnae3_handle *handle,
15921592
if (proto != htons(ETH_P_8021Q))
15931593
return -EPROTONOSUPPORT;
15941594

1595-
/* When device is resetting, firmware is unable to handle
1596-
* mailbox. Just record the vlan id, and remove it after
1595+
/* When device is resetting or reset failed, firmware is unable to
1596+
* handle mailbox. Just record the vlan id, and remove it after
15971597
* reset finished.
15981598
*/
1599-
if (test_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state) && is_kill) {
1599+
if ((test_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state) ||
1600+
test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state)) && is_kill) {
16001601
set_bit(vlan_id, hdev->vlan_del_fail_bmap);
16011602
return -EBUSY;
16021603
}
@@ -3443,7 +3444,8 @@ void hclgevf_update_port_base_vlan_info(struct hclgevf_dev *hdev, u16 state,
34433444

34443445
rtnl_lock();
34453446

3446-
if (test_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state)) {
3447+
if (test_bit(HCLGEVF_STATE_RST_HANDLING, &hdev->state) ||
3448+
test_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state)) {
34473449
dev_warn(&hdev->pdev->dev,
34483450
"is resetting when updating port based vlan info\n");
34493451
rtnl_unlock();

0 commit comments

Comments
 (0)