Skip to content

Commit db9f0e8

Browse files
sukadevdavem330
authored andcommitted
ibmvnic: Allow extra failures before disabling
If auto-priority-failover (APF) is enabled and there are at least two backing devices of different priorities, some resets like fail-over, change-param etc can cause at least two back to back failovers. (Failover from high priority backing device to lower priority one and then back to the higher priority one if that is still functional). Depending on the timimg of the two failovers it is possible to trigger a "hard" reset and for the hard reset to fail due to failovers. When this occurs, the driver assumes that the network is unstable and disables the VNIC for a 60-second "settling time". This in turn can cause the ethtool command to fail with "No such device" while the vnic automatically recovers a little while later. Given that it's possible to have two back to back failures, allow for extra failures before disabling the vnic for the settling time. Fixes: f15fde9 ("ibmvnic: delay next reset if hard reset fails") Signed-off-by: Sukadev Bhattiprolu <[email protected]> Reviewed-by: Dany Madden <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 27a8caa commit db9f0e8

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2602,6 +2602,7 @@ static void __ibmvnic_reset(struct work_struct *work)
26022602
struct ibmvnic_rwi *rwi;
26032603
unsigned long flags;
26042604
u32 reset_state;
2605+
int num_fails = 0;
26052606
int rc = 0;
26062607

26072608
adapter = container_of(work, struct ibmvnic_adapter, ibmvnic_reset);
@@ -2655,11 +2656,23 @@ static void __ibmvnic_reset(struct work_struct *work)
26552656
rc = do_hard_reset(adapter, rwi, reset_state);
26562657
rtnl_unlock();
26572658
}
2658-
if (rc) {
2659-
/* give backing device time to settle down */
2659+
if (rc)
2660+
num_fails++;
2661+
else
2662+
num_fails = 0;
2663+
2664+
/* If auto-priority-failover is enabled we can get
2665+
* back to back failovers during resets, resulting
2666+
* in at least two failed resets (from high-priority
2667+
* backing device to low-priority one and then back)
2668+
* If resets continue to fail beyond that, give the
2669+
* adapter some time to settle down before retrying.
2670+
*/
2671+
if (num_fails >= 3) {
26602672
netdev_dbg(adapter->netdev,
2661-
"[S:%s] Hard reset failed, waiting 60 secs\n",
2662-
adapter_state_to_string(adapter->state));
2673+
"[S:%s] Hard reset failed %d times, waiting 60 secs\n",
2674+
adapter_state_to_string(adapter->state),
2675+
num_fails);
26632676
set_current_state(TASK_UNINTERRUPTIBLE);
26642677
schedule_timeout(60 * HZ);
26652678
}

0 commit comments

Comments
 (0)