Message ID | 20230412081929.173220-7-mschmidt@redhat.com (mailing list archive) |
---|---|
State | Awaiting Upstream |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | ice: lower CPU usage with GNSS | expand |
>From: Michal Schmidt <mschmidt@redhat.com> >Sent: Wednesday, April 12, 2023 10:19 AM > >10 ms is a lot of time to spend busy-waiting. Sleeping is clearly >allowed here, because we have just returned from ice_sq_send_cmd(), >which takes a mutex. > >On kernels with HZ=100, this msleep may be twice as long, but I don't >think it matters. >I did not actually observe any retries happening here. > >Signed-off-by: Michal Schmidt <mschmidt@redhat.com> >--- > drivers/net/ethernet/intel/ice/ice_common.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/drivers/net/ethernet/intel/ice/ice_common.c >b/drivers/net/ethernet/intel/ice/ice_common.c >index c6200564304e..0157f6e98d3e 100644 >--- a/drivers/net/ethernet/intel/ice/ice_common.c >+++ b/drivers/net/ethernet/intel/ice/ice_common.c >@@ -1643,7 +1643,7 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, struct >ice_ctl_q_info *cq, > > memcpy(desc, &desc_cpy, sizeof(desc_cpy)); > >- mdelay(ICE_SQ_SEND_DELAY_TIME_MS); >+ msleep(ICE_SQ_SEND_DELAY_TIME_MS); > > } while (++idx < ICE_SQ_SEND_MAX_EXECUTE); > >-- >2.39.2 Looks good, thank you Michal! Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
On Wed, Apr 12, 2023 at 10:19:29AM +0200, Michal Schmidt wrote: > 10 ms is a lot of time to spend busy-waiting. Sleeping is clearly > allowed here, because we have just returned from ice_sq_send_cmd(), > which takes a mutex. > > On kernels with HZ=100, this msleep may be twice as long, but I don't > think it matters. > I did not actually observe any retries happening here. > > Signed-off-by: Michal Schmidt <mschmidt@redhat.com> Reviewed-by: Simon Horman <simon.horman@corigine.com>
> -----Original Message----- > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Michal Schmidt > Sent: Wednesday, April 12, 2023 1:19 AM > To: intel-wired-lan@lists.osuosl.org > Cc: Andrew Lunn <andrew@lunn.ch>; netdev@vger.kernel.org; Brandeburg, Jesse <jesse.brandeburg@intel.com>; Kolacinski, Karol <karol.kolacinski@intel.com>; Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Simon Horman <simon.horman@corigine.com> > Subject: [Intel-wired-lan] [PATCH net-next v2 6/6] ice: sleep, don't busy-wait, in the SQ send retry loop > > 10 ms is a lot of time to spend busy-waiting. Sleeping is clearly allowed here, because we have just returned from ice_sq_send_cmd(), which takes a mutex. > > On kernels with HZ=100, this msleep may be twice as long, but I don't think it matters. > I did not actually observe any retries happening here. > > Signed-off-by: Michal Schmidt <mschmidt@redhat.com> > --- > drivers/net/ethernet/intel/ice/ice_common.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Tested-by: Sunitha Mekala <sunithax.d.mekala@intel.com> (A Contingent worker at Intel)
diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c index c6200564304e..0157f6e98d3e 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -1643,7 +1643,7 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, struct ice_ctl_q_info *cq, memcpy(desc, &desc_cpy, sizeof(desc_cpy)); - mdelay(ICE_SQ_SEND_DELAY_TIME_MS); + msleep(ICE_SQ_SEND_DELAY_TIME_MS); } while (++idx < ICE_SQ_SEND_MAX_EXECUTE);
10 ms is a lot of time to spend busy-waiting. Sleeping is clearly allowed here, because we have just returned from ice_sq_send_cmd(), which takes a mutex. On kernels with HZ=100, this msleep may be twice as long, but I don't think it matters. I did not actually observe any retries happening here. Signed-off-by: Michal Schmidt <mschmidt@redhat.com> --- drivers/net/ethernet/intel/ice/ice_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)