tcp: better smp listener behavior
Subsystems (5)
v2 cover tcp: better smp listener behavior
As promised in last patch series, we implement a better SO_REUSEPORT strategy, based on cpu hints if given by the application.
We also moved sk_refcnt out of the cache line containing the lookup keys, as it was considerably slowing down smp operations because of false sharing. This was simpler than converting listen sockets to conventional RCU (to avoid sk_refcnt dirtying)
Could process 6.0 Mpps SYN instead of 4.2 Mpps on my test server.
Eric Dumazet (4):
net: SO_INCOMING_CPU setsockopt() support
net: align sk_refcnt on 128 bytes boundary
net: shrink struct sock and request_sock by 8 bytes
tcp: shrink tcp_timewait_sock by 8 bytes
include/linux/tcp.h | 4 ++-- include/net/inet_timewait_sock.h | 2 +- include/net/request_sock.h | 7 +++---- include/net/sock.h | 41 +++++++++++++++++++++++++++------------- net/core/sock.c | 5 +++++ net/ipv4/inet_hashtables.c | 2 ++ net/ipv4/syncookies.c | 4 ++-- net/ipv4/tcp_input.c | 2 +- net/ipv4/tcp_ipv4.c | 2 +- net/ipv4/tcp_minisocks.c | 18 +++++++++--------- net/ipv4/tcp_output.c | 2 +- net/ipv4/udp.c | 6 +++++- net/ipv6/inet6_hashtables.c | 2 ++ net/ipv6/syncookies.c | 4 ++-- net/ipv6/tcp_ipv6.c | 2 +- net/ipv6/udp.c | 10 +++++++--- 16 files changed, 72 insertions(+), 41 deletions(-)
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
PATCH v2 1/4 net: SO_INCOMING_CPU setsockopt() support
SO_INCOMING_CPU as added in commit 2c8c56e15df3 was a getsockopt() command to fetch incoming cpu handling a particular TCP flow after accept()
This commits adds setsockopt() support and extends SO_REUSEPORT selection logic : If a TCP listener or UDP socket has this option set, a packet is delivered to this socket only if CPU handling the packet matches the specified one.
This allows to build very efficient TCP servers, using one listener per RX queue, as the associated TCP listener should only accept flows handled in softirq by the same cpu.
This provides optimal NUMA behavior and keep cpu caches hot.
Note that __inet_lookup_listener() still has to iterate over the list of all listeners. Following patch puts sk_refcnt in a different cache line to let this iteration hit only shared and read mostly cache lines.
--- include/net/sock.h | 10 ++++------ net/core/sock.c | 5 +++++ net/ipv4/inet_hashtables.c | 2 ++ net/ipv4/udp.c | 6 +++++- net/ipv6/inet6_hashtables.c | 2 ++ net/ipv6/udp.c | 10 +++++++--- 6 files changed, 25 insertions(+), 10 deletions(-)
include/net/sock.h +4 -6
@@ -150,6 +150,7 @@ typedef __u64 __bitwise __addrpair;* @skc_node: main hash linkage for various protocol lookup tables * @skc_nulls_node: main hash linkage for TCP/UDP/UDP-Lite protocol * @skc_tx_queue_mapping: tx queue number for this connection +* @skc_incoming_cpu: record/match cpu processing incoming packets * @skc_refcnt: reference count * * This is the minimal network layer representation of sockets, the header
@@ -212,6 +213,8 @@ struct sock_common {struct hlist_nulls_node skc_nulls_node; };int skc_tx_queue_mapping; +int skc_incoming_cpu; +atomic_t skc_refcnt;/* private: */ int skc_dontcopy_end[0 ];
@@ -274,7 +277,6 @@ 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_timer: sock cleanup timer
@@ -331,6 +333,7 @@ struct sock {#define sk_v6_daddr __sk_common.skc_v6_daddr#define sk_v6_rcv_saddr __sk_common.skc_v6_rcv_saddr#define sk_cookie __sk_common.skc_cookie +#define sk_incoming_cpu __sk_common.skc_incoming_cpusocket_lock_t sk_lock;struct sk_buff_head sk_receive_queue;
@@ -353,11 +356,6 @@ 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
net/core/sock.c +5 -0
@@ -988,6 +988,10 @@ set_rcvbuf: sk->sk_max_pacing_rate);break ; +case SO_INCOMING_CPU : + sk->sk_incoming_cpu = val; +break ; +default : ret = -ENOPROTOOPT ;break ;
@@ -2353,6 +2357,7 @@ void sock_init_data(struct socket *sock, struct sock *sk) sk->sk_max_pacing_rate = ~0U ; sk->sk_pacing_rate = ~0U ; + sk->sk_incoming_cpu =-1 ;/* * Before updating sk_refcnt, we must commit prior changes to memory * (Documentation/RCU/rculist_nulls.txt for details)
net/ipv4/inet_hashtables.c +2 -0
@@ -185,6 +185,8 @@ static inline int compute_score(struct sock *sk, struct net *net,return -1 ; score +=4 ; } +if (sk->sk_incoming_cpu ==raw_smp_processor_id ()) + score++; }return score; }
net/ipv4/udp.c +5 -1
@@ -375,7 +375,8 @@ static inline int compute_score(struct sock *sk, struct net *net,return -1 ; score +=4 ; } - +if (sk->sk_incoming_cpu ==raw_smp_processor_id ()) + score++;return score; }
@@ -419,6 +420,9 @@ static inline int compute_score2(struct sock *sk, struct net *net, score +=4 ; } +if (sk->sk_incoming_cpu ==raw_smp_processor_id ()) + score++; +return score; }
net/ipv6/inet6_hashtables.c +2 -0
@@ -114,6 +114,8 @@ static inline int compute_score(struct sock *sk, struct net *net,return -1 ; score++; } +if (sk->sk_incoming_cpu ==raw_smp_processor_id ()) + score++; }return score; }
net/ipv6/udp.c +7 -3
@@ -182,10 +182,12 @@ static inline int compute_score(struct sock *sk, struct net *net, score++; } +if (sk->sk_incoming_cpu ==raw_smp_processor_id ()) + score++; +return score; } -#define SCORE2_MAX (1 + 1 + 1) static inline int compute_score2(struct sock *sk, struct net *net, const struct in6_addr *saddr, __be16 sport, const struct in6_addr *daddr,
@@ -223,6 +225,9 @@ static inline int compute_score2(struct sock *sk, struct net *net, score++; } +if (sk->sk_incoming_cpu ==raw_smp_processor_id ()) + score++; +return score; }
@@ -251,8 +256,7 @@ begin: hash =udp6_ehashfn (net, daddr, hnum, saddr, sport); matches =1 ; - }else if (score ==SCORE2_MAX ) - goto exact_match; + } }else if (score == badness && reuseport) { matches++;if (reciprocal_scale (hash, matches) ==0 )
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
PATCH v2 2/4 net: align sk_refcnt on 128 bytes boundary
In reply to Eric Dumazetsk->sk_refcnt is dirtied for every TCP/UDP incoming packet. This is a performance issue if multiple cpus hit a common socket, or multiple sockets are chained due to SO_REUSEPORT.
By moving sk_refcnt 8 bytes further, first 128 bytes of sockets are mostly read. As they contain the lookup keys, this has a considerable performance impact, as cpus can cache them.
These 8 bytes are not wasted, we use them as a place holder for various fields, depending on the socket type.
Tested:
SYN flood hitting a 16 RX queues NIC.
TCP listener using 16 sockets and SO_REUSEPORT
and SO_INCOMING_CPU for proper siloing.
Could process 6.0 Mpps SYN instead of 4.2 Mpps
Kernel profile looked like :
11.68% [kernel] [k] sha_transform
6.51% [kernel] [k] __inet_lookup_listener
5.07% [kernel] [k] __inet_lookup_established
4.15% [kernel] [k] memcpy_erms
3.46% [kernel] [k] ipt_do_table
2.74% [kernel] [k] fib_table_lookup
2.54% [kernel] [k] tcp_make_synack
2.34% [kernel] [k] tcp_conn_request
2.05% [kernel] [k] __netif_receive_skb_core
2.03% [kernel] [k] kmem_cache_alloc--- include/net/inet_timewait_sock.h | 2 +- include/net/request_sock.h | 2 +- include/net/sock.h | 17 ++++++++++++++--- 3 files changed, 16 insertions(+), 5 deletions(-)
include/net/inet_timewait_sock.h +1 -1
@@ -70,6 +70,7 @@ struct inet_timewait_sock {#define tw_dport __tw_common.skc_dport#define tw_num __tw_common.skc_num#define tw_cookie __tw_common.skc_cookie +#define tw_dr __tw_common.skc_tw_drint tw_timeout;volatile unsigned char tw_substate;
@@ -88,7 +89,6 @@ struct inet_timewait_sock {kmemcheck_bitfield_end (flags);struct timer_list tw_timer;struct inet_bind_bucket *tw_tb; -struct inet_timewait_death_row *tw_dr; };#define tw_tclass tw_tos
include/net/request_sock.h +1 -1
@@ -50,9 +50,9 @@ struct request_sock {struct sock_common __req_common;#define rsk_refcnt __req_common.skc_refcnt#define rsk_hash __req_common.skc_hash +#define rsk_listener __req_common.skc_listenerstruct request_sock *dl_next; -struct sock *rsk_listener;u16 mss;u8 num_retrans;/* number of retransmits */ u8 cookie_ts:1; /* syncookie: encode tcpopts in timestamp */
include/net/sock.h +14 -3
@@ -150,6 +150,9 @@ typedef __u64 __bitwise __addrpair;* @skc_node: main hash linkage for various protocol lookup tables * @skc_nulls_node: main hash linkage for TCP/UDP/UDP-Lite protocol * @skc_tx_queue_mapping: tx queue number for this connection +* @skc_flags: place holder for sk_flags +* %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, +* %SO_OOBINLINE settings, %SO_TIMESTAMPING settings * @skc_incoming_cpu: record/match cpu processing incoming packets * @skc_refcnt: reference count *
@@ -201,6 +204,16 @@ struct sock_common {atomic64_t skc_cookie; +/* following fields are padding to force +* offset(struct sock, sk_refcnt) == 128 on 64bit arches +* assuming IPV6 is enabled. We use this padding differently +* for different kind of 'sockets' +*/ +union { +unsigned long skc_flags; +struct sock *skc_listener;/* request_sock */ +struct inet_timewait_death_row *skc_tw_dr;/* inet_timewait_sock */ + };/* * fields between dontcopy_begin/dontcopy_end * are not copied in sock_copy()
@@ -246,8 +259,6 @@ struct cg_proto;* @sk_pacing_rate: Pacing rate (if supported by transport/packet scheduler) * @sk_max_pacing_rate: Maximum pacing rate (%SO_MAX_PACING_RATE) * @sk_sndbuf: size of send buffer in bytes -* @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, -* %SO_OOBINLINE settings, %SO_TIMESTAMPING settings * @sk_no_check_tx: %SO_NO_CHECK setting, set checksum in TX packets * @sk_no_check_rx: allow zero checksum in RX packets * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO)
@@ -334,6 +345,7 @@ struct sock {#define sk_v6_rcv_saddr __sk_common.skc_v6_rcv_saddr#define sk_cookie __sk_common.skc_cookie#define sk_incoming_cpu __sk_common.skc_incoming_cpu +#define sk_flags __sk_common.skc_flagssocket_lock_t sk_lock;struct sk_buff_head sk_receive_queue;
@@ -371,7 +383,6 @@ struct sock {#ifdef CONFIG_XFRM struct xfrm_policy *sk_policy[2 ];#endif -unsigned long sk_flags;struct dst_entry *sk_rx_dst;struct dst_entry __rcu *sk_dst_cache;spinlock_t sk_dst_lock;
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
PATCH v2 3/4 net: shrink struct sock and request_sock by 8 bytes
In reply to Eric DumazetOne 32bit hole is following skc_refcnt, use it. skc_incoming_cpu can also be an union for request_sock rcv_wnd.
--- include/net/request_sock.h | 5 ++--- include/net/sock.h | 14 +++++++++----- net/ipv4/syncookies.c | 4 ++-- net/ipv4/tcp_input.c | 2 +- net/ipv4/tcp_ipv4.c | 2 +- net/ipv4/tcp_minisocks.c | 18 +++++++++--------- net/ipv4/tcp_output.c | 2 +- net/ipv6/syncookies.c | 4 ++-- net/ipv6/tcp_ipv6.c | 2 +- 9 files changed, 28 insertions(+), 25 deletions(-)
include/net/request_sock.h +2 -3
@@ -51,15 +51,14 @@ struct request_sock {#define rsk_refcnt __req_common.skc_refcnt#define rsk_hash __req_common.skc_hash#define rsk_listener __req_common.skc_listener +#define rsk_window_clamp __req_common.skc_window_clamp +#define rsk_rcv_wnd __req_common.skc_rcv_wndstruct request_sock *dl_next;u16 mss;u8 num_retrans;/* number of retransmits */ u8 cookie_ts:1; /* syncookie: encode tcpopts in timestamp */ u8 num_timeout:7; /* number of timeouts */ -/* The following two fields can be easily recomputed I think -AK */ -u32 window_clamp;/* window clamp at creation time */ -u32 rcv_wnd;/* rcv_wnd offered first time */ u32 ts_recent;struct timer_list rsk_timer;const struct request_sock_ops *rsk_ops;
include/net/sock.h +9 -5
@@ -226,11 +226,18 @@ struct sock_common {struct hlist_nulls_node skc_nulls_node; };int skc_tx_queue_mapping; -int skc_incoming_cpu; +union { +int skc_incoming_cpu; +u32 skc_rcv_wnd; + };atomic_t skc_refcnt;/* private: */ int skc_dontcopy_end[0 ]; +union { +u32 skc_rxhash; +u32 skc_window_clamp; + };/* public: */ };
@@ -287,7 +294,6 @@ struct cg_proto;* @sk_rcvlowat: %SO_RCVLOWAT setting * @sk_rcvtimeo: %SO_RCVTIMEO setting * @sk_sndtimeo: %SO_SNDTIMEO setting -* @sk_rxhash: flow hash received from netif layer * @sk_txhash: computed flow hash for use on transmit * @sk_filter: socket filtering instructions * @sk_timer: sock cleanup timer
@@ -346,6 +352,7 @@ struct sock {#define sk_cookie __sk_common.skc_cookie#define sk_incoming_cpu __sk_common.skc_incoming_cpu#define sk_flags __sk_common.skc_flags +#define sk_rxhash __sk_common.skc_rxhashsocket_lock_t sk_lock;struct sk_buff_head sk_receive_queue;
@@ -365,9 +372,6 @@ struct sock { } sk_backlog;#define sk_rmem_alloc sk_backlog.rmem_allocint sk_forward_alloc; -#ifdef CONFIG_RPS -__u32 sk_rxhash; -#endif __u32 sk_txhash;#ifdef CONFIG_NET_RX_BUSY_POLL
net/ipv4/syncookies.c +2 -2
@@ -381,10 +381,10 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) }/* Try to redo what tcp_v4_send_synack did. */ - req->window_clamp = tp->window_clamp ? :dst_metric (&rt->dst,RTAX_WINDOW ); + req->rsk_window_clamp = tp->window_clamp ? :dst_metric (&rt->dst,RTAX_WINDOW );tcp_select_initial_window (tcp_full_space (sk), req->mss, - &req->rcv_wnd, &req->window_clamp, + &req->rsk_rcv_wnd, &req->rsk_window_clamp, ireq->wscale_ok, &rcv_wscale,dst_metric (&rt->dst,RTAX_INITRWND ));
net/ipv4/tcp_input.c +1 -1
@@ -6022,7 +6022,7 @@ static void tcp_openreq_init(struct request_sock *req, {struct inet_request_sock *ireq =inet_rsk (req); - req->rcv_wnd =0 ;/* So that tcp_send_synack() knows! */ + req->rsk_rcv_wnd =0 ;/* So that tcp_send_synack() knows! */ req->cookie_ts =0 ;tcp_rsk (req)->rcv_isn =TCP_SKB_CB (skb)->seq;tcp_rsk (req)->rcv_nxt =TCP_SKB_CB (skb)->seq +1 ;
net/ipv4/tcp_ipv4.c +1 -1
@@ -803,7 +803,7 @@ static void tcp_v4_reqsk_send_ack(const struct sock *sk, struct sk_buff *skb,*/ tcp_v4_send_ack(skb, (sk->sk_state == TCP_LISTEN) ? tcp_rsk(req)->snt_isn + 1 : tcp_sk(sk)->snd_nxt, - tcp_rsk(req)->rcv_nxt, req->rcv_wnd, + tcp_rsk(req)->rcv_nxt, req->rsk_rcv_wnd, tcp_time_stamp, req->ts_recent, 0,
net/ipv4/tcp_minisocks.c +9 -9
@@ -381,18 +381,18 @@ void tcp_openreq_init_rwin(struct request_sock *req, window_clamp =READ_ONCE (tp->window_clamp);/* Set this up on the first call only */ - req->window_clamp = window_clamp ? :dst_metric (dst,RTAX_WINDOW ); + req->rsk_window_clamp = window_clamp ? :dst_metric (dst,RTAX_WINDOW );/* limit the window selection if the user enforce a smaller rx buffer */ if (sk_listener->sk_userlocks &SOCK_RCVBUF_LOCK && - (req->window_clamp > full_space || req->window_clamp ==0 )) - req->window_clamp = full_space; + (req->rsk_window_clamp > full_space || req->rsk_window_clamp ==0 )) + req->rsk_window_clamp = full_space;/* tcp_full_space because it is guaranteed to be the first packet */ tcp_select_initial_window (full_space, mss - (ireq->tstamp_ok ?TCPOLEN_TSTAMP_ALIGNED :0 ), - &req->rcv_wnd, - &req->window_clamp, + &req->rsk_rcv_wnd, + &req->rsk_window_clamp, ireq->wscale_ok, &rcv_wscale,dst_metric (dst,RTAX_INITRWND ));
@@ -512,9 +512,9 @@ struct sock *tcp_create_openreq_child(const struct sock *sk,if (sysctl_tcp_fack)tcp_enable_fack (newtp); } - newtp->window_clamp = req->window_clamp; - newtp->rcv_ssthresh = req->rcv_wnd; - newtp->rcv_wnd = req->rcv_wnd; + newtp->window_clamp = req->rsk_window_clamp; + newtp->rcv_ssthresh = req->rsk_rcv_wnd; + newtp->rcv_wnd = req->rsk_rcv_wnd; newtp->rx_opt.wscale_ok = ireq->wscale_ok;if (newtp->rx_opt.wscale_ok) { newtp->rx_opt.snd_wscale = ireq->snd_wscale;
@@ -707,7 +707,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,/* RFC793: "first check sequence number". */ if (paws_reject || !tcp_in_window (TCP_SKB_CB (skb)->seq,TCP_SKB_CB (skb)->end_seq, -tcp_rsk (req)->rcv_nxt,tcp_rsk (req)->rcv_nxt + req->rcv_wnd)) { +tcp_rsk (req)->rcv_nxt,tcp_rsk (req)->rcv_nxt + req->rsk_rcv_wnd)) {/* Out of window: send ACK and drop. */ if (!(flg &TCP_FLAG_RST )) req->rsk_ops->send_ack (sk, skb, req);
net/ipv4/tcp_output.c +1 -1
@@ -3023,7 +3023,7 @@ struct sk_buff *tcp_make_synack(const struct sock *sk, struct dst_entry *dst, th->ack_seq =htonl (tcp_rsk (req)->rcv_nxt);/* RFC1323: The window in SYN & SYN/ACK segments is never scaled. */ - th->window =htons (min (req->rcv_wnd,65535U )); + th->window =htons (min (req->rsk_rcv_wnd,65535U ));tcp_options_write ((__be32 *)(th +1 ),NULL , &opts); th->doff = (tcp_header_size >>2 );TCP_INC_STATS_BH (sock_net (sk),TCP_MIB_OUTSEGS );
net/ipv6/syncookies.c +2 -2
@@ -235,9 +235,9 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) goto out_free; } - req->window_clamp = tp->window_clamp ? :dst_metric (dst,RTAX_WINDOW ); + req->rsk_window_clamp = tp->window_clamp ? :dst_metric (dst,RTAX_WINDOW );tcp_select_initial_window (tcp_full_space (sk), req->mss, - &req->rcv_wnd, &req->window_clamp, + &req->rsk_rcv_wnd, &req->rsk_window_clamp, ireq->wscale_ok, &rcv_wscale,dst_metric (dst,RTAX_INITRWND ));
net/ipv6/tcp_ipv6.c +1 -1
@@ -931,7 +931,7 @@ static void tcp_v6_reqsk_send_ack(const struct sock *sk, struct sk_buff *skb,*/ tcp_v6_send_ack (sk, skb, (sk->sk_state ==TCP_LISTEN ) ?tcp_rsk (req)->snt_isn +1 :tcp_sk (sk)->snd_nxt, -tcp_rsk (req)->rcv_nxt, req->rcv_wnd, +tcp_rsk (req)->rcv_nxt, req->rsk_rcv_wnd, tcp_time_stamp, req->ts_recent, sk->sk_bound_dev_if,tcp_v6_md5_do_lookup (sk, &ipv6_hdr (skb)->daddr),0 ,0 );
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
PATCH v2 4/4 tcp: shrink tcp_timewait_sock by 8 bytes
In reply to Eric DumazetReducing tcp_timewait_sock from 280 bytes to 272 bytes allows SLAB to pack 15 objects per page instead of 14 (on x86)
--- include/linux/tcp.h | 4 ++-- include/net/sock.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-)
include/linux/tcp.h +2 -2
@@ -356,8 +356,8 @@ static inline struct tcp_sock *tcp_sk(const struct sock *sk)struct tcp_timewait_sock {struct inet_timewait_sock tw_sk; -u32 tw_rcv_nxt; -u32 tw_snd_nxt; +#define tw_rcv_nxt tw_sk.__tw_common.skc_tw_rcv_nxt +#define tw_snd_nxt tw_sk.__tw_common.skc_tw_snd_nxtu32 tw_rcv_wnd;u32 tw_ts_offset;u32 tw_ts_recent;
include/net/sock.h +2 -0
@@ -229,6 +229,7 @@ struct sock_common {union {int skc_incoming_cpu;u32 skc_rcv_wnd; +u32 skc_tw_rcv_nxt;/* struct tcp_timewait_sock */ };atomic_t skc_refcnt;
@@ -237,6 +238,7 @@ struct sock_common {union {u32 skc_rxhash;u32 skc_window_clamp; +u32 skc_tw_snd_nxt;/* struct tcp_timewait_sock */ };/* public: */ };
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
kbuild test robot
build botRe: [PATCH v2 net-next 1/4] net: SO_INCOMING_CPU setsockopt() support
In reply to Eric Dumazetconfig: sh-titan_defconfig (attached as .config) reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross #…
Hi Eric,
[auto build test WARNING on net-next/master -- if it's inappropriate base, please ignore]
config: sh-titan_defconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=sh
All warnings (new ones prefixed by >>):
net/ipv6/udp.c: In function 'udp6_lib_lookup2':
>> net/ipv6/udp.c:276:1: warning: label 'exact_match' defined but not used [-Wunused-label]
vim +/exact_match +276 net/ipv6/udp.c
72289b96 Tom Herbert 2013-01-22 260 } else if (score == badness && reuseport) {
72289b96 Tom Herbert 2013-01-22 261 matches++;
8fc54f68 Daniel Borkmann 2014-08-23 262 if (reciprocal_scale(hash, matches) == 0)
72289b96 Tom Herbert 2013-01-22 263 result = sk;
72289b96 Tom Herbert 2013-01-22 264 hash = next_pseudo_random32(hash);
fddc17de Eric Dumazet 2009-11-08 265 }
fddc17de Eric Dumazet 2009-11-08 266 }
fddc17de Eric Dumazet 2009-11-08 267 /*
fddc17de Eric Dumazet 2009-11-08 268 * if the nulls value we got at the end of this lookup is
fddc17de Eric Dumazet 2009-11-08 269 * not the expected one, we must restart lookup.
fddc17de Eric Dumazet 2009-11-08 270 * We probably met an item that was moved to another chain.
fddc17de Eric Dumazet 2009-11-08 271 */
fddc17de Eric Dumazet 2009-11-08 272 if (get_nulls_value(node) != slot2)
fddc17de Eric Dumazet 2009-11-08 273 goto begin;
fddc17de Eric Dumazet 2009-11-08 274
fddc17de Eric Dumazet 2009-11-08 275 if (result) {
fddc17de Eric Dumazet 2009-11-08 @276 exact_match:
c31504dc Eric Dumazet 2010-11-15 277 if (unlikely(!atomic_inc_not_zero_hint(&result->sk_refcnt, 2)))
fddc17de Eric Dumazet 2009-11-08 278 result = NULL;
fddc17de Eric Dumazet 2009-11-08 279 else if (unlikely(compute_score2(result, net, saddr, sport,
fddc17de Eric Dumazet 2009-11-08 280 daddr, hnum, dif) < badness)) {
fddc17de Eric Dumazet 2009-11-08 281 sock_put(result);
fddc17de Eric Dumazet 2009-11-08 282 goto begin;
fddc17de Eric Dumazet 2009-11-08 283 }
fddc17de Eric Dumazet 2009-11-08 284 }:::::: The code at line 276 was first introduced by commit
:::::: fddc17defa22d8caba1cdfb2e22b50bb4b9f35c0 ipv6: udp: optimize unicast RX path
:::::: TO: Eric Dumazet <[email protected]>
:::::: CC: David S. Miller <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Re: [PATCH v2 net-next 1/4] net: SO_INCOMING_CPU setsockopt() support
Quoted 11 lines · kbuild test robot
Hi Eric,
[auto build test WARNING on net-next/master -- if it's inappropriate base, please ignore]
config: sh-titan_defconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=sh
Quoted 4 lines
All warnings (new ones prefixed by >>):
net/ipv6/udp.c: In function 'udp6_lib_lookup2':Quoted 1 line
Quoted 1 line
net/ipv6/udp.c:276:1: warning: label 'exact_match' defined but not used [-Wunused-label]
Oh right, I'll send a V3 then.
David Miller
maintainerFrom: Eric Dumazet <[email protected]>
Date: Thu, 8 Oct 2015 14:58:53 -0700
Quoted 9 lines
As promised in last patch series, we implement a better
SO_REUSEPORTstrategy, based on cpu hints if given by the application.We also moved
sk_refcntout of the cache line containing the lookup keys, as it was considerably slowing down smp operations because of false sharing. This was simpler than converting listen sockets to conventional RCU (to avoidsk_refcntdirtying)Could process 6.0 Mpps SYN instead of 4.2 Mpps on my test server.
Series applied, thanks Eric.