[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YfwGcHv6XQytcq68@linutronix.de>
Date: Thu, 3 Feb 2022 17:44:32 +0100
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Eric Dumazet <edumazet@...gle.com>
Cc: bpf <bpf@...r.kernel.org>, netdev <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jakub Kicinski <kuba@...nel.org>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH net-next 3/4] net: dev: Makes sure netif_rx() can be
invoked in any context.
On 2022-02-03 08:18:34 [-0800], Eric Dumazet wrote:
> > So we still end up with two interfaces. Do I move a few callers like the
> > one you already mentioned over to the __netif_rx() interface or will it
> > be the one previously mentioned for now?
>
>
> I would say vast majority of drivers would use netif_rx()
>
> Only the one we consider critical (loopback traffic) would use
> __netif_rx(), after careful inspection.
>
> As we said modern/high performance NIC are using NAPI and GRO these days.
>
> Only virtual drivers might still use legacy netif_rx() and be in critical paths.
Let me then update something to the documentation so it becomes obvious.
> > static inline void local_bh_enable(void)
> > {
> > - __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
> > + if (unlikely(softirq_count() == SOFTIRQ_DISABLE_OFFSET)) {
> > + __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
> > + } else {
> > + preempt_count_sub(SOFTIRQ_DISABLE_OFFSET);
> > + barrier();
> > + }
> > }
> >
> > #ifdef CONFIG_PREEMPT_RT
> >
> > lower the overhead to acceptable range? (I still need to sell this to
> > peterz first).
>
> I guess the cost of the local_bh_enable()/local_bh_disable() pair
> will be roughly the same, please measure it :)
We would avoid that branch maybe that helps. Will measure.
Sebastian
Powered by blists - more mailing lists