All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Tan Tee Min <tee.min.tan@linux.intel.com>
Cc: Richard Cochran <richardcochran@gmail.com>,
	Tan Tee Min <tee.min.tan@intel.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S . Miller" <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Rayagond Kokatanur <rayagond@vayavyalabs.com>,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Voon Wei Feng <weifeng.voon@intel.com>,
	Wong Vee Khee <vee.khee.wong@intel.com>,
	Song Yoong Siang <yoong.siang.song@intel.com>
Subject: Re: [PATCH net 1/1] net: stmmac: add fsleep() in HW Rx timestamp checking loop
Date: Thu, 14 Apr 2022 10:42:59 +0200	[thread overview]
Message-ID: <20220414104259.0b928249@kernel.org> (raw)
In-Reply-To: <20220414072934.GA10025@linux.intel.com>

On Thu, 14 Apr 2022 15:29:34 +0800 Tan Tee Min wrote:
> > > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
> > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
> > > @@ -279,10 +279,11 @@ static int dwmac4_wrback_get_rx_timestamp_status(void *desc, void *next_desc,
> > >  			/* Check if timestamp is OK from context descriptor */
> > >  			do {
> > >  				ret = dwmac4_rx_check_timestamp(next_desc);
> > > -				if (ret < 0)
> > > +				if (ret <= 0)
> > >  					goto exit;
> > >  				i++;
> > >  
> > > +				fsleep(1);  
> > 
> > This is nutty.  Why isn't this code using proper deferral mechanisms
> > like work or kthread?  
> 
> Appreciate your comment.
> The dwmac4_wrback_get_rx_timestamp_status() is called by stmmac_rx()
> function which is scheduled by NAPI framework.
> Do we still need to create deferred work inside NAPI work?
> Would you mind to explain it more in detail?

fsleep() is a big hammer, can you try cpu_relax() and bumping the max
loop count a little?

WARNING: multiple messages have this Message-ID (diff)
From: Jakub Kicinski <kuba@kernel.org>
To: Tan Tee Min <tee.min.tan@linux.intel.com>
Cc: Richard Cochran <richardcochran@gmail.com>,
	Tan Tee Min <tee.min.tan@intel.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S . Miller" <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Rayagond Kokatanur <rayagond@vayavyalabs.com>,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Voon Wei Feng <weifeng.voon@intel.com>,
	Wong Vee Khee <vee.khee.wong@intel.com>,
	Song Yoong Siang <yoong.siang.song@intel.com>
Subject: Re: [PATCH net 1/1] net: stmmac: add fsleep() in HW Rx timestamp checking loop
Date: Thu, 14 Apr 2022 10:42:59 +0200	[thread overview]
Message-ID: <20220414104259.0b928249@kernel.org> (raw)
In-Reply-To: <20220414072934.GA10025@linux.intel.com>

On Thu, 14 Apr 2022 15:29:34 +0800 Tan Tee Min wrote:
> > > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
> > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
> > > @@ -279,10 +279,11 @@ static int dwmac4_wrback_get_rx_timestamp_status(void *desc, void *next_desc,
> > >  			/* Check if timestamp is OK from context descriptor */
> > >  			do {
> > >  				ret = dwmac4_rx_check_timestamp(next_desc);
> > > -				if (ret < 0)
> > > +				if (ret <= 0)
> > >  					goto exit;
> > >  				i++;
> > >  
> > > +				fsleep(1);  
> > 
> > This is nutty.  Why isn't this code using proper deferral mechanisms
> > like work or kthread?  
> 
> Appreciate your comment.
> The dwmac4_wrback_get_rx_timestamp_status() is called by stmmac_rx()
> function which is scheduled by NAPI framework.
> Do we still need to create deferred work inside NAPI work?
> Would you mind to explain it more in detail?

fsleep() is a big hammer, can you try cpu_relax() and bumping the max
loop count a little?

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-04-14  8:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13  4:01 [PATCH net 1/1] net: stmmac: add fsleep() in HW Rx timestamp checking loop Tan Tee Min
2022-04-13  4:01 ` Tan Tee Min
2022-04-13 12:59 ` Richard Cochran
2022-04-13 12:59   ` Richard Cochran
2022-04-14  7:29   ` Tan Tee Min
2022-04-14  7:29     ` Tan Tee Min
2022-04-14  8:42     ` Jakub Kicinski [this message]
2022-04-14  8:42       ` Jakub Kicinski
2022-04-19  0:52       ` Tan Tee Min
2022-04-19  0:52         ` Tan Tee Min
2022-04-19 13:28         ` Richard Cochran
2022-04-19 13:28           ` Richard Cochran
2022-04-20  5:15           ` Tan Tee Min
2022-04-20  5:15             ` Tan Tee Min
2022-04-20 12:54             ` Richard Cochran
2022-04-20 12:54               ` Richard Cochran

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=20220414104259.0b928249@kernel.org \
    --to=kuba@kernel.org \
    --cc=alexandre.torgue@st.com \
    --cc=davem@davemloft.net \
    --cc=joabreu@synopsys.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    --cc=rayagond@vayavyalabs.com \
    --cc=richardcochran@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=tee.min.tan@intel.com \
    --cc=tee.min.tan@linux.intel.com \
    --cc=vee.khee.wong@intel.com \
    --cc=weifeng.voon@intel.com \
    --cc=yoong.siang.song@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.