Thread (7 messages) read the whole thread 7 messages, 2 authors, 2021-02-05

Re: [PATCH net-next v10 2/3] net: implement threaded-able napi poll loop support

From: Alexander Duyck <hidden>
Date: 2021-02-04 21:38:25

On Thu, Feb 4, 2021 at 1:34 PM Wei Wang [off-list ref] wrote:
This patch allows running each napi poll loop inside its own
kernel thread.
The kthread is created during netif_napi_add() if dev->threaded
is set. And threaded mode is enabled in napi_enable(). We will
provide a way to set dev->threaded and enable threaded mode
without a device up/down in the following patch.

Once that threaded mode is enabled and the kthread is
started, napi_schedule() will wake-up such thread instead
of scheduling the softirq.

The threaded poll loop behaves quite likely the net_rx_action,
but it does not have to manipulate local irqs and uses
an explicit scheduling point based on netdev_budget.

Co-developed-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Co-developed-by: Hannes Frederic Sowa <redacted>
Signed-off-by: Hannes Frederic Sowa <redacted>
Co-developed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Wei Wang <redacted>
---
 include/linux/netdevice.h |  21 +++----
 net/core/dev.c            | 112 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 119 insertions(+), 14 deletions(-)
Looks good.

Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help