]> git.baikalelectronics.ru Git - kernel.git/commit
net: use jump_label to shortcut RPS if not setup
authorEric Dumazet <eric.dumazet@gmail.com>
Thu, 17 Nov 2011 03:13:26 +0000 (03:13 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Nov 2011 22:06:08 +0000 (17:06 -0500)
commitca202502b554297865501684e3a93132318f4a2d
treeb2d075990b32e8c21129851bf1b1adf4cdc441f1
parentb492eb93949cbb9e080a329c111ef68148cc371b
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>
include/linux/netdevice.h
net/core/dev.c
net/core/net-sysfs.c
net/core/sysctl_net_core.c