freebsd-skq/sys/netinet
Jonathan T. Looney 6d172f58a2 The code currently resets the keepalive timer each time a packet is
received on a TCP session that has entered the ESTABLISHED state. This
results in a lot of calls to reset the keepalive timer.

This patch changes the behavior so we set the keepalive timer for the
keepalive idle time (TP_KEEPIDLE). When the keepalive timer fires, it will
first check to see if the session has been idle for TP_KEEPIDLE ticks. If
not, it will reschedule the keepalive timer for the time the session will
have been idle for TP_KEEPIDLE ticks.

For a session with regular communication, the keepalive timer should fire
approximately once every TP_KEEPIDLE ticks. For sessions with irregular
communication, the keepalive timer might fire more often. But, the
disruption from a periodic keepalive timer should be less than the regular
cost of resetting the keepalive timer on every packet.

(FWIW, this change saved approximately 1.73% of the busy CPU cycles on a
particular test system with a heavy TCP output load. Of course, the
actual impact is very specific to the particular hardware and workload.)

Reviewed by:	gallatin, rrs
MFC after:	2 weeks
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D8243
2016-10-14 14:57:43 +00:00
..
cc Remove "long" variables from the TCP stack (not including the modular 2016-10-06 16:28:34 +00:00
khelp Remove "long" variables from the TCP stack (not including the modular 2016-10-06 16:28:34 +00:00
libalias
tcp_stacks The code currently resets the keepalive timer each time a packet is 2016-10-14 14:57:43 +00:00
accf_data.c
accf_dns.c
accf_http.c
icmp6.h
icmp_var.h
if_atm.c
if_atm.h
if_ether.c Add GARP retransmit capability 2016-10-02 01:42:45 +00:00
if_ether.h
igmp_var.h
igmp.c
igmp.h
in_cksum.c
in_debug.c
in_fib.c
in_fib.h
in_gif.c
in_jail.c
in_kdtrace.c
in_kdtrace.h
in_mcast.c
in_pcb.c - Revert r300854, r303657 which tried to fix regression from r297225. 2016-10-13 20:15:47 +00:00
in_pcb.h
in_pcbgroup.c
in_prot.c
in_proto.c
in_rmx.c
in_rss.c
in_rss.h
in_systm.h
in_var.h Add GARP retransmit capability 2016-10-02 01:42:45 +00:00
in.c Add GARP retransmit capability 2016-10-02 01:42:45 +00:00
in.h
ip6.h
ip_carp.c
ip_carp.h
ip_divert.c
ip_divert.h
ip_dummynet.h
ip_ecn.c
ip_ecn.h
ip_encap.c
ip_encap.h
ip_fastfwd.c
ip_fw.h
ip_gre.c
ip_icmp.c
ip_icmp.h
ip_id.c
ip_input.c
ip_ipsec.c
ip_ipsec.h
ip_mroute.c
ip_mroute.h
ip_options.c
ip_options.h
ip_output.c - Revert r300854, r303657 which tried to fix regression from r297225. 2016-10-13 20:15:47 +00:00
ip_reass.c
ip_var.h
ip.h
pim_var.h
pim.h
raw_ip.c
sctp_asconf.c
sctp_asconf.h
sctp_auth.c
sctp_auth.h
sctp_bsd_addr.c Remove an alias if_list, use if_link consistently. 2016-10-06 00:51:27 +00:00
sctp_bsd_addr.h
sctp_cc_functions.c
sctp_constants.h
sctp_crc32.c
sctp_crc32.h
sctp_dtrace_declare.h
sctp_dtrace_define.h
sctp_header.h
sctp_indata.c
sctp_indata.h
sctp_input.c
sctp_input.h
sctp_lock_bsd.h
sctp_os_bsd.h
sctp_os.h
sctp_output.c Lock the ND prefix list and add refcounting for prefixes. 2016-10-07 21:10:53 +00:00
sctp_output.h
sctp_pcb.c Mark the socket as un-writable when it is 1-to-1 and the SCTP association 2016-10-13 13:53:01 +00:00
sctp_pcb.h
sctp_peeloff.c
sctp_peeloff.h
sctp_ss_functions.c
sctp_structs.h
sctp_syscalls.c
sctp_sysctl.c
sctp_sysctl.h
sctp_timer.c
sctp_timer.h
sctp_uio.h
sctp_usrreq.c
sctp_var.h
sctp.h
sctputil.c
sctputil.h
siftr.c
tcp_debug.c Remove "long" variables from the TCP stack (not including the modular 2016-10-06 16:28:34 +00:00
tcp_debug.h
tcp_fastopen.c
tcp_fastopen.h
tcp_fsm.h
tcp_hostcache.c Remove "long" variables from the TCP stack (not including the modular 2016-10-06 16:28:34 +00:00
tcp_hostcache.h Remove "long" variables from the TCP stack (not including the modular 2016-10-06 16:28:34 +00:00
tcp_input.c The code currently resets the keepalive timer each time a packet is 2016-10-14 14:57:43 +00:00
tcp_lro.c
tcp_lro.h
tcp_offload.c
tcp_offload.h
tcp_output.c The TFO server-side code contains some changes that are not conditioned on 2016-10-12 19:06:50 +00:00
tcp_pcap.c
tcp_pcap.h
tcp_reass.c
tcp_sack.c
tcp_seq.h Remove "long" variables from the TCP stack (not including the modular 2016-10-06 16:28:34 +00:00
tcp_subr.c In the TCP stack, the hhook(9) framework provides hooks for kernel modules 2016-10-12 02:16:42 +00:00
tcp_syncache.c The TFO server-side code contains some changes that are not conditioned on 2016-10-12 19:06:50 +00:00
tcp_syncache.h
tcp_timer.c The code currently resets the keepalive timer each time a packet is 2016-10-14 14:57:43 +00:00
tcp_timer.h
tcp_timewait.c
tcp_usrreq.c The TFO server-side code contains some changes that are not conditioned on 2016-10-12 19:06:50 +00:00
tcp_var.h The TFO server-side code contains some changes that are not conditioned on 2016-10-12 19:06:50 +00:00
tcp.h
tcpip.h
toecore.c
toecore.h
udp_usrreq.c r297225 broke udp_output() for the case where the "addr" argument 2016-10-01 19:39:09 +00:00
udp_var.h
udp.h
udplite.h