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>
This commit is contained in:

committed by
David S. Miller

parent
d6f144830b
commit
adc9300e78
@@ -214,6 +214,11 @@ enum {
|
||||
#include <linux/cache.h>
|
||||
#include <linux/skbuff.h>
|
||||
|
||||
#ifdef CONFIG_RPS
|
||||
#include <linux/jump_label.h>
|
||||
extern struct jump_label_key rps_needed;
|
||||
#endif
|
||||
|
||||
struct neighbour;
|
||||
struct neigh_parms;
|
||||
struct sk_buff;
|
||||
|
Reference in New Issue
Block a user