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;
 };
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to