Skip to content

Commit

Permalink
net/hns3: fix operating queue when TCAM table is invalid
Browse files Browse the repository at this point in the history
[ upstream commit eae9723 ]

Reset queues will query the TCAM table. The table is cleared after global
or imp reset. Currently, PF driver first resets Rx/Tx queues and then
restore the table during the reset recovery process, which will fail to
query the table and trigger a RAS error.

Fixes: fa29fe4 ("net/hns3: support queue start and stop")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
  • Loading branch information
LiHuiSong1 authored and bluca committed Feb 17, 2022
1 parent b65114d commit 3f03bc5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/net/hns3/hns3_ethdev.c
Expand Up @@ -4598,6 +4598,10 @@ hns3_init_hardware(struct hns3_adapter *hns)
struct hns3_hw *hw = &hns->hw;
int ret;

/*
* All queue-related HW operations must be performed after the TCAM
* table is configured.
*/
ret = hns3_map_tqp(hw);
if (ret) {
PMD_INIT_LOG(ERR, "Failed to map tqp: %d", ret);
Expand Down Expand Up @@ -5374,15 +5378,15 @@ hns3_reinit_dev(struct hns3_adapter *hns)
return ret;
}

ret = hns3_reset_all_tqps(hns);
ret = hns3_init_hardware(hns);
if (ret) {
hns3_err(hw, "Failed to reset all queues: %d", ret);
hns3_err(hw, "Failed to init hardware: %d", ret);
return ret;
}

ret = hns3_init_hardware(hns);
ret = hns3_reset_all_tqps(hns);
if (ret) {
hns3_err(hw, "Failed to init hardware: %d", ret);
hns3_err(hw, "Failed to reset all queues: %d", ret);
return ret;
}

Expand Down

0 comments on commit 3f03bc5

Please sign in to comment.