Skip to content

Commit 8e3e4b9

Browse files
pgreenwaJeff Kirsher
authored andcommitted
iavf: increase reset complete wait time
With an increased number of VFs, it's possible to encounter the following issue during reset. iavf b8d4:00:02.0: Hardware reset detected iavf b8d4:00:02.0: Reset never finished (0) iavf b8d4:00:02.0: Reset task did not complete, VF disabled Increase the reset complete wait count to allow for 128 VFs to complete reset. Signed-off-by: Paul Greenwalt <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 18c012d commit 8e3e4b9

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

drivers/net/ethernet/intel/iavf/iavf.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ struct iavf_cloud_filter {
219219
bool add; /* filter needs to be added */
220220
};
221221

222+
#define IAVF_RESET_WAIT_MS 10
223+
#define IAVF_RESET_WAIT_DETECTED_COUNT 500
224+
#define IAVF_RESET_WAIT_COMPLETE_COUNT 2000
225+
222226
/* board specific private data structure */
223227
struct iavf_adapter {
224228
struct work_struct reset_task;

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,8 +2046,6 @@ static void iavf_disable_vf(struct iavf_adapter *adapter)
20462046
dev_info(&adapter->pdev->dev, "Reset task did not complete, VF disabled\n");
20472047
}
20482048

2049-
#define IAVF_RESET_WAIT_MS 10
2050-
#define IAVF_RESET_WAIT_COUNT 500
20512049
/**
20522050
* iavf_reset_task - Call-back task to handle hardware reset
20532051
* @work: pointer to work_struct
@@ -2101,20 +2099,20 @@ static void iavf_reset_task(struct work_struct *work)
21012099
adapter->flags |= IAVF_FLAG_RESET_PENDING;
21022100

21032101
/* poll until we see the reset actually happen */
2104-
for (i = 0; i < IAVF_RESET_WAIT_COUNT; i++) {
2102+
for (i = 0; i < IAVF_RESET_WAIT_DETECTED_COUNT; i++) {
21052103
reg_val = rd32(hw, IAVF_VF_ARQLEN1) &
21062104
IAVF_VF_ARQLEN1_ARQENABLE_MASK;
21072105
if (!reg_val)
21082106
break;
21092107
usleep_range(5000, 10000);
21102108
}
2111-
if (i == IAVF_RESET_WAIT_COUNT) {
2109+
if (i == IAVF_RESET_WAIT_DETECTED_COUNT) {
21122110
dev_info(&adapter->pdev->dev, "Never saw reset\n");
21132111
goto continue_reset; /* act like the reset happened */
21142112
}
21152113

21162114
/* wait until the reset is complete and the PF is responding to us */
2117-
for (i = 0; i < IAVF_RESET_WAIT_COUNT; i++) {
2115+
for (i = 0; i < IAVF_RESET_WAIT_COMPLETE_COUNT; i++) {
21182116
/* sleep first to make sure a minimum wait time is met */
21192117
msleep(IAVF_RESET_WAIT_MS);
21202118

@@ -2126,7 +2124,7 @@ static void iavf_reset_task(struct work_struct *work)
21262124

21272125
pci_set_master(adapter->pdev);
21282126

2129-
if (i == IAVF_RESET_WAIT_COUNT) {
2127+
if (i == IAVF_RESET_WAIT_COMPLETE_COUNT) {
21302128
dev_err(&adapter->pdev->dev, "Reset never finished (%x)\n",
21312129
reg_val);
21322130
iavf_disable_vf(adapter);
@@ -3429,7 +3427,7 @@ static int iavf_check_reset_complete(struct iavf_hw *hw)
34293427
u32 rstat;
34303428
int i;
34313429

3432-
for (i = 0; i < 100; i++) {
3430+
for (i = 0; i < IAVF_RESET_WAIT_COMPLETE_COUNT; i++) {
34333431
rstat = rd32(hw, IAVF_VFGEN_RSTAT) &
34343432
IAVF_VFGEN_RSTAT_VFR_STATE_MASK;
34353433
if ((rstat == VIRTCHNL_VFR_VFACTIVE) ||

0 commit comments

Comments
 (0)