From owner-svn-src-all@freebsd.org Tue May 17 09:53:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CACAB3E6B4; Tue, 17 May 2016 09:53:23 +0000 (UTC) (envelope-from rrs@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 mx1.freebsd.org (Postfix) with ESMTPS id 4A5261B71; Tue, 17 May 2016 09:53:23 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4H9rM2w080661; Tue, 17 May 2016 09:53:22 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4H9rM2j080658; Tue, 17 May 2016 09:53:22 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201605170953.u4H9rM2j080658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 17 May 2016 09:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300042 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2016 09:53:23 -0000 Author: rrs Date: Tue May 17 09:53:22 2016 New Revision: 300042 URL: https://svnweb.freebsd.org/changeset/base/300042 Log: This small change adopts the excellent suggestion for using named structures in the add of a new tcp-stack that came in late to me via email after the last commit. It also makes it so that a new stack may optionally get a callback during a retransmit timeout. This allows the new stack to clear specific state (think sack scoreboards or other such structures). Sponsored by: Netflix Inc. Differential Revision: http://reviews.freebsd.org/D6303 Modified: head/sys/netinet/tcp_stacks/fastpath.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Tue May 17 09:24:54 2016 (r300041) +++ head/sys/netinet/tcp_stacks/fastpath.c Tue May 17 09:53:22 2016 (r300042) @@ -2375,34 +2375,17 @@ tcp_do_segment_fastack(struct mbuf *m, s } struct tcp_function_block __tcp_fastslow = { - "fastslow", - tcp_output, - tcp_do_segment_fastslow, - tcp_default_ctloutput, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - 0 - + .tfb_tcp_block_name = "fastslow", + .tfb_tcp_output = tcp_output, + .tfb_tcp_do_segment = tcp_do_segment_fastslow, + .tfb_tcp_ctloutput = tcp_default_ctloutput, }; struct tcp_function_block __tcp_fastack = { - "fastack", - tcp_output, - tcp_do_segment_fastack, - tcp_default_ctloutput, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - 0 + .tfb_tcp_block_name = "fastack", + .tfb_tcp_output = tcp_output, + .tfb_tcp_do_segment = tcp_do_segment_fastack, + .tfb_tcp_ctloutput = tcp_default_ctloutput }; static int Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Tue May 17 09:24:54 2016 (r300041) +++ head/sys/netinet/tcp_timer.c Tue May 17 09:53:22 2016 (r300042) @@ -604,6 +604,10 @@ tcp_timer_rexmt(void * xtp) KASSERT((tp->t_timers->tt_flags & TT_REXMT) != 0, ("%s: tp %p rexmt callout should be running", __func__, tp)); tcp_free_sackholes(tp); + if (tp->t_fb->tfb_tcp_rexmit_tmr) { + /* The stack has a timer action too. */ + (*tp->t_fb->tfb_tcp_rexmit_tmr)(tp); + } /* * Retransmission timer went off. Message has not * been acked within retransmit interval. Back off Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue May 17 09:24:54 2016 (r300041) +++ head/sys/netinet/tcp_var.h Tue May 17 09:53:22 2016 (r300042) @@ -135,6 +135,7 @@ struct tcp_function_block { uint32_t, u_int); int (*tfb_tcp_timer_active)(struct tcpcb *, uint32_t); void (*tfb_tcp_timer_stop)(struct tcpcb *, uint32_t); + void (*tfb_tcp_rexmit_tmr)(struct tcpcb *); volatile uint32_t tfb_refcnt; uint32_t tfb_flags; };