diff options
| author | David S. Miller <davem@davemloft.net> | 2014-11-11 13:00:11 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-11-11 13:00:11 -0500 |
| commit | b00394c007269183d9f539fa87e65892ac2006e2 (patch) | |
| tree | e3c81c868a7c14ca2bac7efd69b6b21e25c355d4 /include | |
| parent | 2e1af7d74f4f7b4d4c1b0fbf5da3b5f92d9c332f (diff) | |
| parent | 2c8c56e15df3d4c2af3d656e44feb18789f75837 (diff) | |
| download | cachepc-linux-b00394c007269183d9f539fa87e65892ac2006e2.tar.gz cachepc-linux-b00394c007269183d9f539fa87e65892ac2006e2.zip | |
Merge branch 'so_incoming_cpu'
Eric Dumazet says:
====================
net: SO_INCOMING_CPU support
SO_INCOMING_CPU socket option (read by getsockopt()) provides
an alternative to RPS/RFS for high performance servers using
multi queues NIC.
TCP should use sk_mark_napi_id() for established sockets only.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/sock.h | 12 | ||||
| -rw-r--r-- | include/uapi/asm-generic/socket.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 6767d75ecb17..7789b59c0c40 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -273,6 +273,7 @@ struct cg_proto; * @sk_rcvtimeo: %SO_RCVTIMEO setting * @sk_sndtimeo: %SO_SNDTIMEO setting * @sk_rxhash: flow hash received from netif layer + * @sk_incoming_cpu: record cpu processing incoming packets * @sk_txhash: computed flow hash for use on transmit * @sk_filter: socket filtering instructions * @sk_protinfo: private area, net family specific, when not using slab @@ -350,6 +351,12 @@ struct sock { #ifdef CONFIG_RPS __u32 sk_rxhash; #endif + u16 sk_incoming_cpu; + /* 16bit hole + * Warned : sk_incoming_cpu can be set from softirq, + * Do not use this hole without fully understanding possible issues. + */ + __u32 sk_txhash; #ifdef CONFIG_NET_RX_BUSY_POLL unsigned int sk_napi_id; @@ -833,6 +840,11 @@ static inline int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb) return sk->sk_backlog_rcv(sk, skb); } +static inline void sk_incoming_cpu_update(struct sock *sk) +{ + sk->sk_incoming_cpu = raw_smp_processor_id(); +} + static inline void sock_rps_record_flow_hash(__u32 hash) { #ifdef CONFIG_RPS diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h index ea0796bdcf88..f541ccefd4ac 100644 --- a/include/uapi/asm-generic/socket.h +++ b/include/uapi/asm-generic/socket.h @@ -82,4 +82,6 @@ #define SO_BPF_EXTENSIONS 48 +#define SO_INCOMING_CPU 49 + #endif /* __ASM_GENERIC_SOCKET_H */ |
