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]
Date:   Thu, 10 Feb 2022 20:52:37 +0100
From:   Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     bpf@...r.kernel.org, netdev@...r.kernel.org,
        "David S. Miller" <davem@...emloft.net>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        John Fastabend <john.fastabend@...il.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Toke Høiland-Jørgensen <toke@...e.dk>
Subject: Re: [PATCH net-next v2 2/3] net: dev: Makes sure netif_rx() can be
 invoked in any context.

On 2022-02-10 10:13:30 [-0800], Jakub Kicinski wrote:
> > So we do netif_rx_backlog() with the bh disable+enable and
> > __netif_rx_backlog() without it and export both tree wide?
> 
> At a risk of confusing people about the API we could also name the
> "non-super-optimized" version netif_rx(), like you had in your patch.
> Grepping thru the drivers there's ~250 uses so maybe we don't wanna
> touch all that code. No strong preference, I just didn't expect to 
> see __netif_rx_backlog(), but either way works.

So let me keep the naming as-is, export __netif_rx() and update the
kernel doc with the bits about backlog.
After that if we are up to rename the function in ~250 drivers then I
should be simpler.

> > It would make it more obvious indeed. Could we add
> > 	WARN_ON_ONCE(!(hardirq_count() | softirq_count()))
> > to the shortcut to catch the "you did it wrong folks"? This costs me
> > about 2ns.
> 
> Modulo lockdep_..(), so we don't have to run this check on prod kernels?

I was worried a little about the corner cases but then lockdep is your
friend and you should test your code. Okay.

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ