From owner-svn-src-stable-11@freebsd.org Sat Mar 3 00:54:14 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE09DF32B88; Sat, 3 Mar 2018 00:54:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A186083536; Sat, 3 Mar 2018 00:54:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C7B71F091; Sat, 3 Mar 2018 00:54:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w230sDWi040108; Sat, 3 Mar 2018 00:54:13 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w230sDP7040104; Sat, 3 Mar 2018 00:54:13 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201803030054.w230sDP7040104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 3 Mar 2018 00:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r330303 - in stable: 10/sys/dev/cxgb/ulp/tom 10/sys/dev/cxgbe/tom 10/sys/netinet 11/sys/dev/cxgb/ulp/tom 11/sys/dev/cxgbe/tom 11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/dev/cxgb/ulp/tom 10/sys/dev/cxgbe/tom 10/sys/netinet 11/sys/dev/cxgb/ulp/tom 11/sys/dev/cxgbe/tom 11/sys/netinet X-SVN-Commit-Revision: 330303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 00:54:14 -0000 Author: jhb Date: Sat Mar 3 00:54:12 2018 New Revision: 330303 URL: https://svnweb.freebsd.org/changeset/base/330303 Log: MFC 328608: Export tcp_always_keepalive for use by the Chelsio TOM module. This used to work by accident with ld.bfd even though always_keepalive was marked as static. LLD honors static more correctly, so export this variable properly (including moving it into the tcp_* namespace). Relative to HEAD the MFC includes two additional changes: - The t3_tom module used for cxgb(4) is also patched. - A strong reference from the new name (tcp_always_keepalive) to the old name (always_keepalive) has been added to preserve the KBI for existing modules. Suggested by: kib (strong reference) Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/netinet/tcp_timer.c stable/11/sys/netinet/tcp_timer.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c stable/10/sys/dev/cxgbe/tom/t4_tom.c stable/10/sys/netinet/tcp_timer.c stable/10/sys/netinet/tcp_timer.h Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Sat Mar 3 00:22:32 2018 (r330302) +++ stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Sat Mar 3 00:54:12 2018 (r330303) @@ -87,7 +87,6 @@ VNET_DECLARE(int, tcp_autorcvbuf_inc); #define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) VNET_DECLARE(int, tcp_autorcvbuf_max); #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) -extern int always_keepalive; /* * For ULP connections HW may add headers, e.g., for digests, that aren't part @@ -840,7 +839,7 @@ calc_opt0h(struct socket *so, int mtu_idx, int rscale, if (so != NULL) { struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); - int keepalive = always_keepalive || + int keepalive = tcp_always_keepalive || so_options_get(so) & SO_KEEPALIVE; opt0h |= V_NAGLE((tp->t_flags & TF_NODELAY) == 0); Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.c Sat Mar 3 00:22:32 2018 (r330302) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.c Sat Mar 3 00:54:12 2018 (r330303) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #define TCPSTATES #include +#include #include #include @@ -535,8 +536,6 @@ select_rcv_wscale(void) return (wscale); } -extern int always_keepalive; - /* * socket so could be a listening socket too. */ @@ -555,7 +554,7 @@ calc_opt0(struct socket *so, struct vi_info *vi, struc if (so != NULL) { struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); - int keepalive = always_keepalive || + int keepalive = tcp_always_keepalive || so_options_get(so) & SO_KEEPALIVE; opt0 |= V_NAGLE((tp->t_flags & TF_NODELAY) == 0); Modified: stable/11/sys/netinet/tcp_timer.c ============================================================================== --- stable/11/sys/netinet/tcp_timer.c Sat Mar 3 00:22:32 2018 (r330302) +++ stable/11/sys/netinet/tcp_timer.c Sat Mar 3 00:54:12 2018 (r330303) @@ -116,9 +116,10 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_slop, CTLT &tcp_rexmit_slop, 0, sysctl_msec_to_ticks, "I", "Retransmission Timer Slop"); -static int always_keepalive = 1; +int tcp_always_keepalive = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive, CTLFLAG_RW, - &always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections"); + &tcp_always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections"); +__strong_reference(tcp_always_keepalive, always_keepalive); int tcp_fast_finwait2_recycle = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, fast_finwait2_recycle, CTLFLAG_RW, @@ -428,7 +429,8 @@ tcp_timer_keep(void *xtp) TCPSTAT_INC(tcps_keeptimeo); if (tp->t_state < TCPS_ESTABLISHED) goto dropit; - if ((always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && + if ((tcp_always_keepalive || + inp->inp_socket->so_options & SO_KEEPALIVE) && tp->t_state <= TCPS_CLOSING) { if (ticks - tp->t_rcvtime >= TP_KEEPIDLE(tp) + TP_MAXIDLE(tp)) goto dropit; Modified: stable/11/sys/netinet/tcp_timer.h ============================================================================== --- stable/11/sys/netinet/tcp_timer.h Sat Mar 3 00:22:32 2018 (r330302) +++ stable/11/sys/netinet/tcp_timer.h Sat Mar 3 00:54:12 2018 (r330303) @@ -188,6 +188,7 @@ extern int tcp_ttl; /* time to live for TCP segs */ extern int tcp_backoff[]; extern int tcp_syn_backoff[]; +extern int tcp_always_keepalive; extern int tcp_finwait2_timeout; extern int tcp_fast_finwait2_recycle;