From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Ferenc Fejes <primalgamer@gmail.com>
Cc: Paolo Abeni <pabeni@redhat.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Wander Lairson Costa <wander@redhat.com>
Subject: Re: [RFC PATCH net-next 1/2] net: Use SMP threads for backlog NAPI.
Date: Fri, 22 Sep 2023 09:26:14 +0200 [thread overview]
Message-ID: <20230922072614.aT8vDgAy@linutronix.de> (raw)
In-Reply-To: <2eb9af65d098bb54ed54178d7269e7197d6de5a0.camel@gmail.com>
On 2023-09-21 12:41:33 [+0200], Ferenc Fejes wrote:
> Hi!
Hi,
> > If we could somehow define a DoS condition once we are overwhelmed
> > with
> > packets, then we could act on it and throttle it. This in turn would
> > allow a SCHED_FIFO priority without the fear of a lockup if the
> > system
> > is flooded with packets.
>
> Can this be avoided if we reuse gro_flush_timeout as the maximum time
> the NAPI thread can be scheduled?
First your run time needs to be accounted somehow. I observed that some
cards/ systems tend pull often a few packets on each interrupt and
others pull more packets at a time.
So probably packets in a time frame would make sense. Maybe even plus
packet size assuming larger packets require more processing time.
If you run at SCHED_OTHER you don't care, you can keep it running. With
SCHED_FIFO you would need to decide:
- how much is too much
- what to do once you reach too much
Once you reach too much you could:
- change the scheduling policy to SCHED_OTHER and keep going until it is
no longer "too much in a given period" so you can flip it back.
- stop processing for a period of time and risk packet loss which is
defined as better than to continue.
- pulling packets and dropping them instead of injecting into the stack.
Using xdp/ebpf might be easy since there is an API for that. One could
even peek at packets to decide if some can be kept.
This would rely on the fact that the system can do this quick enough
under a DoS condition.
>
> Ferenc
Sebastian
next prev parent reply other threads:[~2023-09-22 7:26 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-14 9:35 [RFC PATCH net-next 0/2] " Sebastian Andrzej Siewior
2023-08-14 9:35 ` [RFC PATCH net-next 1/2] " Sebastian Andrzej Siewior
2023-08-21 8:32 ` kernel test robot
2023-08-23 13:35 ` Paolo Abeni
2023-09-20 15:57 ` Sebastian Andrzej Siewior
2023-09-21 10:41 ` Ferenc Fejes
2023-09-22 7:26 ` Sebastian Andrzej Siewior [this message]
2023-09-22 9:38 ` Paolo Abeni
2023-08-14 9:35 ` [RFC PATCH 2/2] softirq: Drop the warning from do_softirq_post_smp_call_flush() Sebastian Andrzej Siewior
2023-08-15 12:08 ` Jesper Dangaard Brouer
2023-08-15 22:31 ` Yan Zhai
2023-08-16 14:48 ` Jesper Dangaard Brouer
2023-08-16 15:15 ` Yan Zhai
2023-08-16 21:02 ` Jesper Dangaard Brouer
2023-08-18 15:49 ` Yan Zhai
2023-08-16 15:22 ` Sebastian Andrzej Siewior
2023-08-14 18:24 ` [RFC PATCH net-next 0/2] net: Use SMP threads for backlog NAPI Jakub Kicinski
2023-08-17 13:16 ` Sebastian Andrzej Siewior
2023-08-17 15:30 ` Jakub Kicinski
2023-08-18 9:03 ` Sebastian Andrzej Siewior
2023-08-18 14:43 ` Yan Zhai
2023-08-18 14:57 ` Sebastian Andrzej Siewior
2023-08-18 16:21 ` Jakub Kicinski
2023-08-18 16:40 ` Eric Dumazet
2023-08-23 6:57 ` Sebastian Andrzej Siewior
2023-08-18 16:56 ` Yan Zhai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230922072614.aT8vDgAy@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peterz@infradead.org \
--cc=primalgamer@gmail.com \
--cc=tglx@linutronix.de \
--cc=wander@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®