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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yy9RuS1AaEe45iLZ@unreal>
Date:   Sat, 24 Sep 2022 21:51:37 +0300
From:   Leon Romanovsky <leon@...nel.org>
To:     Saeed Mahameed <saeedm@...dia.com>
Cc:     "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Eric Dumazet <edumazet@...gle.com>, netdev@...r.kernel.org,
        Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next] net/mlx5: Make ASO poll CQ usable in atomic
 context

On Sat, Sep 24, 2022 at 10:24:25AM -0700, Saeed Mahameed wrote:
> On 24 Sep 14:17, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@...dia.com>
> > 
> > Poll CQ functions shouldn't sleep as they are called in atomic context.
> > The following splat appears once the mlx5_aso_poll_cq() is used in such
> > flow.
> > 
> > BUG: scheduling while atomic: swapper/17/0/0x00000100
> 
> ...
> 
> > 	/* With newer FW, the wait for the first ASO WQE is more than 2us, put the wait 10ms. */
> > -	err = mlx5_aso_poll_cq(aso, true, 10);
> > +	expires = jiffies + msecs_to_jiffies(10);
> > +	do {
> > +		err = mlx5_aso_poll_cq(aso, true);
> > +	} while (err && time_is_after_jiffies(expires));
> > 	mutex_unlock(&flow_meters->aso_lock);
>         ^^^^
> busy poll won't work, this mutex is held and can sleep anyway.
> Let's discuss internally and solve this by design.

This is TC code, it doesn't need atomic context and had mutex + sleep
from the beginning.

My change cleans mlx5_aso_poll_cq() from busy loop for the IPsec path,
so why do you plan to change in the design?

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ