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: <SJ0PR11MB58658982D4C335A092538D6F8F112@SJ0PR11MB5865.namprd11.prod.outlook.com>
Date: Tue, 7 Jan 2025 10:10:40 +0000
From: "Romanowski, Rafal" <rafal.romanowski@...el.com>
To: Wander Lairson Costa <wander@...hat.com>, "Nguyen, Anthony L"
	<anthony.l.nguyen@...el.com>, "Kitszel, Przemyslaw"
	<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>, Clark Williams
	<clrkwllms@...nel.org>, Steven Rostedt <rostedt@...dmis.org>, Auke Kok
	<auke-jan.h.kok@...el.com>, Jeff Garzik <jgarzik@...hat.com>, "moderated
 list:INTEL ETHERNET DRIVERS" <intel-wired-lan@...ts.osuosl.org>, "open
 list:NETWORKING DRIVERS" <netdev@...r.kernel.org>, open list
	<linux-kernel@...r.kernel.org>, "open list:Real-time Linux
 (PREEMPT_RT):Keyword:PREEMPT_RT" <linux-rt-devel@...ts.linux.dev>
CC: Yuying Ma <yuma@...hat.com>
Subject: RE: [Intel-wired-lan] [PATCH iwl-net 4/4] igb: fix igb_msix_other()
 handling for PREEMPT_RT

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf Of
> Wander Lairson Costa
> Sent: Wednesday, December 4, 2024 12:42 PM
> To: Nguyen, Anthony L <anthony.l.nguyen@...el.com>; Kitszel, Przemyslaw
> <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>; Clark
> Williams <clrkwllms@...nel.org>; Steven Rostedt <rostedt@...dmis.org>; Auke
> Kok <auke-jan.h.kok@...el.com>; Jeff Garzik <jgarzik@...hat.com>; moderated
> list:INTEL ETHERNET DRIVERS <intel-wired-lan@...ts.osuosl.org>; open
> list:NETWORKING DRIVERS <netdev@...r.kernel.org>; open list <linux-
> kernel@...r.kernel.org>; open list:Real-time Linux
> (PREEMPT_RT):Keyword:PREEMPT_RT <linux-rt-devel@...ts.linux.dev>
> Cc: Wander Lairson Costa <wander@...hat.com>; Yuying Ma
> <yuma@...hat.com>
> Subject: [Intel-wired-lan] [PATCH iwl-net 4/4] igb: fix igb_msix_other() handling
> for PREEMPT_RT
> 
> During testing of SR-IOV, Red Hat QE encountered an issue where the ip link up
> command intermittently fails for the igbvf interfaces when using the PREEMPT_RT
> variant. Investigation revealed that e1000_write_posted_mbx returns an error
> due to the lack of an ACK from e1000_poll_for_ack.
> 
> The underlying issue arises from the fact that IRQs are threaded by default under
> PREEMPT_RT. While the exact hardware details are not available, it appears that
> the IRQ handled by igb_msix_other must be processed before
> e1000_poll_for_ack times out. However, e1000_write_posted_mbx is called with
> preemption disabled, leading to a scenario where the IRQ is serviced only after
> the failure of e1000_write_posted_mbx.
> 
> Commit 338c4d3902fe ("igb: Disable threaded IRQ for igb_msix_other") forced
> the ISR to run in a non-threaded context. However, Sebastian observed that some
> functions called within the ISR acquire locks that may sleep.
> 
> In the previous two patches, we managed to make igb_msg_mask() safe to call
> from an interrupt context.
> 
> In this commit, we move most of the ISR handling to an interrupt context, leaving
> non IRQ safe code to be called from the thread context under PREEMPT_RT.
> 
> Reproducer:
> 
> ipaddr_vlan=3
> nic_test=ens14f0
> vf=${nic_test}v0 # The main testing steps:
> while true; do
>     ip link set ${nic_test} mtu 1500
>     ip link set ${vf} mtu 1500
>     ip link set $vf up
>     # 3. set vlan and ip for VF
>     ip link set ${nic_test} vf 0 vlan ${ipaddr_vlan}
>     ip addr add 172.30.${ipaddr_vlan}.1/24 dev ${vf}
>     ip addr add 2021:db8:${ipaddr_vlan}::1/64 dev ${vf}
>     # 4. check the link state for VF and PF
>     ip link show ${nic_test}
>     if ! ip link show $vf | grep 'state UP'; then
>         echo 'Error found'
>         break
>     fi
>     ip link set $vf down
> done
> 
> You can also reproduce it more reliably by setting nr_cpus=1 in the kernel
> command line.
> 
> Fixes: 9d5c824399de ("igb: PCI-Express 82575 Gigabit Ethernet driver")
> Signed-off-by: Wander Lairson Costa <wander@...hat.com>
> Reported-by: Yuying Ma <yuma@...hat.com>
> ---
>  drivers/net/ethernet/intel/igb/igb_main.c | 35 ++++++++++++++++-------
>  1 file changed, 24 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c
> b/drivers/net/ethernet/intel/igb/igb_main.c
> index 5828831fd29c2..b2894cebe2c9e 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -131,6 +131,7 @@ static void igb_set_uta(struct igb_adapter *adapter, bool

Tested-by: Rafal Romanowski <rafal.romanowski@...el.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ