linux-rt-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: intel-wired-lan@lists.osuosl.org, linux-rt-devel@lists.linux.dev
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Clark Williams <clrkwllms@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Wander Lairson Costa <wander@redhat.com>
Subject: [PATCH] igb: Request igb_msix_other as a threaded interrupt handler
Date: Wed, 30 Apr 2025 16:44:52 +0200	[thread overview]
Message-ID: <20250430144452.8zcAZc29@linutronix.de> (raw)

Wander reported that performing a SR-IOV setup on PREEMPT_RT can fail/
timeout.
The reason is that during the setup the VF device performs a reset
(igbvf_reset()) and polls for an ACK (e1000_reset_hw_vf() ->
e1000_check_for_ack_vf()) with disabled bottom halves. For the ACK to
complete it is required for the igb_msix_other() interrupt handler to
run.
The interrupt handler is forced-threaded on PREEMPT_RT and therefore
delayed until after bottom halves are enabled again. This happens only
after e1000_reset_hw_vf() times out. This scenario requires that the
interrupt handler and the reset handler run on the same CPU.
This scenario is not limited to PREEMPT_RT but can also happen without
PREEMPT_RT if the interrupts are forced threaded via `threadirqs'.
Setups without forced threaded interrupts are not affected.

The interrupt handler (igb_msix_other()) does not require bottom halves
to be disabled. It does not call into the network stack which would
mandate it. Requesting the handler explicit as a threaded interrupt will
not disable bottom halves prior invocation of the handler thus avoiding
the scenario.

Request igb_msix_other as a threaded interrupt handler.

Reported-by: Wander Lairson Costa <wander@redhat.com>
Closes: https://lore.kernel.org/all/20240920185918.616302-2-wander@redhat.com/
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---

I've been sitting on this one for a while. While this avoids the timeout
on a PREEMPT_RT setup, the !PREEMPT_RT + threadirqs setup remains
affected. The difference is that PREEMPT_RT allows a context switch
within a local_bh_disable() section while !PREEMPT_RT does not.

Allowing e1000_reset_hw_vf() to run/ wait/ poll without
e1000_hw::mbx_lock, which disable BH, should fix both setups.

 drivers/net/ethernet/intel/igb/igb_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index c646c71915f03..0827e8dcd9de7 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -912,8 +912,8 @@ static int igb_request_msix(struct igb_adapter *adapter)
 	struct net_device *netdev = adapter->netdev;
 	int i, err = 0, vector = 0, free_vector = 0;
 
-	err = request_irq(adapter->msix_entries[vector].vector,
-			  igb_msix_other, 0, netdev->name, adapter);
+	err = request_threaded_irq(adapter->msix_entries[vector].vector,
+				   igb_msix_other, 0, netdev->name, adapter);
 	if (err)
 		goto err_out;
 
-- 
2.49.0


             reply	other threads:[~2025-04-30 14:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-30 14:44 Sebastian Andrzej Siewior [this message]
2025-05-02  2:57 ` [Intel-wired-lan] [PATCH] igb: Request igb_msix_other as a threaded interrupt handler kernel test robot
2025-05-05  7:52 ` kernel test robot
2025-05-05 14:46 ` kernel test robot

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=20250430144452.8zcAZc29@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=anthony.l.nguyen@intel.com \
    --cc=clrkwllms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=wander@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).