ibmvnic: Allow extra failures before disabling
authorSukadev Bhattiprolu <sukadev@linux.ibm.com>
Sat, 22 Jan 2022 02:59:18 +0000 (18:59 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Jan 2022 12:05:03 +0000 (12:05 +0000)
commitdb9f0e8bf79e6da7068b5818fea0ffd9d0d4b4da
treeede322bb0619baf775d18b05c1588b2166ec5835
parent27a8caa59babb96c5890569e131bc0eb6d45daee
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: f15fde9d47b8 ("ibmvnic: delay next reset if hard reset fails")
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Reviewed-by: Dany Madden <drt@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c