From: Dany Madden <drt@linux.ibm.com>
To: netdev@vger.kernel.org
Cc: drt@linux.ibm.com, sukadev@linux.ibm.com, ljp@linux.ibm.com
Subject: [PATCH net v2 8/9] ibmvnic: no reset timeout for 5 seconds after reset
Date: Mon, 23 Nov 2020 18:57:56 -0500 [thread overview]
Message-ID: <20201123235757.6466-9-drt@linux.ibm.com> (raw)
In-Reply-To: <20201123235757.6466-1-drt@linux.ibm.com>
Reset timeout is going off right after adapter reset. This patch ensures
that timeout is scheduled if it has been 5 seconds since the last reset.
5 seconds is the default watchdog timeout.
Fixes: ed651a10875f1 ("ibmvnic: Updated reset handling")
Signed-off-by: Dany Madden <drt@linux.ibm.com>
---
drivers/net/ethernet/ibm/ibmvnic.c | 11 +++++++++--
drivers/net/ethernet/ibm/ibmvnic.h | 2 ++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 79a8b78d93ca..3bfdf9f2edff 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -2253,6 +2253,7 @@ static void __ibmvnic_reset(struct work_struct *work)
rc = do_reset(adapter, rwi, reset_state);
}
kfree(rwi);
+ adapter->last_reset_time = jiffies;
if (rc)
netdev_dbg(adapter->netdev, "Reset failed, rc=%d\n", rc);
@@ -2356,7 +2357,13 @@ static void ibmvnic_tx_timeout(struct net_device *dev, unsigned int txqueue)
"Adapter is resetting, skip timeout reset\n");
return;
}
-
+ /* No queuing up reset until at least 5 seconds (default watchdog val)
+ * after last reset
+ */
+ if (time_before(jiffies, (adapter->last_reset_time + dev->watchdog_timeo))) {
+ netdev_dbg(dev, "Not yet time to tx timeout.\n");
+ return;
+ }
ibmvnic_reset(adapter, VNIC_RESET_TIMEOUT);
}
@@ -5276,7 +5283,7 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id)
adapter->state = VNIC_PROBED;
adapter->wait_for_reset = false;
-
+ adapter->last_reset_time = jiffies;
return 0;
ibmvnic_register_fail:
diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h
index 6f0a701c4a38..b21092f5f9c1 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.h
+++ b/drivers/net/ethernet/ibm/ibmvnic.h
@@ -1088,6 +1088,8 @@ struct ibmvnic_adapter {
unsigned long resetting;
bool napi_enabled, from_passive_init;
bool login_pending;
+ /* last device reset time */
+ unsigned long last_reset_time;
bool failover_pending;
bool force_reset_recovery;
--
2.26.2
next prev parent reply other threads:[~2020-11-23 23:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-23 23:57 [PATCH net v2 0/9] ibmvnic: assorted bug fixes Dany Madden
2020-11-23 23:57 ` [PATCH net v2 1/9] ibmvnic: handle inconsistent login with reset Dany Madden
2020-11-23 23:57 ` [PATCH net v2 2/9] ibmvnic: stop free_all_rwi on failed reset Dany Madden
2020-11-23 23:57 ` [PATCH net v2 3/9] ibmvnic: avoid memset null scrq msgs Dany Madden
2020-11-25 20:52 ` Jakub Kicinski
2020-11-23 23:57 ` [PATCH net v2 4/9] ibmvnic: restore adapter state on failed reset Dany Madden
2020-11-23 23:57 ` [PATCH net v2 5/9] ibmvnic: delay next reset if hard reset fails Dany Madden
2020-11-23 23:57 ` [PATCH net v2 6/9] ibmvnic: track pending login Dany Madden
2020-11-23 23:57 ` [PATCH net v2 7/9] ibmvnic: send_login should check for crq errors Dany Madden
2020-11-23 23:57 ` Dany Madden [this message]
2020-11-23 23:57 ` [PATCH net v2 9/9] ibmvnic: reduce wait for completion time Dany Madden
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=20201123235757.6466-9-drt@linux.ibm.com \
--to=drt@linux.ibm.com \
--cc=ljp@linux.ibm.com \
--cc=netdev@vger.kernel.org \
--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).