net: Check rps_flow_table when RPS map length is 1
authorTom Herbert <therbert@google.com>
Tue, 1 Feb 2011 00:23:42 +0000 (16:23 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Feb 2011 00:23:42 +0000 (16:23 -0800)
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>
net/core/dev.c

index 93e44dbf6793f1aff31da27ecaef19cf86e38aba..4c907895876be6e1690414c0d2919df6ff4cebce 100644 (file)
@@ -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;