Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214349
b: refs/heads/master
c: 6febfca
h: refs/heads/master
i:
  214347: 3e78c14
v: v3
  • Loading branch information
Changli Gao authored and David S. Miller committed Sep 8, 2010
1 parent 7876800 commit 026c547
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 65040c33ee8d0199ab7686402bffdbf9e1e26cbe
refs/heads/master: 6febfca98f25c7ee5c3ff7fc85e048bf82230ad5
14 changes: 11 additions & 3 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2343,7 +2343,7 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb,
struct rps_dev_flow **rflowp)
{
struct netdev_rx_queue *rxqueue;
struct rps_map *map;
struct rps_map *map = NULL;
struct rps_dev_flow_table *flow_table;
struct rps_sock_flow_table *sock_flow_table;
int cpu = -1;
Expand All @@ -2361,8 +2361,17 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb,
} else
rxqueue = dev->_rx;

if (!rxqueue->rps_map && !rxqueue->rps_flow_table)
if (rxqueue->rps_map) {
map = rcu_dereference(rxqueue->rps_map);
if (map && map->len == 1) {
tcpu = map->cpus[0];
if (cpu_online(tcpu))
cpu = tcpu;
goto done;
}
} else if (!rxqueue->rps_flow_table) {
goto done;
}

skb_reset_network_header(skb);
if (!skb_get_rxhash(skb))
Expand Down Expand Up @@ -2407,7 +2416,6 @@ static int get_rps_cpu(struct net_device *dev, struct sk_buff *skb,
}
}

map = rcu_dereference(rxqueue->rps_map);
if (map) {
tcpu = map->cpus[((u64) skb->rxhash * map->len) >> 32];

Expand Down

0 comments on commit 026c547

Please sign in to comment.