Skip to content

Commit

Permalink
net/hns3: increase time waiting for PF reset completion
Browse files Browse the repository at this point in the history
[ upstream commit d6a9f8fb26b8d6adaac20d6a303faa5c5ba4d5bc ]

On the case that PF and VF need to be reset, after the hardware reset is
complete, VF needs wait for 1 second to restore the configuration so
that VF does not fail to recover because PF reset isn't complete. But
the estimated time is not sufficient. This patch fixes it to 5 seconds.

Fixes: 2790c64 ("net/hns3: support device reset")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
  • Loading branch information
LiHuiSong1 authored and cpaelzer committed Mar 9, 2022
1 parent d7dd823 commit b66b96e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/net/hns3/hns3_ethdev_vf.c
Expand Up @@ -1931,6 +1931,7 @@ hns3vf_is_reset_pending(struct hns3_adapter *hns)
static int
hns3vf_wait_hardware_ready(struct hns3_adapter *hns)
{
#define HNS3_WAIT_PF_RESET_READY_TIME 5
struct hns3_hw *hw = &hns->hw;
struct hns3_wait_data *wait_data = hw->reset.wait_data;
struct timeval tv;
Expand All @@ -1951,12 +1952,14 @@ hns3vf_wait_hardware_ready(struct hns3_adapter *hns)
return 0;

wait_data->check_completion = NULL;
wait_data->interval = 1 * MSEC_PER_SEC * USEC_PER_MSEC;
wait_data->interval = HNS3_WAIT_PF_RESET_READY_TIME *
MSEC_PER_SEC * USEC_PER_MSEC;
wait_data->count = 1;
wait_data->result = HNS3_WAIT_REQUEST;
rte_eal_alarm_set(wait_data->interval, hns3_wait_callback,
wait_data);
hns3_warn(hw, "hardware is ready, delay 1 sec for PF reset complete");
hns3_warn(hw, "hardware is ready, delay %d sec for PF reset complete",
HNS3_WAIT_PF_RESET_READY_TIME);
return -EAGAIN;
} else if (wait_data->result == HNS3_WAIT_TIMEOUT) {
gettimeofday(&tv, NULL);
Expand Down

0 comments on commit b66b96e

Please sign in to comment.