Netdev List
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Jiawen Wu <jiawenwu@trustnetic.com>
Cc: netdev@vger.kernel.org, mengyuanlou@net-swift.com,
	andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com,
	linux@armlinux.org.uk, aleksandr.loktionov@intel.com,
	jacob.e.keller@intel.com, michal.swiatkowski@linux.intel.com,
	kees@kernel.org, joe@dama.to, leitao@debian.org,
	shaojijie@huawei.com, u.kleine-koenig@baylibre.com,
	weirongguang@kylinos.cn, larysa.zaremba@intel.com,
	fabio.baltieri@gmail.com
Subject: Re: [PATCH net-next v10 5/5] net: wangxun: add pcie error handler
Date: Fri, 17 Jul 2026 12:40:56 +0100	[thread overview]
Message-ID: <20260717114056.GN95246@horms.kernel.org> (raw)
In-Reply-To: <0ecb01dd14f0$17488c80$45d9a580$@trustnetic.com>

On Thu, Jul 16, 2026 at 02:55:30PM +0800, Jiawen Wu wrote:
> On Tue, Jul 14, 2026 5:11 PM, Simon Horman wrote:
> > This is an AI-generated review of your patch. The human sending this
> > email has considered the AI review valid, or at least plausible.
> > Full review at: https://sashiko.dev
> > ---
> > --- Patch [5]: [PATCH net-next v10 5/5] net: wangxun: add pcie error handler ---
> > commit 91baa4e77d07ab6772569a7d37ed86cfda625c00
> > Author: Jiawen Wu <jiawenwu@trustnetic.com>
> > Subject: net: wangxun: add pcie error handler
> > 
> > This commit adds PCIe error handling support (AER) to the wangxun drivers
> > (ngbe and txgbe). It detects hardware errors, attempts to soft quiesce,
> > and registers standard PCI error handler callbacks.
> > 
> > > diff --git a/drivers/net/ethernet/wangxun/libwx/wx_err.c b/drivers/net/ethernet/wangxun/libwx/wx_err.c
> > > index ee27f96735dc7..0cb99e456a1c9 100644
> > > --- a/drivers/net/ethernet/wangxun/libwx/wx_err.c
> > > +++ b/drivers/net/ethernet/wangxun/libwx/wx_err.c
> > 
> > [ ... ]
> > 
> > > +static void wx_io_resume(struct pci_dev *pdev)
> > > +{
> > > +	struct wx *wx = pci_get_drvdata(pdev);
> > > +	struct net_device *netdev;
> > > +	int err;
> > > +
> > > +	netdev = wx->netdev;
> > > +	rtnl_lock();
> > > +	if (netif_running(netdev)) {
> > > +		err = netdev->netdev_ops->ndo_open(netdev);
> > 
> > [Severity: High]
> > Does this sequence risk corrupting the hw_tc_lock seqlock?
> > 
> > During AER recovery, wx_io_slot_reset() calls down_suspend(), which bypasses
> > wx_ptp_stop(). This leaves the PTP clock registered and potentially in use by
> > userspace.
> > 
> > When wx_io_resume() then calls ndo_open(), this triggers txgbe_up() or
> > ngbe_up(), which in turn calls wx_ptp_init(). Since wx_ptp_init()
> > unconditionally calls seqlock_init(&wx->hw_tc_lock), won't this corrupt the
> > lock if userspace is actively issuing PTP ioctls?
> 
> PTP clock was destroyed in wx_ptp_quiesce() before V8 patch set.  The
> piece of code was removed based on the Sashiko's comment.  I think it
> should be added back because the order of the calls in wx_soft_quiesce()
> has been changed.

Thanks.

> 
> > 
> > > +		if (err) {
> > > +			wx_err(wx, "Failed to open netdev after reset\n");
> > 
> > [ ... ]
> > 
> > > diff --git a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
> > > index 92895f5035118..56d4b63387fd6 100644
> > > --- a/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
> > > +++ b/drivers/net/ethernet/wangxun/ngbe/ngbe_main.c
> > 
> > [ ... ]
> > 
> > > @@ -413,6 +428,9 @@ static void ngbe_disable_device(struct wx *wx)
> > >
> > >  static void ngbe_reset(struct wx *wx)
> > >  {
> > > +	if (test_bit(WX_FLAG_NEED_PCIE_RECOVERY, wx->flags))
> > > +		return;
> > > +
> > >  	wx_flush_sw_mac_table(wx);
> > 
> > [Severity: High]
> > Is the hardware properly reinitialized here after an AER slot reset?
> > 
> > In wx_io_slot_reset(), the hardware needs to be restarted from scratch.
> > While txgbe_reset() calls txgbe_reset_hw(), ngbe_reset() only flushes the
> > software MAC tables and skips calling ngbe_reset_hw().
> > 
> > Because this patch registers wx_err_handler for the ngbe driver, won't this
> > leave the hardware uninitialized and the interface broken after a PCIe slot
> > reset?
> 
> I think I have answered this question many times and also described
> ngbe's lack of functionality in the commit and cover-letter messages.

Sorry about that, I missed that this is already covered.

...

      reply	other threads:[~2026-07-17 11:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-07  6:14 [PATCH net-next v10 0/5] net: wangxun: timeout and error Jiawen Wu
2026-07-07  6:14 ` [PATCH net-next v10 1/5] net: ngbe: implement libwx reset ops Jiawen Wu
2026-07-07  6:14 ` [PATCH net-next v10 2/5] net: wangxun: add Tx timeout process Jiawen Wu
2026-07-07  6:14 ` [PATCH net-next v10 3/5] net: wangxun: add reinit parameter to wx->do_reset callback Jiawen Wu
2026-07-07  6:14 ` [PATCH net-next v10 4/5] net: wangxun: implement soft quiesce for PCIe error recovery Jiawen Wu
2026-07-14  9:11   ` Simon Horman
2026-07-14  9:43     ` Jiawen Wu
2026-07-07  6:14 ` [PATCH net-next v10 5/5] net: wangxun: add pcie error handler Jiawen Wu
2026-07-14  9:11   ` Simon Horman
2026-07-16  6:55     ` Jiawen Wu
2026-07-17 11:40       ` Simon Horman [this message]

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=20260717114056.GN95246@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fabio.baltieri@gmail.com \
    --cc=jacob.e.keller@intel.com \
    --cc=jiawenwu@trustnetic.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.swiatkowski@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=shaojijie@huawei.com \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=weirongguang@kylinos.cn \
    /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