netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Ding Hui <dinghui@sangfor.com.cn>
Cc: "Loktionov, Aleksandr" <aleksandr.loktionov@intel.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
	"Kitszel, Przemyslaw" <przemyslaw.kitszel@intel.com>,
	"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"Keller, Jacob E" <jacob.e.keller@intel.com>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"intel-wired-lan@lists.osuosl.org"
	<intel-wired-lan@lists.osuosl.org>
Subject: Re: [Intel-wired-lan] [PATCH net-next] ice: Fix incorrect timeout in ice_release_res()
Date: Sat, 6 Dec 2025 09:46:43 +0000	[thread overview]
Message-ID: <aTP7g5lmRMF5YtQO@horms.kernel.org> (raw)
In-Reply-To: <1188a9d2-a895-478b-9474-0fb84b4e2636@sangfor.com.cn>

On Sat, Dec 06, 2025 at 10:42:36AM +0800, Ding Hui wrote:
> On 2025/12/6 5:09, Loktionov, Aleksandr wrote:
> > 
> > 
> > > -----Original Message-----
> > > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> > > Of Ding Hui
> > > Sent: Friday, December 5, 2025 9:16 AM
> > > To: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Kitszel,
> > > Przemyslaw <przemyslaw.kitszel@intel.com>; andrew+netdev@lunn.ch;
> > > davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> > > pabeni@redhat.com; Keller, Jacob E <jacob.e.keller@intel.com>; intel-
> > > wired-lan@lists.osuosl.org
> > > Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Ding, Hui
> > > <dinghui@sangfor.com.cn>
> > > Subject: [Intel-wired-lan] [PATCH net-next] ice: Fix incorrect timeout
> > > in ice_release_res()
> > > 
> > > The commit 5f6df173f92e ("ice: implement and use rd32_poll_timeout for
> > > ice_sq_done timeout") converted ICE_CTL_Q_SQ_CMD_TIMEOUT from jiffies
> > > to microseconds.
> > > 
> > > But the ice_release_res() function was missed, and its logic still
> > > treats ICE_CTL_Q_SQ_CMD_TIMEOUT as a jiffies value.
> > > 
> > > So correct the issue by usecs_to_jiffies().
> > > 
> > 
> > Please add a brief "how verified" paragraph (platform + steps).
> > This is a unit-conversion fix in a timeout path; a short test description helps reviewers and stable backports validate the change.
> > 
> Sorry for not being able to provide the verification information, as
> I haven't actually encountered this issue.
> 
> The ice_release_res() is almost always invoked during downloading DDP
> when modprobe ice.
> 
> IMO, it seems like that only when the NIC hardware or firmware enters
> a bad state causing single command to fail or timeout (1 second), and
> then here do the retry logic (10 senconds).
> 
> So it's hard to validate on healthy NIC, maybe inject faults in low level
> function, such as ice_sq_send_cmd().

In that case I would suggest adding something like this:

Found by inspection (or static analysis, or a specific tool if publicly
available, ...).
Compile tested only.

> 
> > And you can add my:
> > Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> > 
> > 
> > > Fixes: 5f6df173f92e ("ice: implement and use rd32_poll_timeout for
> > > ice_sq_done timeout")
> > > Signed-off-by: Ding Hui <dinghui@sangfor.com.cn>
> > > ---
> > >   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 6fb0c1e8ae7c..5005c299deb1 100644
> > > --- a/drivers/net/ethernet/intel/ice/ice_common.c
> > > +++ b/drivers/net/ethernet/intel/ice/ice_common.c
> > > @@ -1885,7 +1885,7 @@ void ice_release_res(struct ice_hw *hw, enum
> > > ice_aq_res_ids res)
> > >   	/* there are some rare cases when trying to release the
> > > resource
> > >   	 * results in an admin queue timeout, so handle them correctly
> > >   	 */
> > > -	timeout = jiffies + 10 * ICE_CTL_Q_SQ_CMD_TIMEOUT;
> > > +	timeout = jiffies + 10 *
> > > usecs_to_jiffies(ICE_CTL_Q_SQ_CMD_TIMEOUT);
> > >   	do {
> > >   		status = ice_aq_release_res(hw, res, 0, NULL);
> > >   		if (status != -EIO)
> > > --
> > > 2.17.1
> > 
> > 
> > 
> 
> -- 
> Thanks,
> - Ding Hui
> 
> 

  reply	other threads:[~2025-12-06  9:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-05  8:16 [PATCH net-next] ice: Fix incorrect timeout in ice_release_res() Ding Hui
2025-12-05 16:16 ` Simon Horman
2025-12-06  1:50   ` Ding Hui
2025-12-05 21:09 ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-12-06  2:42   ` Ding Hui
2025-12-06  9:46     ` Simon Horman [this message]
2025-12-06 13:08       ` Ding Hui

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=aTP7g5lmRMF5YtQO@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=dinghui@sangfor.com.cn \
    --cc=edumazet@google.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@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 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).