iavf: cleanup, improvements in init and
Subsystems (2)
cover iavf: cleanup, improvements in init and
Here are a couple of iavf cleanups and then improvements for the initialization flow (waiting for the VF reset) and driver removal.
Michal Schmidt (5):
iavf: fix comments about old bit locks
iavf: simplify mutex_trylock+sleep loops
iavf: in iavf_down, don't queue watchdog_task if comms failed
iavf: in iavf_down, disable queues when removing the driver
iavf: fix the waiting time for initial reset
drivers/net/ethernet/intel/iavf/iavf_main.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
Signature · 6 lines
2.41.0 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH 2/5 iavf: simplify mutex_trylock+sleep loops
This pattern appears in two places in the iavf source code:
while (!mutex_trylock(...))
usleep_range(...);
That's just mutex_lock with extra steps.
The pattern is a leftover from when iavf used bit flags instead of mutexes for locking. Commit 5ac49f3c2702 ("iavf: use mutexes for locking of critical sections") replaced test_and_set_bit with !mutex_trylock, preserving the pattern.
Simplify it to mutex_lock.
--- drivers/net/ethernet/intel/iavf/iavf_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/iavf/iavf_main.c +2 -4
@@ -3016,8 +3016,7 @@ static void iavf_reset_task(struct work_struct *work)return ; } -while (!mutex_trylock (&adapter->client_lock)) -usleep_range (500 ,1000 ); +mutex_lock (&adapter->client_lock);if (CLIENT_ENABLED (adapter)) { adapter->flags &= ~(IAVF_FLAG_CLIENT_NEEDS_OPEN | IAVF_FLAG_CLIENT_NEEDS_CLOSE |
@@ -5069,8 +5068,7 @@ static int __maybe_unused iavf_suspend(struct device *dev_d)netif_device_detach (netdev); -while (!mutex_trylock (&adapter->crit_lock)) -usleep_range (500 ,1000 ); +mutex_lock (&adapter->crit_lock);if (netif_running (netdev)) {rtnl_lock ();
Signature · 6 lines
2.41.0 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH 3/5 iavf: in iavf_down, don't queue watchdog_task if comms failed
In reply to Michal SchmidtThe reason for queueing watchdog_task is to have it process the aq_required flags that are being set here. If comms failed, there's nothing to do, so return early.
--- drivers/net/ethernet/intel/iavf/iavf_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/iavf/iavf_main.c +4 -2
@@ -1420,8 +1420,10 @@ void iavf_down(struct iavf_adapter *adapter)iavf_clear_fdir_filters (adapter);iavf_clear_adv_rss_conf (adapter); -if (!(adapter->flags &IAVF_FLAG_PF_COMMS_FAILED ) && - !(test_bit (__IAVF_IN_REMOVE_TASK, &adapter->crit_section))) { +if (adapter->flags &IAVF_FLAG_PF_COMMS_FAILED ) +return ; + +if (!test_bit (__IAVF_IN_REMOVE_TASK, &adapter->crit_section)) {/* cancel any current operation */ adapter->current_op =VIRTCHNL_OP_UNKNOWN ;/* Schedule operations to close down the HW. Don't wait
Signature · 6 lines
2.41.0 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH 1/5 iavf: fix comments about old bit locks
In reply to Michal SchmidtBit lock __IAVF_IN_CRITICAL_TASK does not exist anymore since commit 5ac49f3c2702 ("iavf: use mutexes for locking of critical sections"). Adjust the comments accordingly.
--- drivers/net/ethernet/intel/iavf/iavf_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/iavf/iavf_main.c +2 -2
@@ -1276,7 +1276,7 @@ static void iavf_configure(struct iavf_adapter *adapter)* iavf_up_complete - Finish the last steps of bringing up a connection * @adapter: board private structure * -* Expects to be called while holding the __IAVF_IN_CRITICAL_TASK bit lock. +* Expects to be called while holding crit_lock. **/ static void iavf_up_complete (struct iavf_adapter *adapter) {
@@ -1400,7 +1400,7 @@ static void iavf_clear_adv_rss_conf(struct iavf_adapter *adapter)* iavf_down - Shutdown the connection processing * @adapter: board private structure * -* Expects to be called while holding the __IAVF_IN_CRITICAL_TASK bit lock. +* Expects to be called while holding crit_lock. **/ void iavf_down (struct iavf_adapter *adapter) {
Signature · 6 lines
2.41.0 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH 4/5 iavf: in iavf_down, disable queues when removing the driver
In reply to Michal SchmidtIn iavf_down, we're skipping the scheduling of certain operations if the driver is being removed. However, the IAVF_FLAG_AQ_DISABLE_QUEUES request must not be skipped in this case, because iavf_close waits for the transition to the __IAVF_DOWN state, which happens in iavf_virtchnl_completion after the queues are released.
Without this fix, "rmmod iavf" takes half a second per interface that's up and prints the "Device resources not yet released" warning.
--- drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/iavf/iavf_main.c +1 -1
@@ -1440,9 +1440,9 @@ void iavf_down(struct iavf_adapter *adapter) adapter->aq_required |=IAVF_FLAG_AQ_DEL_FDIR_FILTER ;if (!list_empty (&adapter->adv_rss_list_head)) adapter->aq_required |=IAVF_FLAG_AQ_DEL_ADV_RSS_CFG ; - adapter->aq_required |=IAVF_FLAG_AQ_DISABLE_QUEUES ; } + adapter->aq_required |=IAVF_FLAG_AQ_DISABLE_QUEUES ;mod_delayed_work (adapter->wq, &adapter->watchdog_task,0 ); }
Signature · 6 lines
2.41.0 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
PATCH 5/5 iavf: fix the waiting time for initial reset
In reply to Michal SchmidtEvery time I create VFs on ice, I receive at least one "Device is still in reset (-16), retrying" message per VF. It recovers fine, but typical usecases should not trigger scary-looking messages.
The waiting for reset is too short. It makes no sense to check every 10 microseconds. Typical reset waiting times are at least tens of milliseconds and can be several seconds. I suspect the polling interval was meant to be 10 milliseconds all along.
IAVF_RESET_WAIT_COMPLETE_COUNT is defined as 2000, so the total waiting time could be over 20 seconds. I have seen resets take 5 seconds (with 128 VFs on ice).
The added benefit of not triggering the "Device is still in reset" path is that we avoid going through the __IAVF_INIT_FAILED state, which would take a full second before retrying.
--- drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/iavf/iavf_main.c +1 -1
@@ -4791,7 +4791,7 @@ static int iavf_check_reset_complete(struct iavf_hw *hw)if ((rstat ==VIRTCHNL_VFR_VFACTIVE ) || (rstat ==VIRTCHNL_VFR_COMPLETED ))return 0 ; -usleep_range (10 ,20 ); +msleep (IAVF_RESET_WAIT_MS ); }return -EBUSY ; }
Signature · 6 lines
2.41.0 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Re: [Intel-wired-lan] [PATCH net-next 1/5] iavf: fix comments about old bit locks
In reply to Michal SchmidtQuoted 10 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Schmidt
Sent: Tuesday, October 10, 2023 2:25 AM
To: [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 1/5] iavf: fix comments about old bit locks
Quoted 5 lines
Bit lock
__IAVF_IN_CRITICAL_TASKdoes not exist anymore since commit5ac49f3c2702("iavf: use mutexes for locking of critical sections"). Adjust the comments accordingly.Signed-off-by Michal Schmidt <[email protected]>
Thanks for your contribution, Michal!
Quoted 32 lines
--- drivers/net/ethernet/intel/iavf/iavf_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/net/ethernet/intel/iavf/iavf_main.c +1
-1@@ -1276,7 +1276,7 @@ static void iavf_configure(struct iavf_adapter*adapter) * iavf_up_complete - Finish the last steps of bringing up a connection * @adapter: board private structure * -* Expects to be called while holding the __IAVF_IN_CRITICAL_TASK bit lock. +* Expects to be called while holding crit_lock. **/ static void iavf_up_complete (struct iavf_adapter *adapter){
drivers/net/ethernet/intel/iavf/iavf_main.c +1
-1@@ -1400,7 +1400,7 @@ static void iavf_clear_adv_rss_conf(structiavf_adapter *adapter) * iavf_down - Shutdown the connection processing * @adapter: board private structure * -* Expects to be called while holding the __IAVF_IN_CRITICAL_TASK bit lock. +* Expects to be called while holding crit_lock. **/ void iavf_down (struct iavf_adapter *adapter){
--
2.41.0
Quoted 4 lines
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Re: [Intel-wired-lan] [PATCH net-next 2/5] iavf: simplify mutex_trylock+sleep loops
In reply to Michal SchmidtQuoted 12 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Schmidt
Sent: Tuesday, October 10, 2023 2:25 AM
To: [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 2/5] iavf: simplify mutex_trylock+sleep loops
Quoted 3 lines
This pattern appears in two places in the iavf source code:
while (!mutex_trylock(...))usleep_range(...);
I found a few other places with similar pattern (iavf_configure_clsflower e.g). Do you think we can fix them as well?
Quoted 44 lines
That's just
mutex_lockwith extra steps.
The pattern is a leftover from when iavf used bit flags instead of mutexes for locking. Commit5ac49f3c2702("iavf: use mutexes for locking of critical sections") replacedtest_and_set_bitwith !mutex_trylock, preserving the pattern.Simplify it to
mutex_lock.Signed-off-by Michal Schmidt <[email protected]>--- drivers/net/ethernet/intel/iavf/iavf_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/net/ethernet/intel/iavf/iavf_main.c +1
-2@@ -3016,8 +3016,7 @@ static void iavf_reset_task(struct work_struct *work)return ; } -while (!mutex_trylock (&adapter->client_lock)) -usleep_range (500 ,1000 ); +mutex_lock (&adapter->client_lock);if (CLIENT_ENABLED (adapter)) { adapter->flags &= ~(IAVF_FLAG_CLIENT_NEEDS_OPEN |drivers/net/ethernet/intel/iavf/iavf_main.c +1
-2IAVF_FLAG_CLIENT_NEEDS_CLOSE |@@ -5069,8 +5068,7 @@ static int __maybe_unused iavf_suspend(struct device *dev_d)netif_device_detach (netdev ); -while (!mutex_trylock (&adapter->crit_lock)) -usleep_range (500 ,1000 ); +mutex_lock (&adapter->crit_lock);if (netif_running (netdev)) {
rtnl_lock();
--
2.41.0
Quoted 4 lines
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Re: [Intel-wired-lan] [PATCH net-next 3/5] iavf: in iavf_down, don't queue watchdog_task if comms failed
In reply to Michal SchmidtQuoted 12 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Schmidt
Sent: Tuesday, October 10, 2023 2:25 AM
To: [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 3/5] iavf: iniavf_down, don't queuewatchdog_taskif comms failed
Quoted 5 lines
The reason for queueing
watchdog_taskis to have it process theaq_requiredflags that are being set here. If comms failed, there's nothing to do, so return early.Signed-off-by Michal Schmidt <[email protected]>
Quoted 25 lines
--- drivers/net/ethernet/intel/iavf/iavf_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/net/ethernet/intel/iavf/iavf_main.c +4
-3@@ -1420,8 +1420,10 @@ void iavf_down(struct iavf_adapter *adapter)iavf_clear_fdir_filters (adapter);iavf_clear_adv_rss_conf (adapter); -if (!(adapter->flags &IAVF_FLAG_PF_COMMS_FAILED ) && - !(test_bit (__IAVF_IN_REMOVE_TASK, &adapter->crit_section))) { +if (adapter->flags &IAVF_FLAG_PF_COMMS_FAILED ) +return ; + +if (!test_bit (__IAVF_IN_REMOVE_TASK, &adapter->crit_section)) {/* cancel any current operation */ adapter->current_op =VIRTCHNL_OP_UNKNOWN ;/* Schedule operations to close down the HW. Don't wait -- 2.41.0
Quoted 4 lines
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Quoted 10 lines · Michal Schmidt
Here are a couple of iavf cleanups and then improvements for the initialization flow (waiting for the VF reset) and driver removal.
Michal Schmidt (5):
iavf: fix comments about old bit locks
iavf: simplify mutex_trylock+sleep loops
iavf: iniavf_down, don't queuewatchdog_taskif comms failed
iavf: iniavf_down, disable queues when removing the driver
iavf: fix the waiting time for initial reset
Quoted 3 lines
drivers/net/ethernet/intel/iavf/iavf_main.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
Very nice series, thanks a lot!
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Re: [Intel-wired-lan] [PATCH net-next 4/5] iavf: in iavf_down, disable queues when removing the driver
In reply to Michal SchmidtQuoted 18 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Schmidt
Sent: Tuesday, October 10, 2023 2:25 AM
To: [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 4/5] iavf: iniavf_down, disable queues when removing the driverIn
iavf_down, we're skipping the scheduling of certain operations if the driver is being removed. However, theIAVF_FLAG_AQ_DISABLE_QUEUESrequest must not be skipped in this case, becauseiavf_closewaits for the transition to the__IAVF_DOWNstate, which happens iniavf_virtchnl_completionafter the queues are released.
Quoted 6 lines
Without this fix, "rmmod iavf" takes half a second per interface that's up and prints the "Device resources not yet released" warning.
Fixes c8de44b577eb ("iavf: do not process adminq tasks when
__IAVF_IN_REMOVE_TASKis set")Signed-off-by Michal Schmidt <[email protected]>
Looks like a fix, could be a separate patch with net as a target.
Quoted 22 lines
--- drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/intel/iavf/iavf_main.c +1
-1@@ -1440,9 +1440,9 @@ void iavf_down(struct iavf_adapter *adapter) adapter->aq_required |=IAVF_FLAG_AQ_DEL_FDIR_FILTER ;if (!list_empty (&adapter->adv_rss_list_head)) adapter->aq_required |=IAVF_FLAG_AQ_DEL_ADV_RSS_CFG ; - adapter->aq_required |=IAVF_FLAG_AQ_DISABLE_QUEUES ; } + adapter->aq_required |=IAVF_FLAG_AQ_DISABLE_QUEUES ;mod_delayed_work (adapter->wq, &adapter->watchdog_task,0 );}
Quoted 7 lines
--
2.41.0_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Re: [Intel-wired-lan] [PATCH net-next 5/5] iavf: fix the waiting time for initial reset
In reply to Michal SchmidtQuoted 25 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Schmidt
Sent: Tuesday, October 10, 2023 2:25 AM
To: [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 5/5] iavf: fix the waiting time for initial resetEvery time I create VFs on ice, I receive at least one "Device is still in reset (-16), retrying" message per VF. It recovers fine, but typical usecases should not trigger scary-looking messages.
The waiting for reset is too short. It makes no sense to check every 10 microseconds. Typical reset waiting times are at least tens of milliseconds and can be several seconds. I suspect the polling interval was meant to be 10 milliseconds all along.
IAVF_RESET_WAIT_COMPLETE_COUNTis defined as 2000, so the total waiting time could be over 20 seconds. I have seen resets take 5 seconds (with 128 VFs on ice).
Quoted 5 lines
The added benefit of not triggering the "Device is still in reset" path is that we avoid going through the
__IAVF_INIT_FAILEDstate, which would take a full second before retrying.Signed-off-by Michal Schmidt <[email protected]>
Quoted 22 lines
--- drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/intel/iavf/iavf_main.c +1
-1@@ -4791,7 +4791,7 @@ static int iavf_check_reset_complete(struct iavf_hw *hw)if ((rstat ==VIRTCHNL_VFR_VFACTIVE ) || (rstat ==VIRTCHNL_VFR_COMPLETED ))return 0 ; -usleep_range (10 ,20 ); +msleep (IAVF_RESET_WAIT_MS ); }return -EBUSY ;}
--
2.41.0
Quoted 4 lines
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Re: [Intel-wired-lan] [PATCH net-next 2/5] iavf: simplify mutex_trylock+sleep loops
In reply to Drewek, WojciechDne 10. 10. 23 v 13:30 Drewek, Wojciech napsal:
Quoted 10 lines
Quoted 10 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Schmidt
Sent: Tuesday, October 10, 2023 2:25 AM
To: [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 2/5] iavf: simplify mutex_trylock+sleep loops
Quoted 6 lines
Quoted 3 lines
This pattern appears in two places in the iavf source code:
while (!mutex_trylock(...)) usleep_range(...);I found a few other places with similar pattern (
iavf_configure_clsflowere.g). Do you think we can fix them as well?
I think so. But those are with some sort of a timeout, so replacing them would be slightly less obviously correct than these here. Later. Michal
Quoted 43 lines
Quoted 43 lines
That's just
mutex_lockwith extra steps.
The pattern is a leftover from when iavf used bit flags instead of mutexes for locking. Commit5ac49f3c2702("iavf: use mutexes for locking of critical sections") replacedtest_and_set_bitwith !mutex_trylock, preserving the pattern.Simplify it to
mutex_lock.Signed-off-by Michal Schmidt <[email protected]>--- drivers/net/ethernet/intel/iavf/iavf_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/net/ethernet/intel/iavf/iavf_main.c +1
-2@@ -3016,8 +3016,7 @@ static void iavf_reset_task(struct work_struct *work)return ; } -while (!mutex_trylock (&adapter->client_lock)) -usleep_range (500 ,1000 ); +mutex_lock (&adapter->client_lock);if (CLIENT_ENABLED (adapter)) { adapter->flags &= ~(IAVF_FLAG_CLIENT_NEEDS_OPEN |
IAVF_FLAG_CLIENT_NEEDS_CLOSE|drivers/net/ethernet/intel/iavf/iavf_main.c +1
-2@@ -5069,8 +5068,7 @@ static int __maybe_unused iavf_suspend(struct device *dev_d)netif_device_detach (netdev ); -while (!mutex_trylock (&adapter->crit_lock)) -usleep_range (500 ,1000 ); +mutex_lock (&adapter->crit_lock);if (netif_running (netdev)) {
rtnl_lock();
--
2.41.0
Quoted 5 lines
Quoted 4 lines
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Drewek, Wojciech
Reviewed-byRe: [Intel-wired-lan] [PATCH net-next 2/5] iavf: simplify mutex_trylock+sleep loops
Quoted 28 lines
-----Original Message-----
From: Michal Schmidt <[email protected]>
Sent: Tuesday, October 10, 2023 1:57 PM
To: Drewek, Wojciech <[email protected]>; intel-wired- [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: Re: [Intel-wired-lan] [PATCH net-next 2/5] iavf: simplify mutex_trylock+sleep loopsDne 10. 10. 23 v 13:30 Drewek, Wojciech napsal:
Quoted 7 lines
Quoted 7 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Schmidt
Sent: Tuesday, October 10, 2023 2:25 AM
To: [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, JesseQuoted 7 lines
Quoted 6 lines
Subject: [Intel-wired-lan] [PATCH net-next 2/5] iavf: simplify mutex_trylock+sleep loops
This pattern appears in two places in the iavf source code:
while (!mutex_trylock(...)) usleep_range(...);
Quoted 6 lines
Quoted 2 lines
I found a few other places with similar pattern (
iavf_configure_clsflowere.g). Do you think we can fix them as well?I think so. But those are with some sort of a timeout, so replacing them would be slightly less obviously correct than these here. Later. Michal
Makes sense.
Quoted 44 lines
Quoted 44 lines
Quoted 44 lines
That's just
mutex_lockwith extra steps.
The pattern is a leftover from when iavf used bit flags instead of mutexes for locking. Commit5ac49f3c2702("iavf: use mutexes for locking of critical sections") replacedtest_and_set_bitwith !mutex_trylock, preserving the pattern.Simplify it to
mutex_lock.Signed-off-by Michal Schmidt <[email protected]>--- drivers/net/ethernet/intel/iavf/iavf_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/net/ethernet/intel/iavf/iavf_main.c +1
-2@@ -3016,8 +3016,7 @@ static void iavf_reset_task(struct work_struct *work)return ; } -while (!mutex_trylock (&adapter->client_lock)) -usleep_range (500 ,1000 ); +mutex_lock (&adapter->client_lock);if (CLIENT_ENABLED (adapter)) { adapter->flags &= ~(IAVF_FLAG_CLIENT_NEEDS_OPEN |
IAVF_FLAG_CLIENT_NEEDS_CLOSE|drivers/net/ethernet/intel/iavf/iavf_main.c +1
-2@@ -5069,8 +5068,7 @@ static int __maybe_unused iavf_suspend(struct device *dev_d)netif_device_detach (netdev ); -while (!mutex_trylock (&adapter->crit_lock)) -usleep_range (500 ,1000 ); +mutex_lock (&adapter->crit_lock);if (netif_running (netdev)) {
rtnl_lock();
--
2.41.0
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Re: [Intel-wired-lan] [PATCH net-next 4/5] iavf: in iavf_down, disable queues when removing the driver
In reply to Drewek, WojciechDne 10. 10. 23 v 13:39 Drewek, Wojciech napsal:
Quoted 18 lines
Quoted 18 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Schmidt
Sent: Tuesday, October 10, 2023 2:25 AM
To: [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 4/5] iavf: iniavf_down, disable queues when removing the driverIn
iavf_down, we're skipping the scheduling of certain operations if the driver is being removed. However, theIAVF_FLAG_AQ_DISABLE_QUEUESrequest must not be skipped in this case, becauseiavf_closewaits for the transition to the__IAVF_DOWNstate, which happens iniavf_virtchnl_completionafter the queues are released.
Quoted 8 lines
Quoted 6 lines
Without this fix, "rmmod iavf" takes half a second per interface that's up and prints the "Device resources not yet released" warning.
Fixes c8de44b577eb ("iavf: do not process adminq tasks when
__IAVF_IN_REMOVE_TASKis set")Signed-off-by Michal Schmidt <[email protected]>Looks like a fix, could be a separate patch with net as a target.
I did not want to separate it from patch 3/5, because it changes the logic when IAVF_FLAG_PF_COMMS_FAILED is set. But on second thought, it should still work fine in that case too. aq_required would just get reset to zero in iavf_watchdog_task in the __IAVF_COMM_FAILED state.
Michal
Quoted 24 lines
Reviewed-by Wojciech Drewek <[email protected]>Quoted 22 lines
--- drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/intel/iavf/iavf_main.c +1
-1@@ -1440,9 +1440,9 @@ void iavf_down(struct iavf_adapter *adapter) adapter->aq_required |=IAVF_FLAG_AQ_DEL_FDIR_FILTER ;if (!list_empty (&adapter->adv_rss_list_head)) adapter->aq_required |=IAVF_FLAG_AQ_DEL_ADV_RSS_CFG ; - adapter->aq_required |=IAVF_FLAG_AQ_DISABLE_QUEUES ; } + adapter->aq_required |=IAVF_FLAG_AQ_DISABLE_QUEUES ;mod_delayed_work (adapter->wq, &adapter->watchdog_task,0 );}
Quoted 8 lines
Quoted 7 lines
--
2.41.0_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Re: [Intel-wired-lan] [PATCH net-next 4/5] iavf: in iavf_down, disable queues when removing the driver
Quoted 40 lines
-----Original Message-----
From: Michal Schmidt <[email protected]>
Sent: Tuesday, October 10, 2023 2:22 PM
To: Drewek, Wojciech <[email protected]>; intel-wired- [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: Re: [Intel-wired-lan] [PATCH net-next 4/5] iavf: iniavf_down, disable queues when removing the driverDne 10. 10. 23 v 13:39 Drewek, Wojciech napsal:
Quoted 9 lines
Quoted 9 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Schmidt
Sent: Tuesday, October 10, 2023 2:25 AM
To: [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, JesseQuoted 5 lines
Quoted 5 lines
Subject: [Intel-wired-lan] [PATCH net-next 4/5] iavf: in
iavf_down, disable queues when removing the driverIn
iavf_down, we're skipping the scheduling of certain operations if the driver is being removed. However, the
IAVF_FLAG_AQ_DISABLE_QUEUESQuoted 11 lines
Quoted 10 lines
request must not be skipped in this case, because
iavf_closewaits for the transition to the__IAVF_DOWNstate, which happens iniavf_virtchnl_completionafter the queues are released.Without this fix, "rmmod iavf" takes half a second per interface that's up and prints the "Device resources not yet released" warning.
Fixes c8de44b577eb ("iavf: do not process adminq tasks when
__IAVF_IN_REMOVE_TASKis set")Signed-off-by Michal Schmidt <[email protected]>
Quoted 6 lines
Quoted 1 line
Looks like a fix, could be a separate patch with net as a target.
I did not want to separate it from patch 3/5, because it changes the logic when
IAVF_FLAG_PF_COMMS_FAILEDis set. But on second thought, it should still work fine in that case too.aq_requiredwould just get reset to zero iniavf_watchdog_taskin the__IAVF_COMM_FAILEDstate.
I see, so it's up to you :)
Quoted 35 lines
Michal
Quoted 32 lines
Reviewed-by Wojciech Drewek <[email protected]>Quoted 29 lines
--- drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/intel/iavf/iavf_main.c +1
-1@@ -1440,9 +1440,9 @@ void iavf_down(struct iavf_adapter *adapter) adapter->aq_required |=IAVF_FLAG_AQ_DEL_FDIR_FILTER ;if (!list_empty (&adapter->adv_rss_list_head)) adapter->aq_required |=IAVF_FLAG_AQ_DEL_ADV_RSS_CFG ; - adapter->aq_required |=IAVF_FLAG_AQ_DISABLE_QUEUES ; } + adapter->aq_required |=IAVF_FLAG_AQ_DISABLE_QUEUES ;mod_delayed_work (adapter->wq, &adapter->watchdog_task,0 );}--
2.41.0_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Romanowski, Rafal
Tested-byRe: [Intel-wired-lan] [PATCH net-next 1/5] iavf: fix comments about old bit locks
In reply to Drewek, WojciechQuoted 61 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Drewek, Wojciech
Sent: Tuesday, October 10, 2023 1:24 PM
To: mschmidt <[email protected]>; [email protected]
Cc: Radoslaw Tyl <[email protected]>; Nguyen, Anthony L <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: Re: [Intel-wired-lan] [PATCH net-next 1/5] iavf: fix comments about old bit locksQuoted 11 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Schmidt
Sent: Tuesday, October 10, 2023 2:25 AM
To: [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 1/5] iavf: fix comments about old bit locksQuoted 5 lines
Bit lock
__IAVF_IN_CRITICAL_TASKdoes not exist anymore since commit5ac49f3c2702("iavf: use mutexes for locking of critical sections"). Adjust the comments accordingly.Signed-off-by Michal Schmidt <[email protected]>Thanks for your contribution, Michal!
Reviewed-by Wojciech Drewek <[email protected]>Quoted 30 lines
--- drivers/net/ethernet/intel/iavf/iavf_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/net/ethernet/intel/iavf/iavf_main.c +1
-2@@ -1276,7 +1276,7 @@ static void iavf_configure(struct iavf_adapter*adapter) * iavf_up_complete - Finish the last steps of bringing up a connection * @adapter: board private structure * -* Expects to be called while holding the __IAVF_IN_CRITICAL_TASK bit lock. +* Expects to be called while holding crit_lock. **/ static void iavf_up_complete(struct iavf_adapter *adapter) { @@ -1400,7 +1400,7 @@ static void iavf_clear_adv_rss_conf(struct
iavf_adapter*adapter)
*iavf_down- Shutdown the connection processing
* @adapter: board private structure
*
- * Expects to be called while holding the__IAVF_IN_CRITICAL_TASKbit lock.
+ * Expects to be called while holdingcrit_lock.
**/
voidiavf_down(struct iavf_adapter *adapter){
--
2.41.0
Quoted 8 lines
Quoted 4 lines
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Romanowski, Rafal
Tested-byRe: [Intel-wired-lan] [PATCH net-next 2/5] iavf: simplify mutex_trylock+sleep loops
In reply to Drewek, WojciechQuoted 102 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Drewek, Wojciech
Sent: Tuesday, October 10, 2023 2:08 PM
To: mschmidt <[email protected]>; [email protected]
Cc: Radoslaw Tyl <[email protected]>; Nguyen, Anthony L <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: Re: [Intel-wired-lan] [PATCH net-next 2/5] iavf: simplify mutex_trylock+sleep loopsQuoted 12 lines
-----Original Message-----
From: Michal Schmidt <[email protected]>
Sent: Tuesday, October 10, 2023 1:57 PM
To: Drewek, Wojciech <[email protected]>; intel-wired- [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: Re: [Intel-wired-lan] [PATCH net-next 2/5] iavf: simplify mutex_trylock+sleep loopsDne 10. 10. 23 v 13:30 Drewek, Wojciech napsal:
Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Schmidt
Sent: Tuesday, October 10, 2023 2:25 AM
To: [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, JesseQuoted 8 lines
Quoted 6 lines
Subject: [Intel-wired-lan] [PATCH net-next 2/5] iavf: simplify mutex_trylock+sleep loops
This pattern appears in two places in the iavf source code:
while (!mutex_trylock(...)) usleep_range(...);I found a few other places with similar pattern (
iavf_configure_clsflowere.g).
Quoted 5 lines
Quoted 1 line
Do you think we can fix them as well?
I think so. But those are with some sort of a timeout, so replacing them would be slightly less obviously correct than these here. Later. Michal
Makes sense.
Reviewed-by Wojciech Drewek <[email protected]>Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
That's just
mutex_lockwith extra steps.
The pattern is a leftover from when iavf used bit flags instead of mutexes for locking. Commit5ac49f3c2702("iavf: use mutexes for locking of critical sections") replacedtest_and_set_bitwith !mutex_trylock, preserving the pattern.Simplify it to
mutex_lock.Signed-off-by Michal Schmidt <[email protected]>--- drivers/net/ethernet/intel/iavf/iavf_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/net/ethernet/intel/iavf/iavf_main.c +0
-0@@ -3016,8 +3016,7 @@ static void iavf_reset_task(struct
work_struct
*work)
return;
}Quoted 6 lines
Quoted 6 lines
drivers/net/ethernet/intel/iavf/iavf_main.c static void iavf_reset_task(struct work_struct *work)
Quoted 6 lines
drivers/net/ethernet/intel/iavf/iavf_main.c +1
-2-while (!mutex_trylock (&adapter->client_lock)) -usleep_range (500 ,1000 ); +mutex_lock (&adapter->client_lock);if (CLIENT_ENABLED (adapter)) { adapter->flags &= ~(IAVF_FLAG_CLIENT_NEEDS_OPEN | IAVF_FLAG_CLIENT_NEEDS_CLOSE | @@ -5069,8 +5068,7 @@
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
static int
__maybe_unusediavf_suspend(struct device *dev_d)netif_device_detach(netdev);drivers/net/ethernet/intel/iavf/iavf_main.c +1
-3-while (!mutex_trylock (&adapter->crit_lock)) -usleep_range (500 ,1000 ); +mutex_lock (&adapter->crit_lock);if (netif_running (netdev)) {rtnl_lock (); --2.41.0
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Quoted 4 lines
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Romanowski, Rafal
Tested-byRe: [Intel-wired-lan] [PATCH net-next 3/5] iavf: in iavf_down, don't queue watchdog_task if comms failed
In reply to Drewek, WojciechQuoted 57 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Drewek, Wojciech
Sent: Tuesday, October 10, 2023 1:34 PM
To: mschmidt <[email protected]>; [email protected]
Cc: Radoslaw Tyl <[email protected]>; Nguyen, Anthony L <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: Re: [Intel-wired-lan] [PATCH net-next 3/5] iavf: iniavf_down, don't queuewatchdog_taskif comms failedQuoted 11 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Schmidt
Sent: Tuesday, October 10, 2023 2:25 AM
To: [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 3/5] iavf: iniavf_down, don't queuewatchdog_taskif comms failedQuoted 5 lines
The reason for queueing
watchdog_taskis to have it process theaq_requiredflags that are being set here. If comms failed, there's nothing to do, so return early.Signed-off-by Michal Schmidt <[email protected]>Reviewed-by Wojciech Drewek <[email protected]>Quoted 25 lines
--- drivers/net/ethernet/intel/iavf/iavf_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/net/ethernet/intel/iavf/iavf_main.c +4
-3@@ -1420,8 +1420,10 @@ void iavf_down(struct iavf_adapter *adapter)iavf_clear_fdir_filters (adapter);iavf_clear_adv_rss_conf (adapter); -if (!(adapter->flags &IAVF_FLAG_PF_COMMS_FAILED ) && - !(test_bit (__IAVF_IN_REMOVE_TASK, &adapter->crit_section))) { +if (adapter->flags &IAVF_FLAG_PF_COMMS_FAILED ) +return ; + +if (!test_bit (__IAVF_IN_REMOVE_TASK, &adapter->crit_section)) {/* cancel any current operation */ adapter->current_op =VIRTCHNL_OP_UNKNOWN ;/* Schedule operations to close down the HW. Don't wait -- 2.41.0
Quoted 8 lines
Quoted 4 lines
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Romanowski, Rafal
Tested-byRe: [Intel-wired-lan] [PATCH net-next 4/5] iavf: in iavf_down, disable queues when removing the driver
In reply to Drewek, WojciechQuoted 97 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Drewek, Wojciech
Sent: Tuesday, October 10, 2023 3:56 PM
To: mschmidt <[email protected]>; [email protected]
Cc: Radoslaw Tyl <[email protected]>; Nguyen, Anthony L <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: Re: [Intel-wired-lan] [PATCH net-next 4/5] iavf: iniavf_down, disable queues when removing the driverQuoted 39 lines
-----Original Message-----
From: Michal Schmidt <[email protected]>
Sent: Tuesday, October 10, 2023 2:22 PM
To: Drewek, Wojciech <[email protected]>; intel-wired- [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: Re: [Intel-wired-lan] [PATCH net-next 4/5] iavf: iniavf_down, disable queues when removing the driverDne 10. 10. 23 v 13:39 Drewek, Wojciech napsal:
Quoted 9 lines
Quoted 9 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Schmidt
Sent: Tuesday, October 10, 2023 2:25 AM
To: [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, JesseQuoted 5 lines
Quoted 5 lines
Subject: [Intel-wired-lan] [PATCH net-next 4/5] iavf: in
iavf_down, disable queues when removing the driverIn
iavf_down, we're skipping the scheduling of certain operations if the driver is being removed. However, the
IAVF_FLAG_AQ_DISABLE_QUEUESQuoted 11 lines
Quoted 10 lines
request must not be skipped in this case, because
iavf_closewaits for the transition to the__IAVF_DOWNstate, which happens iniavf_virtchnl_completionafter the queues are released.Without this fix, "rmmod iavf" takes half a second per interface that's up and prints the "Device resources not yet released" warning.
Fixes c8de44b577eb ("iavf: do not process adminq tasks when
__IAVF_IN_REMOVE_TASKis set")Signed-off-by Michal Schmidt <[email protected]>Quoted 6 lines
Quoted 1 line
Looks like a fix, could be a separate patch with net as a target.
I did not want to separate it from patch 3/5, because it changes the logic when
IAVF_FLAG_PF_COMMS_FAILEDis set. But on second thought, it should still work fine in that case too.aq_requiredwould just get reset to zero iniavf_watchdog_taskin the__IAVF_COMM_FAILEDstate.I see, so it's up to you :)
Quoted 35 lines
Michal
Quoted 32 lines
Reviewed-by Wojciech Drewek <[email protected]>Quoted 29 lines
--- drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/intel/iavf/iavf_main.c +1
-1@@ -1440,9 +1440,9 @@ void iavf_down(struct iavf_adapter *adapter) adapter->aq_required |=IAVF_FLAG_AQ_DEL_FDIR_FILTER ;if (!list_empty (&adapter->adv_rss_list_head)) adapter->aq_required |=IAVF_FLAG_AQ_DEL_ADV_RSS_CFG ; - adapter->aq_required |=IAVF_FLAG_AQ_DISABLE_QUEUES ; } + adapter->aq_required |=IAVF_FLAG_AQ_DISABLE_QUEUES ;mod_delayed_work (adapter->wq, &adapter->watchdog_task,0 );}--
2.41.0_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Quoted 4 lines
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Romanowski, Rafal
Tested-byRe: [Intel-wired-lan] [PATCH net-next 5/5] iavf: fix the waiting time for initial reset
In reply to Drewek, WojciechQuoted 68 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Drewek, Wojciech
Sent: Tuesday, October 10, 2023 1:43 PM
To: mschmidt <[email protected]>; [email protected]
Cc: Radoslaw Tyl <[email protected]>; Nguyen, Anthony L <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: Re: [Intel-wired-lan] [PATCH net-next 5/5] iavf: fix the waiting time for initial resetQuoted 25 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Michal Schmidt
Sent: Tuesday, October 10, 2023 2:25 AM
To: [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Radoslaw Tyl <[email protected]>; Brandeburg, Jesse <[email protected]>
Subject: [Intel-wired-lan] [PATCH net-next 5/5] iavf: fix the waiting time for initial resetEvery time I create VFs on ice, I receive at least one "Device is still in reset (-16), retrying" message per VF. It recovers fine, but typical usecases should not trigger scary-looking messages.
The waiting for reset is too short. It makes no sense to check every 10 microseconds. Typical reset waiting times are at least tens of milliseconds and can be several seconds. I suspect the polling interval was meant to be 10 milliseconds all along.
IAVF_RESET_WAIT_COMPLETE_COUNTis defined as 2000, so the total waiting time could be over 20 seconds. I have seen resets take 5 seconds (with
128 VFs on ice).Quoted 5 lines
The added benefit of not triggering the "Device is still in reset" path is that we avoid going through the
__IAVF_INIT_FAILEDstate, which would take a full second before retrying.Signed-off-by Michal Schmidt <[email protected]>Reviewed-by Wojciech Drewek <[email protected]>Quoted 22 lines
--- drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/intel/iavf/iavf_main.c +1
-1@@ -4791,7 +4791,7 @@ static int iavf_check_reset_complete(struct iavf_hw *hw)if ((rstat ==VIRTCHNL_VFR_VFACTIVE ) || (rstat ==VIRTCHNL_VFR_COMPLETED ))return 0 ; -usleep_range (10 ,20 ); +msleep (IAVF_RESET_WAIT_MS ); }return -EBUSY ;}
--
2.41.0
Quoted 8 lines
Quoted 4 lines
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan