netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: peterz@infradead.org, "Maciej Żenczykowski" <maze@google.com>
Cc: Eric Dumazet <edumazet@google.com>,
	"David S . Miller" <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Alex Belits <abelits@marvell.com>,
	Nitesh Narayan Lal <nitesh@redhat.com>
Subject: Re: [PATCH net] net: accept an empty mask in /sys/class/net/*/queues/rx-*/rps_cpus
Date: Wed, 12 Aug 2020 08:19:57 -0700	[thread overview]
Message-ID: <b54cee03-77bc-eaa8-c67a-04e4d56e44fe@gmail.com> (raw)
In-Reply-To: <20200812080049.GH2674@hirez.programming.kicks-ass.net>



On 8/12/20 1:00 AM, peterz@infradead.org wrote:
> On Tue, Aug 11, 2020 at 06:45:23PM -0700, Maciej Żenczykowski wrote:
>> On Tue, Aug 11, 2020 at 6:34 PM Eric Dumazet <edumazet@google.com> wrote:
>>
>>> We must accept an empty mask in store_rps_map(), or we are not able
>>> to disable RPS on a queue.
>>>
>>> Fixes: 07bbecb34106 ("net: Restrict receive packets queuing to
>>> housekeeping CPUs")
>>> Signed-off-by: Eric Dumazet <edumazet@google.com>
>>> Reported-by: Maciej Żenczykowski <maze@google.com>
>>> Cc: Alex Belits <abelits@marvell.com>
>>> Cc: Nitesh Narayan Lal <nitesh@redhat.com>
>>> Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
>>> ---
>>>  net/core/net-sysfs.c | 12 +++++++-----
>>>  1 file changed, 7 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
>>> index
>>> 9de33b594ff2693c054022a42703c90084122444..efec66fa78b70b2fe5b0a5920317eb1d0415d9e3
>>> 100644
>>> --- a/net/core/net-sysfs.c
>>> +++ b/net/core/net-sysfs.c
>>> @@ -757,11 +757,13 @@ static ssize_t store_rps_map(struct netdev_rx_queue
>>> *queue,
>>>                 return err;
>>>         }
>>>
>>> -       hk_flags = HK_FLAG_DOMAIN | HK_FLAG_WQ;
>>> -       cpumask_and(mask, mask, housekeeping_cpumask(hk_flags));
>>> -       if (cpumask_empty(mask)) {
>>> -               free_cpumask_var(mask);
>>> -               return -EINVAL;
>>> +       if (!cpumask_empty(mask)) {
>>> +               hk_flags = HK_FLAG_DOMAIN | HK_FLAG_WQ;
>>> +               cpumask_and(mask, mask, housekeeping_cpumask(hk_flags));
>>> +               if (cpumask_empty(mask)) {
>>> +                       free_cpumask_var(mask);
>>> +                       return -EINVAL;
>>> +               }
>>>         }
> 
> Ah indeed! Sorry about that.
> 
> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> 

No worries, thanks for the review guys.

We probably should add a test doing something like

echo ffffffff >/sys/class/net/lo/queues/rx-0/rps_cpus
echo 0 >/sys/class/net/lo/queues/rx-0/rps_cpus


  reply	other threads:[~2020-08-12 15:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12  1:34 [PATCH net] net: accept an empty mask in /sys/class/net/*/queues/rx-*/rps_cpus Eric Dumazet
2020-08-12  2:25 ` Maciej Żenczykowski
2020-08-12  3:16 ` David Ahern
2020-08-12  3:18   ` David Ahern
2020-08-12  3:19   ` Maciej Żenczykowski
2020-08-12  3:22     ` David Ahern
2020-08-12  3:27       ` Eric Dumazet
     [not found] ` <CANP3RGc6Gz73Gt3v9M7KYNeNd57o--=3mF6yqdRjqOViG+TG7A@mail.gmail.com>
2020-08-12  8:00   ` peterz
2020-08-12 15:19     ` Eric Dumazet [this message]
2020-08-12 12:53 ` Nitesh Narayan Lal
2020-08-12 21:25 ` David Miller

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=b54cee03-77bc-eaa8-c67a-04e4d56e44fe@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=abelits@marvell.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=maze@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=nitesh@redhat.com \
    --cc=peterz@infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).