diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-11-16 22:13:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-17 17:06:08 -0500 |
commit | adc9300e78e6091a7eaa1821213836379d4dbaa8 (patch) | |
tree | b2d075990b32e8c21129851bf1b1adf4cdc441f1 /include/linux | |
parent | d6f144830bdfa5fcf116e9ab8fc6a60d23fa623d (diff) |
net: use jump_label to shortcut RPS if not setup
Most machines dont use RPS/RFS, and pay a fair amount of instructions in
netif_receive_skb() / netif_rx() / get_rps_cpu() just to discover
RPS/RFS is not setup.
Add a jump_label named rps_needed.
If no device rps_map or global rps_sock_flow_table is setup,
netif_receive_skb() / netif_rx() do a single instruction instead of many
ones, including conditional jumps.
jmp +0 (if CONFIG_JUMP_LABEL=y)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/netdevice.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 4d5698aa828..0bbe030fc01 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -214,6 +214,11 @@ enum { | |||
214 | #include <linux/cache.h> | 214 | #include <linux/cache.h> |
215 | #include <linux/skbuff.h> | 215 | #include <linux/skbuff.h> |
216 | 216 | ||
217 | #ifdef CONFIG_RPS | ||
218 | #include <linux/jump_label.h> | ||
219 | extern struct jump_label_key rps_needed; | ||
220 | #endif | ||
221 | |||
217 | struct neighbour; | 222 | struct neighbour; |
218 | struct neigh_parms; | 223 | struct neigh_parms; |
219 | struct sk_buff; | 224 | struct sk_buff; |