From: Dany Madden <drt@linux.ibm.com>
To: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Cc: netdev@vger.kernel.org, Brian King <brking@linux.ibm.com>,
Rick Lindsley <ricklind@linux.ibm.com>
Subject: Re: [PATCH net 1/4] ibmvnic: Allow extra failures before disabling
Date: Sat, 22 Jan 2022 16:22:10 -0800 [thread overview]
Message-ID: <637f5bf73c395b49d1b615026d708d20@imap.linux.ibm.com> (raw)
In-Reply-To: <20220122025921.199446-1-sukadev@linux.ibm.com>
On 2022-01-21 18:59, Sukadev Bhattiprolu wrote:
> 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>
> ---
> drivers/net/ethernet/ibm/ibmvnic.c | 21 +++++++++++++++++----
> 1 file changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/ibm/ibmvnic.c
> b/drivers/net/ethernet/ibm/ibmvnic.c
> index 0bb3911dd014..9b2d16ad76f1 100644
> --- a/drivers/net/ethernet/ibm/ibmvnic.c
> +++ b/drivers/net/ethernet/ibm/ibmvnic.c
> @@ -2598,6 +2598,7 @@ static void __ibmvnic_reset(struct work_struct
> *work)
> struct ibmvnic_rwi *rwi;
> unsigned long flags;
> u32 reset_state;
> + int num_fails = 0;
> int rc = 0;
>
> adapter = container_of(work, struct ibmvnic_adapter, ibmvnic_reset);
> @@ -2651,11 +2652,23 @@ static void __ibmvnic_reset(struct work_struct
> *work)
> rc = do_hard_reset(adapter, rwi, reset_state);
> rtnl_unlock();
> }
> - if (rc) {
> - /* give backing device time to settle down */
> + if (rc)
> + num_fails++;
> + else
> + num_fails = 0;
> +
> + /* If auto-priority-failover is enabled we can get
> + * back to back failovers during resets, resulting
> + * in at least two failed resets (from high-priority
> + * backing device to low-priority one and then back)
> + * If resets continue to fail beyond that, give the
> + * adapter some time to settle down before retrying.
> + */
> + if (num_fails >= 3) {
> netdev_dbg(adapter->netdev,
> - "[S:%s] Hard reset failed, waiting 60 secs\n",
> - adapter_state_to_string(adapter->state));
> + "[S:%s] Hard reset failed %d times, waiting 60 secs\n",
> + adapter_state_to_string(adapter->state),
> + num_fails);
> set_current_state(TASK_UNINTERRUPTIBLE);
> schedule_timeout(60 * HZ);
> }
next prev parent reply other threads:[~2022-01-23 0:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-22 2:59 [PATCH net 1/4] ibmvnic: Allow extra failures before disabling Sukadev Bhattiprolu
2022-01-22 2:59 ` [PATCH net 2/4] ibmvnic: init ->running_cap_crqs early Sukadev Bhattiprolu
2022-01-23 0:30 ` Dany Madden
2022-01-22 2:59 ` [PATCH net 3/4] ibmvnic: don't spin in tasklet Sukadev Bhattiprolu
2022-01-23 0:32 ` Dany Madden
2022-01-22 2:59 ` [PATCH net 4/4] ibmvnic: remove unused ->wait_capability Sukadev Bhattiprolu
2022-01-23 0:33 ` Dany Madden
2022-01-23 0:22 ` Dany Madden [this message]
2022-01-24 12:10 ` [PATCH net 1/4] ibmvnic: Allow extra failures before disabling patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=637f5bf73c395b49d1b615026d708d20@imap.linux.ibm.com \
--to=drt@linux.ibm.com \
--cc=brking@linux.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=ricklind@linux.ibm.com \
--cc=sukadev@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).