public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Damato <jdamato@fastly.com>
To: Kurt Kanzenbach <kurt@linutronix.de>
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Gerhard Engleder <gerhard@engleder-embedded.com>,
	intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org
Subject: Re: [PATCH iwl-next v2 2/4] igb: Link queues to NAPI instances
Date: Wed, 19 Feb 2025 12:55:17 -0500	[thread overview]
Message-ID: <Z7YbBQqT4wOtmbgC@LQ3V64L9R2> (raw)
In-Reply-To: <875xl62xgy.fsf@kurt.kurt.home>

On Wed, Feb 19, 2025 at 08:41:01AM +0100, Kurt Kanzenbach wrote:
> On Tue Feb 18 2025, Joe Damato wrote:
> > On Mon, Feb 17, 2025 at 12:31:22PM +0100, Kurt Kanzenbach wrote:
> >> Link queues to NAPI instances via netdev-genl API. This is required to use
> >> XDP/ZC busy polling. See commit 5ef44b3cb43b ("xsk: Bring back busy polling
> >> support") for details.
> >> 
> >> This also allows users to query the info with netlink:
> >> 
> >> |$ ./tools/net/ynl/pyynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
> >> |                               --dump queue-get --json='{"ifindex": 2}'
> >> |[{'id': 0, 'ifindex': 2, 'napi-id': 8201, 'type': 'rx'},
> >> | {'id': 1, 'ifindex': 2, 'napi-id': 8202, 'type': 'rx'},
> >> | {'id': 2, 'ifindex': 2, 'napi-id': 8203, 'type': 'rx'},
> >> | {'id': 3, 'ifindex': 2, 'napi-id': 8204, 'type': 'rx'},
> >> | {'id': 0, 'ifindex': 2, 'napi-id': 8201, 'type': 'tx'},
> >> | {'id': 1, 'ifindex': 2, 'napi-id': 8202, 'type': 'tx'},
> >> | {'id': 2, 'ifindex': 2, 'napi-id': 8203, 'type': 'tx'},
> >> | {'id': 3, 'ifindex': 2, 'napi-id': 8204, 'type': 'tx'}]
> >> 
> >> Add rtnl locking to PCI error handlers, because netif_queue_set_napi()
> >> requires the lock held.
> >> 
> >> While at __igb_open() use RCT coding style.
> >> 
> >> Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
> >> ---
> >>  drivers/net/ethernet/intel/igb/igb.h      |  2 ++
> >>  drivers/net/ethernet/intel/igb/igb_main.c | 43 +++++++++++++++++++++++++++----
> >>  drivers/net/ethernet/intel/igb/igb_xsk.c  |  2 ++
> >>  3 files changed, 42 insertions(+), 5 deletions(-)
> >
> > [...]
> >
> >> @@ -9737,16 +9765,21 @@ static void igb_io_resume(struct pci_dev *pdev)
> >>  	struct net_device *netdev = pci_get_drvdata(pdev);
> >>  	struct igb_adapter *adapter = netdev_priv(netdev);
> >>  
> >> +	rtnl_lock();
> >>  	if (netif_running(netdev)) {
> >>  		if (!test_bit(__IGB_DOWN, &adapter->state)) {
> >>  			dev_dbg(&pdev->dev, "Resuming from non-fatal error, do nothing.\n");
> >> +			rtnl_unlock();
> >>  			return;
> >>  		}
> >> +
> >>  		if (igb_up(adapter)) {
> >>  			dev_err(&pdev->dev, "igb_up failed after reset\n");
> >> +			rtnl_unlock();
> >>  			return;
> >>  		}
> >>  	}
> >> +	rtnl_unlock();
> >
> > Does RTNL need to be held when calling netif_running()? If not, you
> > could probably reduce the size of the section under the lock a bit?
> 
> All the other instances in the driver guard the netif_running(), too.

OK, I spent a bit of time tracing through the paths in the igb
source. I think the v1 feedback I sent identified all the RTNL
paths, but: 
  - I am not an igb expert
  - I don't have a device to test this on
  - It is certainly possible I missed a path in my v1 analysis

The above said, as far as I can tell this patch seems fine, so:

Acked-by: Joe Damato <jdamato@fastly.com>

  reply	other threads:[~2025-02-19 17:55 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-17 11:31 [PATCH iwl-next v2 0/4] igb: XDP/ZC follow up Kurt Kanzenbach
2025-02-17 11:31 ` [PATCH iwl-next v2 1/4] igb: Link IRQs to NAPI instances Kurt Kanzenbach
2025-02-28  9:00   ` [Intel-wired-lan] " Rinitha, SX
2025-02-17 11:31 ` [PATCH iwl-next v2 2/4] igb: Link queues " Kurt Kanzenbach
2025-02-18 21:13   ` Joe Damato
2025-02-19  7:41     ` Kurt Kanzenbach
2025-02-19 17:55       ` Joe Damato [this message]
2025-02-20  7:43         ` Kurt Kanzenbach
2025-02-28  9:00   ` [Intel-wired-lan] " Rinitha, SX
2025-03-07 22:03   ` Tony Nguyen
2025-03-10  8:34     ` Joe Damato
2025-03-10 16:10       ` Kurt Kanzenbach
2025-02-17 11:31 ` [PATCH iwl-next v2 3/4] igb: Add support for persistent NAPI config Kurt Kanzenbach
2025-02-18 21:15   ` Joe Damato
2025-02-21 13:51     ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-02-28  9:00   ` Rinitha, SX
2025-02-17 11:31 ` [PATCH iwl-next v2 4/4] igb: Get rid of spurious interrupts Kurt Kanzenbach
2025-02-21 12:44   ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-03-07 10:26   ` Kumari, Sweta
2025-02-18 21:18 ` [PATCH iwl-next v2 0/4] igb: XDP/ZC follow up Joe Damato
2025-02-18 22:00   ` Joe Damato
2025-02-19 14:03     ` Kurt Kanzenbach
2025-02-19 17:51       ` Joe Damato
2025-02-20  7:44         ` Kurt Kanzenbach
2025-02-19  7:39   ` Kurt Kanzenbach
2025-02-20  2:06     ` Jakub Kicinski
2025-02-21 20:53       ` Joe Damato
2025-02-21 22:26         ` Jakub Kicinski

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=Z7YbBQqT4wOtmbgC@LQ3V64L9R2 \
    --to=jdamato@fastly.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=bigeasy@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gerhard@engleder-embedded.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@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