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] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 18 Sep 2020 15:44:57 -0700
From:   Wei Wang <weiwan@...gle.com>
To:     "David S . Miller" <davem@...emloft.net>,
        Linux Kernel Network Developers <netdev@...r.kernel.org>
Cc:     Jakub Kicinski <kuba@...nel.org>,
        Eric Dumazet <edumazet@...gle.com>,
        Paolo Abeni <pabeni@...hat.com>,
        Hannes Frederic Sowa <hannes@...essinduktion.org>,
        Felix Fietkau <nbd@....name>
Subject: Re: [RFC PATCH net-next 5/6] net: process RPS/RFS work in kthread context

On Mon, Sep 14, 2020 at 10:26 AM Wei Wang <weiwan@...gle.com> wrote:
>
> From: Paolo Abeni <pabeni@...hat.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@...hat.com>
> Signed-off-by: Wei Wang <weiwan@...gle.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
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ