netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Kurt Kanzenbach <kurt@linutronix.de>,
	Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org
Subject: Re: [PATCH iwl-next] igc: Get rid of spurious interrupts
Date: Thu, 13 Jun 2024 10:22:35 -0700	[thread overview]
Message-ID: <87ikycwyec.fsf@intel.com> (raw)
In-Reply-To: <20240613062426.Om5bQpR3@linutronix.de>

Sebastian Andrzej Siewior <bigeasy@linutronix.de> writes:

> On 2024-06-12 12:49:21 [-0700], Vinicius Costa Gomes wrote:
>> > diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
>> > index 305e05294a26..e666739dfac7 100644
>> > --- a/drivers/net/ethernet/intel/igc/igc_main.c
>> > +++ b/drivers/net/ethernet/intel/igc/igc_main.c
>> > @@ -5811,11 +5815,23 @@ static void igc_watchdog_task(struct work_struct *work)
>> >  	if (adapter->flags & IGC_FLAG_HAS_MSIX) {
>> >  		u32 eics = 0;
>> >  
>> > -		for (i = 0; i < adapter->num_q_vectors; i++)
>> > -			eics |= adapter->q_vector[i]->eims_value;
>> > -		wr32(IGC_EICS, eics);
>> > +		for (i = 0; i < adapter->num_q_vectors; i++) {
>> > +			struct igc_ring *rx_ring = adapter->rx_ring[i];
>> > +
>> > +			if (test_bit(IGC_RING_FLAG_RX_ALLOC_FAILED, &rx_ring->flags)) {
>> 
>> Minor and optional: I guess you can replace test_bit() -> clear_bit()
>> with __test_and_clear_bit() here and below.
>
> That are two steps, first test+clear is merged into one and then __ is
> added. The former is doable but it will always lead to a write operation
> while in the common case the flag isn't set so it will be skipped.
> Adding the __ leads to an unlocked operation and I don't see how this is
> synchronized against the other writes. In fact, nobody else is doing it.
>

I just took a look at the available operations, and thought that this
one could save a few lines of code. But didn't think too deeply about
that. Thanks.


Cheers,
-- 
Vinicius

  reply	other threads:[~2024-06-13 17:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-12  9:24 [PATCH iwl-next] igc: Get rid of spurious interrupts Kurt Kanzenbach
2024-06-12  9:28 ` Sebastian Andrzej Siewior
2024-06-12 12:56 ` Maciej Fijalkowski
2024-06-12 19:49 ` Vinicius Costa Gomes
2024-06-13  6:24   ` Sebastian Andrzej Siewior
2024-06-13 17:22     ` Vinicius Costa Gomes [this message]
2024-06-20 14:34 ` Kurt Kanzenbach
2024-06-20 16:07   ` 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=87ikycwyec.fsf@intel.com \
    --to=vinicius.gomes@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=bigeasy@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=maciej.fijalkowski@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).