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] [day] [month] [year] [list]
Message-ID: <SJ1PR11MB6297DA25A854B8E22CA5B04C9B9FA@SJ1PR11MB6297.namprd11.prod.outlook.com>
Date: Tue, 20 May 2025 22:03:48 +0000
From: "Salin, Samuel" <samuel.salin@...el.com>
To: Brian Vazquez <brianvv@...gle.com>, Brian Vazquez
	<brianvv.kernel@...il.com>, "Nguyen, Anthony L" <anthony.l.nguyen@...el.com>,
	"Kitszel, Przemyslaw" <przemyslaw.kitszel@...el.com>, "David S. Miller"
	<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
	<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>
CC: David Decotigny <decot@...gle.com>, "Singhai, Anjali"
	<anjali.singhai@...el.com>, "Samudrala, Sridhar"
	<sridhar.samudrala@...el.com>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>, "Tantilov, Emil S" <emil.s.tantilov@...el.com>,
	"Keller, Jacob E" <jacob.e.keller@...el.com>, "Chittim, Madhu"
	<madhu.chittim@...el.com>, "Hay, Joshua A" <joshua.a.hay@...el.com>, "Luigi
 Rizzo" <lrizzo@...gle.com>
Subject: RE: [Intel-wired-lan] [iwl-net PATCH v3] idpf: fix a race in txq
 wakeup



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf Of
> Brian Vazquez
> Sent: Thursday, May 1, 2025 10:06 AM
> To: Brian Vazquez <brianvv.kernel@...il.com>; Nguyen, Anthony L
> <anthony.l.nguyen@...el.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@...el.com>; David S. Miller <davem@...emloft.net>;
> Eric Dumazet <edumazet@...gle.com>; Jakub Kicinski <kuba@...nel.org>;
> Paolo Abeni <pabeni@...hat.com>; intel-wired-lan@...ts.osuosl.org
> Cc: David Decotigny <decot@...gle.com>; Singhai, Anjali
> <anjali.singhai@...el.com>; Samudrala, Sridhar
> <sridhar.samudrala@...el.com>; linux-kernel@...r.kernel.org;
> netdev@...r.kernel.org; Tantilov, Emil S <emil.s.tantilov@...el.com>; Brian
> Vazquez <brianvv@...gle.com>; Keller, Jacob E <jacob.e.keller@...el.com>;
> Chittim, Madhu <madhu.chittim@...el.com>; Hay, Joshua A
> <joshua.a.hay@...el.com>; Luigi Rizzo <lrizzo@...gle.com>
> Subject: [Intel-wired-lan] [iwl-net PATCH v3] idpf: fix a race in txq wakeup
> 
> Add a helper function to correctly handle the lockless synchronization when
> the sender needs to block. The paradigm is
> 
>         if (no_resources()) {
>                 stop_queue();
>                 barrier();
>                 if (!no_resources())
>                         restart_queue();
>         }
> 
> netif_subqueue_maybe_stop already handles the paradigm correctly, but the
> code split the check for resources in three parts, the first one
> (descriptors) followed the protocol, but the other two (completions and
> tx_buf) were only doing the first part and so race prone.
> 
> Luckily netif_subqueue_maybe_stop macro already allows you to use a
> function to evaluate the start/stop conditions so the fix only requires the right
> helper function to evaluate all the conditions at once.
> 
> The patch removes idpf_tx_maybe_stop_common since it's no longer needed
> and instead adjusts separately the conditions for singleq and splitq.
> 
> Note that idpf_tx_buf_hw_update doesn't need to check for resources since
> that will be covered in idpf_tx_splitq_frame.
> 
> To reproduce:
> 
> Reduce the threshold for pending completions to increase the chances of
> hitting this pause by changing your kernel:
> 
> drivers/net/ethernet/intel/idpf/idpf_txrx.h
> 
> -#define IDPF_TX_COMPLQ_OVERFLOW_THRESH(txcq)   ((txcq)->desc_count
> >> 1)
> +#define IDPF_TX_COMPLQ_OVERFLOW_THRESH(txcq)   ((txcq)->desc_count
> >> 4)
> 
> Use pktgen to force the host to push small pkts very aggressively:
> 
> ./pktgen_sample02_multiqueue.sh -i eth1 -s 100 -6 -d $IP -m $MAC \
>   -p 10000-10000 -t 16 -n 0 -v -x -c 64
> 
> Fixes: 6818c4d5b3c2 ("idpf: add splitq start_xmit")
> Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
> Reviewed-by: Madhu Chittim <madhu.chittim@...el.com>
> Signed-off-by: Josh Hay <joshua.a.hay@...el.com>
> Signed-off-by: Brian Vazquez <brianvv@...gle.com>
> Signed-off-by: Luigi Rizzo <lrizzo@...gle.com>
> ---
> 2.49.0.967.g6a0df3ecc3-goog

Tested-by: Samuel Salin <Samuel.salin@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ