netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: davem@davemloft.net, pabeni@redhat.com, edumazet@google.com,
	netdev@vger.kernel.org,
	Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>,
	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: Wed, 10 May 2023 19:14:28 -0700	[thread overview]
Message-ID: <20230510191428.75efff66@kernel.org> (raw)
In-Reply-To: <20230509170935.2237051-2-anthony.l.nguyen@intel.com>

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.
-- 
pw-bot: cr

  reply	other threads:[~2023-05-11  2:14 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 [this message]
2023-05-12  8:51     ` Zulkifli, Muhammad Husaini
2023-05-12 15:30       ` Maciej Fijalkowski
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=20230510191428.75efff66@kernel.org \
    --to=kuba@kernel.org \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --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).