lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z7YbBQqT4wOtmbgC@LQ3V64L9R2>
Date: Wed, 19 Feb 2025 12:55:17 -0500
From: Joe Damato <jdamato@...tly.com>
To: Kurt Kanzenbach <kurt@...utronix.de>
Cc: Tony Nguyen <anthony.l.nguyen@...el.com>,
	Przemek Kitszel <przemyslaw.kitszel@...el.com>,
	Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
	Gerhard Engleder <gerhard@...leder-embedded.com>,
	intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org
Subject: Re: [PATCH iwl-next v2 2/4] igb: Link queues to NAPI instances

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@...utronix.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@...tly.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ