Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Wei Wang <weiwan@google.com>
To: "David S . Miller" <davem@davemloft.net>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>
Cc: Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Hannes Frederic Sowa <hannes@stressinduktion.org>,
	Felix Fietkau <nbd@nbd.name>
Subject: Re: [RFC PATCH net-next 5/6] net: process RPS/RFS work in kthread context
Date: Fri, 18 Sep 2020 15:44:57 -0700	[thread overview]
Message-ID: <CAEA6p_BszGQafCo3NQG71dRNMTkh-fL2U9OMon2EALvFz=tSnw@mail.gmail.com> (raw)
In-Reply-To: <20200914172453.1833883-6-weiwan@google.com>

On Mon, Sep 14, 2020 at 10:26 AM Wei Wang <weiwan@google.com> wrote:
>
> From: Paolo Abeni <pabeni@redhat.com>
>
> This patch adds the missing part to handle RFS/RPS in the napi thread
> handler and makes sure RPS/RFS works properly when using kthread to do
> napi poll.
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> Signed-off-by: Wei Wang <weiwan@google.com>
> ---

With some more thoughts, I think this patch is not needed. RPS/RFS
uses its own napi (sd->backlog) which currently does not have
NAPI_STATE_THREADED set. So it is still being handled in softirq
context by net_rx_action().
I will remove this patch in the next version if no one objects.


>  net/core/dev.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index be676c21bdc4..ab8af727058b 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -6820,6 +6820,7 @@ static int napi_thread_wait(struct napi_struct *napi)
>  static int napi_threaded_poll(void *data)
>  {
>         struct napi_struct *napi = data;
> +       struct softnet_data *sd;
>         void *have;
>
>         while (!napi_thread_wait(napi)) {
> @@ -6835,6 +6836,12 @@ static int napi_threaded_poll(void *data)
>                         __kfree_skb_flush();
>                         local_bh_enable();
>
> +                       sd = this_cpu_ptr(&softnet_data);
> +                       if (sd_has_rps_ipi_waiting(sd)) {
> +                               local_irq_disable();
> +                               net_rps_action_and_irq_enable(sd);
> +                       }
> +
>                         if (!repoll)
>                                 break;
>
> --
> 2.28.0.618.gf4bc123cb7-goog
>

  reply	other threads:[~2020-09-18 22:45 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14 17:24 [RFC PATCH net-next 0/6] implement kthread based napi poll Wei Wang
2020-09-14 17:24 ` [RFC PATCH net-next 1/6] net: implement threaded-able napi poll loop support Wei Wang
2020-09-25 19:45   ` Hannes Frederic Sowa
2020-09-25 23:50     ` Wei Wang
2020-09-26 14:22       ` Hannes Frederic Sowa
2020-09-28  8:45         ` Paolo Abeni
2020-09-28 18:13           ` Wei Wang
2020-09-14 17:24 ` [RFC PATCH net-next 2/6] net: add sysfs attribute to control napi threaded mode Wei Wang
2020-09-14 17:24 ` [RFC PATCH net-next 3/6] net: extract napi poll functionality to __napi_poll() Wei Wang
2020-09-14 17:24 ` [RFC PATCH net-next 4/6] net: modify kthread handler to use __napi_poll() Wei Wang
2020-09-14 17:24 ` [RFC PATCH net-next 5/6] net: process RPS/RFS work in kthread context Wei Wang
2020-09-18 22:44   ` Wei Wang [this message]
2020-09-21  8:11     ` Eric Dumazet
2020-09-14 17:24 ` [RFC PATCH net-next 6/6] net: improve napi threaded config Wei Wang
2020-09-25 13:48 ` [RFC PATCH net-next 0/6] implement kthread based napi poll Magnus Karlsson
2020-09-25 17:15   ` Wei Wang
2020-09-25 17:30     ` Eric Dumazet
2020-09-25 18:16     ` Stephen Hemminger
2020-09-25 18:23       ` Eric Dumazet
2020-09-25 19:00         ` Stephen Hemminger
2020-09-25 19:06   ` Jakub Kicinski
2020-09-28 14:07     ` Magnus Karlsson
2020-09-28 17:43 ` Eric Dumazet
2020-09-28 18:15   ` Wei Wang
2020-09-29 19:19   ` Jakub Kicinski
2020-09-29 20:16     ` Wei Wang
2020-09-29 21:48       ` Jakub Kicinski
2020-09-30  8:23         ` David Laight
2020-09-30  8:58         ` Paolo Abeni
2020-09-30 15:58           ` Jakub Kicinski

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='CAEA6p_BszGQafCo3NQG71dRNMTkh-fL2U9OMon2EALvFz=tSnw@mail.gmail.com' \
    --to=weiwan@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hannes@stressinduktion.org \
    --cc=kuba@kernel.org \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --subject='Re: [RFC PATCH net-next 5/6] net: process RPS/RFS work in kthread context' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).