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.h
          +++ new/usr/src/uts/common/inet/tcp.h
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  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   * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright (c) 2011, Joyent, Inc. All rights reserved.
  24   24   * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
  25      - * Copyright (c) 2014, 2016 by Delphix. All rights reserved.
       25 + * Copyright (c) 2014, 2017 by Delphix. All rights reserved.
  26   26   */
  27   27  /* Copyright (c) 1990 Mentat Inc. */
  28   28  
  29   29  #ifndef _INET_TCP_H
  30   30  #define _INET_TCP_H
  31   31  
  32   32  #ifdef  __cplusplus
  33   33  extern "C" {
  34   34  #endif
  35   35  
↓ open down ↓ 3 lines elided ↑ open up ↑
  39   39  #include <sys/socket.h>
  40   40  #include <sys/socket_proto.h>
  41   41  #include <sys/md5.h>
  42   42  #include <inet/common.h>
  43   43  #include <inet/ip.h>
  44   44  #include <inet/ip6.h>
  45   45  #include <inet/mi.h>
  46   46  #include <inet/mib2.h>
  47   47  #include <inet/tcp_stack.h>
  48   48  #include <inet/tcp_sack.h>
       49 +#include <inet/cc.h>
  49   50  
  50   51  /* TCP states */
  51   52  #define TCPS_CLOSED             -6
  52   53  #define TCPS_IDLE               -5      /* idle (opened, but not bound) */
  53   54  #define TCPS_BOUND              -4      /* bound, ready to connect or accept */
  54   55  #define TCPS_LISTEN             -3      /* listening for connection */
  55   56  #define TCPS_SYN_SENT           -2      /* active, have sent syn */
  56   57  #define TCPS_SYN_RCVD           -1      /* have received syn (and sent ours) */
  57   58  /* states < TCPS_ESTABLISHED are those where connections not established */
  58   59  #define TCPS_ESTABLISHED        0       /* established */
↓ open down ↓ 86 lines elided ↑ open up ↑
 145  146  typedef struct tcp_s {
 146  147          struct tcp_s    *tcp_time_wait_next;
 147  148                                  /* Pointer to next T/W block */
 148  149          struct tcp_s    *tcp_time_wait_prev;
 149  150                                  /* Pointer to previous T/W next */
 150  151          int64_t         tcp_time_wait_expire;
 151  152  
 152  153          struct conn_s   *tcp_connp;     /* back pointer to conn_t */
 153  154          tcp_stack_t     *tcp_tcps;      /* back pointer to tcp_stack_t */
 154  155  
      156 +        struct cc_algo  *tcp_cc_algo;   /* congestion control algorithm */
      157 +        struct cc_var   tcp_ccv;        /* congestion control specific vars */
      158 +
 155  159          int32_t tcp_state;
 156  160          int32_t tcp_rcv_ws;             /* My window scale power */
 157  161          int32_t tcp_snd_ws;             /* Sender's window scale power */
 158  162          uint32_t tcp_ts_recent;         /* Timestamp of earliest unacked */
 159  163                                          /*  data segment */
 160  164          clock_t tcp_rto;                /* Round trip timeout */
 161  165          int64_t tcp_last_rcv_lbolt;
 162  166                                  /* lbolt on last packet, used for PAWS */
 163  167          uint32_t tcp_rto_initial;       /* Initial RTO */
 164  168          uint32_t tcp_rto_min;           /* Minimum RTO */
↓ open down ↓ 331 lines elided ↑ open up ↑
 496  500  } tcp_t;
 497  501  
 498  502  #ifdef DEBUG
 499  503  #define TCP_DEBUG_GETPCSTACK(buffer, depth)     ((void) getpcstack(buffer, \
 500  504                                                      depth))
 501  505  #else
 502  506  #define TCP_DEBUG_GETPCSTACK(buffer, depth)
 503  507  #endif
 504  508  
 505  509  extern void     tcp_conn_reclaim(void *);
 506      -extern void     tcp_free(tcp_t *tcp);
      510 +extern void     tcp_free(tcp_t *tcp);
 507  511  extern void     tcp_ddi_g_init(void);
 508  512  extern void     tcp_ddi_g_destroy(void);
 509      -extern void     *tcp_get_conn(void *arg, tcp_stack_t *);
      513 +extern conn_t   *tcp_get_conn(void *arg, tcp_stack_t *);
 510  514  extern mblk_t   *tcp_snmp_get(queue_t *, mblk_t *, boolean_t);
 511  515  extern int      tcp_snmp_set(queue_t *, int, int, uchar_t *, int len);
 512  516  
 513  517  /* Pad for the tf_t structure to avoid false cache line sharing. */
 514  518  #define TF_CACHEL_PAD   64
 515  519  
 516  520  /*
 517  521   * The TCP Fanout structure for bind and acceptor hashes.
 518  522   * The hash tables and their linkage (tcp_*_hash, tcp_ptp*hn) are
 519  523   * protected by the per-bucket tf_lock.  Each tcp_t
↓ open down ↓ 76 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX