Author: rscheff
Date: Wed Jun 24 13:42:42 2020
New Revision: 362577
URL: https://svnweb.freebsd.org/changeset/base/362577

Log:
  TCP: make after-idle work for transactional sessions.
  
  The use of t_rcvtime as proxy for the last transmission
  fails for transactional IO, where the client requests
  data before the server can respond with a bulk transfer.
  
  Set aside a dedicated variable to actually track the last
  locally sent segment going forward.
  
  Reported by:  rrs
  Reviewed by:  rrs, tuexen (mentor)
  Approved by:  tuexen (mentor), rgrimes (mentor)
  MFC after:    2 weeks
  Sponsored by: NetApp, Inc.
  Differential Revision:        https://reviews.freebsd.org/D25016

Modified:
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_var.h

Modified: head/sys/netinet/tcp_output.c
==============================================================================
--- head/sys/netinet/tcp_output.c       Wed Jun 24 13:11:19 2020        
(r362576)
+++ head/sys/netinet/tcp_output.c       Wed Jun 24 13:42:42 2020        
(r362577)
@@ -260,7 +260,8 @@ tcp_output(struct tcpcb *tp)
         * to send, then transmit; otherwise, investigate further.
         */
        idle = (tp->t_flags & TF_LASTIDLE) || (tp->snd_max == tp->snd_una);
-       if (idle && ticks - tp->t_rcvtime >= tp->t_rxtcur)
+       if (idle && (((ticks - tp->t_rcvtime) >= tp->t_rxtcur) ||
+           (tp->t_sndtime && ((ticks - tp->t_sndtime) >= tp->t_rxtcur))))
                cc_after_idle(tp);
        tp->t_flags &= ~TF_LASTIDLE;
        if (idle) {
@@ -1502,6 +1503,7 @@ out:
                         * Time this transmission if not a retransmission and
                         * not currently timing anything.
                         */
+                       tp->t_sndtime = ticks;
                        if (tp->t_rtttime == 0) {
                                tp->t_rtttime = ticks;
                                tp->t_rtseq = startseq;

Modified: head/sys/netinet/tcp_var.h
==============================================================================
--- head/sys/netinet/tcp_var.h  Wed Jun 24 13:11:19 2020        (r362576)
+++ head/sys/netinet/tcp_var.h  Wed Jun 24 13:42:42 2020        (r362577)
@@ -188,8 +188,9 @@ struct tcpcb {
        tcp_seq snd_wl2;                /* window update seg ack number */
 
        tcp_seq irs;                    /* initial receive sequence number */
-       tcp_seq iss;                    /* initial send sequence number */
-       u_int   t_acktime;
+       tcp_seq iss;                    /* initial send sequence number */
+       u_int   t_acktime;              /* RACK and BBR incoming new data was 
acked */
+       u_int   t_sndtime;              /* time last data was sent */
        u_int   ts_recent_age;          /* when last updated */
        tcp_seq snd_recover;            /* for use in NewReno Fast Recovery */
        uint16_t cl4_spare;             /* Spare to adjust CL 4 */
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to