netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: "Zulkifli, Muhammad Husaini" <muhammad.husaini.zulkifli@intel.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
	"Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"edumazet@google.com" <edumazet@google.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Neftin, Sasha" <sasha.neftin@intel.com>,
	Naama Meir <naamax.meir@linux.intel.com>
Subject: Re: [PATCH net 1/3] igc: Clean the TX buffer and TX descriptor ring
Date: Fri, 12 May 2023 17:30:26 +0200	[thread overview]
Message-ID: <ZF5bkhhs+Ue+DZfG@boxer> (raw)
In-Reply-To: <SJ1PR11MB6180BBD70342998B2C639472B8759@SJ1PR11MB6180.namprd11.prod.outlook.com>

On Fri, May 12, 2023 at 08:51:23AM +0000, Zulkifli, Muhammad Husaini wrote:
> Hi Jakub,
> 
> > On Tue,  9 May 2023 10:09:33 -0700 Tony Nguyen wrote:
> > > There could be a race condition during link down where interrupt being
> > > generated and igc_clean_tx_irq() been called to perform the TX
> > > completion. Properly clear the TX buffer and TX descriptor ring to
> > > avoid those case.
> > 
> > > +	/* Zero out the buffer ring */
> > > +	memset(tx_ring->tx_buffer_info, 0,
> > > +	       sizeof(*tx_ring->tx_buffer_info) * tx_ring->count);
> > > +
> > > +	/* Zero out the descriptor ring */
> > > +	memset(tx_ring->desc, 0, tx_ring->size);
> > 
> > Just from the diff and the commit description this does not seem obviously
> > correct. Race condition means the two functions can run at the same time,
> > and memset() is not atomic.
> 
> While a link is going up or down and a lot of packets(UDP) are being sent transmitted, 
> we are observing some kernel panic issues. On my side, it was easily to reproduce.
> It's possible that igc_clean_tx_irq() was called to complete the TX during link up/down 
> based on how the call trace looks. With this fix, I not observed the issue anymore.

then include the splat you were getting in the commit msg as well as steps
to repro.

from a brief look it looks like ndo_stop() path does not disable Tx rings
before cleaning them? This is being done when configuring xsk_pool on a
given Tx ring, though.

> 
> Almost similar issue reported before in here:
> https://lore.kernel.org/all/SJ1PR11MB6180CDB866753CFBC2F9AF75B8959@SJ1PR11MB6180.namprd11.prod.outlook.com/
> 
> > --
> > pw-bot: cr
> 

  reply	other threads:[~2023-05-12 15:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09 17:09 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2023-05-09 (igc, igb) Tony Nguyen
2023-05-09 17:09 ` [PATCH net 1/3] igc: Clean the TX buffer and TX descriptor ring Tony Nguyen
2023-05-11  2:14   ` Jakub Kicinski
2023-05-12  8:51     ` Zulkifli, Muhammad Husaini
2023-05-12 15:30       ` Maciej Fijalkowski [this message]
2023-05-15  3:30         ` Zulkifli, Muhammad Husaini
2023-05-09 17:09 ` [PATCH net 2/3] igc: Fix possible system crash when loading module Tony Nguyen
2023-05-09 17:09 ` [PATCH net 3/3] igb: fix nvm.ops.read() error handling Tony Nguyen

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=ZF5bkhhs+Ue+DZfG@boxer \
    --to=maciej.fijalkowski@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=muhammad.husaini.zulkifli@intel.com \
    --cc=naamax.meir@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sasha.neftin@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).