diff options
author | Eric Dumazet <edumazet@google.com> | 2015-04-25 18:35:24 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-26 22:07:57 +0200 |
commit | a31196b07f8034eba6a3487a1ad1bb5ec5cd58a5 (patch) | |
tree | 7f870304863599f718850712a8c02e51359f0897 /Documentation | |
parent | altera tse: add support for fixed-links. (diff) | |
download | linux-a31196b07f8034eba6a3487a1ad1bb5ec5cd58a5.tar.xz linux-a31196b07f8034eba6a3487a1ad1bb5ec5cd58a5.zip |
net: rfs: fix crash in get_rps_cpus()
Commit 567e4b79731c ("net: rfs: add hash collision detection") had one
mistake :
RPS_NO_CPU is no longer the marker for invalid cpu in set_rps_cpu()
and get_rps_cpu(), as @next_cpu was the result of an AND with
rps_cpu_mask
This bug showed up on a host with 72 cpus :
next_cpu was 0x7f, and the code was trying to access percpu data of an
non existent cpu.
In a follow up patch, we might get rid of compares against nr_cpu_ids,
if we init the tables with 0. This is silly to test for a very unlikely
condition that exists only shortly after table initialization, as
we got rid of rps_reset_sock_flow() and similar functions that were
writing this RPS_NO_CPU magic value at flow dismantle : When table is
old enough, it never contains this value anymore.
Fixes: 567e4b79731c ("net: rfs: add hash collision detection")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tom Herbert <tom@herbertland.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/networking/scaling.txt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/networking/scaling.txt b/Documentation/networking/scaling.txt index cbfac0949635..59f4db2a0c85 100644 --- a/Documentation/networking/scaling.txt +++ b/Documentation/networking/scaling.txt @@ -282,7 +282,7 @@ following is true: - The current CPU's queue head counter >= the recorded tail counter value in rps_dev_flow[i] -- The current CPU is unset (equal to RPS_NO_CPU) +- The current CPU is unset (>= nr_cpu_ids) - The current CPU is offline After this check, the packet is sent to the (possibly updated) current |