Print this page
11553 Want pluggable TCP congestion control algorithms
Portions contributed by: Cody Peter Mello <cody.mello@joyent.com>
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Robert Mustacchi <robert.mustacchi@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/tcp/tcp_timers.c
          +++ new/usr/src/uts/common/inet/tcp/tcp_timers.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
  25   25   * Copyright 2011 Joyent, Inc.  All rights reserved.
  26      - * Copyright (c) 2014, 2016 by Delphix. All rights reserved.
       26 + * Copyright (c) 2014, 2017 by Delphix. All rights reserved.
  27   27   */
  28   28  
  29   29  #include <sys/types.h>
  30   30  #include <sys/strlog.h>
  31   31  #include <sys/strsun.h>
  32   32  #include <sys/squeue_impl.h>
  33   33  #include <sys/squeue.h>
  34   34  #include <sys/callo.h>
  35   35  #include <sys/strsubr.h>
  36   36  
↓ open down ↓ 740 lines elided ↑ open up ↑
 777  777                           * first and second interval actions.  NOTE: the timer
 778  778                           * interval is allowed to continue its exponential
 779  779                           * backoff.
 780  780                           */
 781  781                          if (tcp->tcp_swnd == 0 || tcp->tcp_zero_win_probe) {
 782  782                                  if (connp->conn_debug) {
 783  783                                          (void) strlog(TCP_MOD_ID, 0, 1,
 784  784                                              SL_TRACE, "tcp_timer: zero win");
 785  785                                  }
 786  786                          } else {
 787      -                                /*
 788      -                                 * After retransmission, we need to do
 789      -                                 * slow start.  Set the ssthresh to one
 790      -                                 * half of current effective window and
 791      -                                 * cwnd to one MSS.  Also reset
 792      -                                 * tcp_cwnd_cnt.
 793      -                                 *
 794      -                                 * Note that if tcp_ssthresh is reduced because
 795      -                                 * of ECN, do not reduce it again unless it is
 796      -                                 * already one window of data away (tcp_cwr
 797      -                                 * should then be cleared) or this is a
 798      -                                 * timeout for a retransmitted segment.
 799      -                                 */
 800      -                                uint32_t npkt;
 801      -
 802      -                                if (!tcp->tcp_cwr || tcp->tcp_rexmit) {
 803      -                                        npkt = ((tcp->tcp_timer_backoff ?
 804      -                                            tcp->tcp_cwnd_ssthresh :
 805      -                                            tcp->tcp_snxt -
 806      -                                            tcp->tcp_suna) >> 1) / tcp->tcp_mss;
 807      -                                        tcp->tcp_cwnd_ssthresh = MAX(npkt, 2) *
 808      -                                            tcp->tcp_mss;
 809      -                                }
 810      -                                tcp->tcp_cwnd = tcp->tcp_mss;
 811      -                                tcp->tcp_cwnd_cnt = 0;
 812      -                                if (tcp->tcp_ecn_ok) {
 813      -                                        tcp->tcp_cwr = B_TRUE;
 814      -                                        tcp->tcp_cwr_snd_max = tcp->tcp_snxt;
 815      -                                        tcp->tcp_ecn_cwr_sent = B_FALSE;
 816      -                                }
      787 +                                cc_cong_signal(tcp, NULL, CC_RTO);
 817  788                          }
 818  789                          break;
 819  790                  }
 820  791                  /*
 821  792                   * We have something to send yet we cannot send.  The
 822  793                   * reason can be:
 823  794                   *
 824  795                   * 1. Zero send window: we need to do zero window probe.
 825  796                   * 2. Zero cwnd: because of ECN, we need to "clock out
 826  797                   * segments.
↓ open down ↓ 277 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX