Skip to content

Commit

Permalink
net: Check rps_flow_table when RPS map length is 1
Browse files Browse the repository at this point in the history
In get_rps_cpu, add check that the rps_flow_table for the device is
NULL when trying to take fast path when RPS map length is one.
Without this, RFS is effectively disabled if map length is one which
is not correct.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Tom Herbert authored and David S. Miller committed Feb 1, 2011
1 parent cc09b5f commit 8587523
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2563,7 +2563,8 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb,

map = rcu_dereference(rxqueue->rps_map);
if (map) {
if (map->len == 1) {
if (map->len == 1 &&
!rcu_dereference_raw(rxqueue->rps_flow_table)) {
tcpu = map->cpus[0];
if (cpu_online(tcpu))
cpu = tcpu;
Expand Down

0 comments on commit 8587523

Please sign in to comment.