[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF=yD-LVQ_hpQaN9tZ_UmJ3YYqipAaHBLhEsusaOXYJiXfcCrw@mail.gmail.com>
Date: Thu, 10 May 2018 23:54:55 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: gfree.wind@....163.com
Cc: David Miller <davem@...emloft.net>,
Daniel Borkmann <daniel@...earbox.net>,
jakub.kicinski@...ronome.com, David Ahern <dsahern@...il.com>,
Network Development <netdev@...r.kernel.org>
Subject: Re: [PATCH net] net: Correct wrong skb_flow_limit check when enable RPS
On Thu, May 10, 2018 at 4:28 AM, <gfree.wind@....163.com> wrote:
> From: Gao Feng <gfree.wind@....163.com>
>
> The skb flow limit is implemented for each CPU independently. In the
> current codes, the function skb_flow_limit gets the softnet_data by
> this_cpu_ptr. But the target cpu of enqueue_to_backlog would be not
> the current cpu when enable RPS. As the result, the skb_flow_limit checks
> the stats of current CPU, while the skb is going to append the queue of
> another CPU. It isn't the expected behavior.
>
> Now pass the softnet_data as a param to softnet_data to make consistent.
The local cpu softnet_data is used on purpose. The operations in
skb_flow_limit() on sd fields could race if not executed on the local cpu.
Flow limit tries to detect large ("elephant") DoS flows with a fixed four-tuple.
These would always hit the same RPS cpu, so that cpu being backlogged
may be an indication that such a flow is active. But the flow will also always
arrive on the same initial cpu courtesy of RSS. So storing the lookup table
on the initial CPU is also fine. There may be false positives on other CPUs
with the same RPS destination, but that is unlikely with a highly concurrent
traffic server mix ("mice").
Note that the sysctl net.core.flow_limit_cpu_bitmap enables the feature
for the cpus on which traffic initially lands, not the RPS destination cpus.
See also Documentation/networking/scaling.txt
That said, I had to reread the code, as it does seem sensible that the
same softnet_data is intended to be used both when testing qlen and
flow_limit.
Powered by blists - more mailing lists