public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jiawen Wu" <jiawenwu@trustnetic.com>
To: "'Paolo Abeni'" <pabeni@redhat.com>, <netdev@vger.kernel.org>,
	<netdev@vger.kernel.org>
Cc: "'Mengyuan Lou'" <mengyuanlou@net-swift.com>,
	"'Andrew Lunn'" <andrew+netdev@lunn.ch>,
	"'David S. Miller'" <davem@davemloft.net>,
	"'Eric Dumazet'" <edumazet@google.com>,
	"'Jakub Kicinski'" <kuba@kernel.org>,
	"'Richard Cochran'" <richardcochran@gmail.com>,
	"'Russell King'" <linux@armlinux.org.uk>,
	"'Simon Horman'" <horms@kernel.org>,
	"'Jacob Keller'" <jacob.e.keller@intel.com>,
	"'Kees Cook'" <kees@kernel.org>,
	"'Michal Kubiak'" <michal.kubiak@intel.com>,
	"'Joe Damato'" <joe@dama.to>,
	"'Larysa Zaremba'" <larysa.zaremba@intel.com>,
	"'Abdun Nihaal'" <abdun.nihaal@gmail.com>,
	"'Breno Leitao'" <leitao@debian.org>,
	"'Mengyuan Lou'" <mengyuanlou@net-swift.com>,
	"'Andrew Lunn'" <andrew+netdev@lunn.ch>,
	"'David S. Miller'" <davem@davemloft.net>,
	"'Eric Dumazet'" <edumazet@google.com>,
	"'Jakub Kicinski'" <kuba@kernel.org>,
	"'Richard Cochran'" <richardcochran@gmail.com>,
	"'Russell King'" <linux@armlinux.org.uk>,
	"'Simon Horman'" <horms@kernel.org>,
	"'Jacob Keller'" <jacob.e.keller@intel.com>,
	"'Kees Cook'" <kees@kernel.org>,
	"'Michal Kubiak'" <michal.kubiak@intel.com>,
	"'Joe Damato'" <joe@dama.to>,
	"'Larysa Zaremba'" <larysa.zaremba@intel.com>,
	"'Abdun Nihaal'" <abdun.nihaal@gmail.com>,
	"'Breno Leitao'" <leitao@debian.org>
Subject: RE: [PATCH net-next v5 04/11] net: ngbe: improve the reset flow
Date: Tue, 24 Mar 2026 14:40:15 +0800	[thread overview]
Message-ID: <048b01dcbb59$12c201a0$384604e0$@trustnetic.com> (raw)
In-Reply-To: <911c9f2c-ff15-4539-9295-94475b969b2a@redhat.com>

On Thu, Mar 19, 2026 7:26 PM, Paolo Abeni wrote:
> On 3/17/26 8:38 AM, Jiawen Wu wrote:
> > @@ -383,6 +384,12 @@ static void ngbe_disable_device(struct wx *wx)
> >
> >  static void ngbe_reset(struct wx *wx)
> >  {
> > +	int err;
> > +
> > +	err = ngbe_reset_hw(wx);
> > +	if (err)
> > +		wx_err(wx, "Hardware Error: %d\n", err);
> 
> AI review says:
> 
> """
> Andrew Lunn suggested in v1 review that ngbe_reset() should return int
> to propagate error codes to callers, rather than just logging errors
> and continuing. While the response mentioned hardware errors are
> handled in another work queue, should the callers (ngbe_down,
> ngbe_setup_tc, ngbe_do_reset, ngbe_resume) be able to detect and
> handle reset failures?
> 
> Reference:
> https://lore.kernel.org/netdev/4ddc6f7d-ee6f-48a9-857f-a10448815675@lunn.ch/
> """
> 
> There are a few problems with the workqueue approach:
> - AFAICS the workqueue is scheduled on xmit timeouts, which are
> apparenly not directly related to ngbe_reset_hw() failures
> - the worker try to reset again the H/W and unconditionally clears the
> error status, even if such reset fails.
> - ngbe_reset_hw() is supposed to stop interrupt generation; if it fails,
> it looks like that the sequence:
> 
> 	ngbe_down(wx);
> 		// ngbe_reset()
> 	ngbe_up()
> 
> can have very bad consequences (like ring reconf with IRQ enabled).
> 
> I think explicitly propagating and handling the failure here is needed.

To be clear, when ngbe_reset_hw() fails, the hardware is already in a PCIe
error state. In patch set v1, this error will be detected in watchdog, and
do PCIe recovery. But it was removed in v2, so the sequence seems weird.

In the current flow, I'll fix it to return int.



  reply	other threads:[~2026-03-24  6:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-17  7:38 [PATCH net-next v5 00/11] Wangxun improvement and new support Jiawen Wu
2026-03-17  7:38 ` [PATCH net-next v5 01/11] net: ngbe: remove netdev->ethtool->wol_enabled setting Jiawen Wu
2026-03-17  9:46   ` Breno Leitao
2026-03-18 19:59   ` Joe Damato
2026-03-17  7:38 ` [PATCH net-next v5 02/11] net: ngbe: move the WOL functions to libwx Jiawen Wu
2026-03-17  7:38 ` [PATCH net-next v5 03/11] net: ngbe: remove redundant macros Jiawen Wu
2026-03-17  7:38 ` [PATCH net-next v5 04/11] net: ngbe: improve the reset flow Jiawen Wu
2026-03-19 11:25   ` Paolo Abeni
2026-03-24  6:40     ` Jiawen Wu [this message]
2026-03-17  7:38 ` [PATCH net-next v5 05/11] net: wangxun: move reusable PCI driver ops functions into libwx Jiawen Wu
2026-03-17  7:38 ` [PATCH net-next v5 06/11] net: txgbe: add power management support Jiawen Wu
2026-03-17  7:38 ` [PATCH net-next v5 07/11] net: wangxun: move ethtool_ops.set_channels into libwx Jiawen Wu
2026-03-17  7:38 ` [PATCH net-next v5 08/11] net: wangxun: delete service_timer before cancel service_work Jiawen Wu
2026-03-17  7:38 ` [PATCH net-next v5 09/11] net: wangxun: add Tx timeout process Jiawen Wu
2026-03-19 11:31   ` Paolo Abeni
2026-03-17  7:38 ` [PATCH net-next v5 10/11] net: wangxun: improve flow control setting Jiawen Wu
2026-03-17  7:38 ` [PATCH net-next v5 11/11] net: wangxun: implement pci_error_handlers ops Jiawen Wu

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='048b01dcbb59$12c201a0$384604e0$@trustnetic.com' \
    --to=jiawenwu@trustnetic.com \
    --cc=abdun.nihaal@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=joe@dama.to \
    --cc=kees@kernel.org \
    --cc=kuba@kernel.org \
    --cc=larysa.zaremba@intel.com \
    --cc=leitao@debian.org \
    --cc=linux@armlinux.org.uk \
    --cc=mengyuanlou@net-swift.com \
    --cc=michal.kubiak@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.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