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>

@@ -20,11 +20,11 @@
  */
 /*
  * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2011, Joyent, Inc. All rights reserved.
  * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2014, 2016 by Delphix. All rights reserved.
+ * Copyright (c) 2014, 2017 by Delphix. All rights reserved.
  */
 /* Copyright (c) 1990 Mentat Inc. */
 
 #ifndef _INET_TCP_H
 #define _INET_TCP_H

@@ -44,10 +44,11 @@
 #include <inet/ip6.h>
 #include <inet/mi.h>
 #include <inet/mib2.h>
 #include <inet/tcp_stack.h>
 #include <inet/tcp_sack.h>
+#include <inet/cc.h>
 
 /* TCP states */
 #define TCPS_CLOSED             -6
 #define TCPS_IDLE               -5      /* idle (opened, but not bound) */
 #define TCPS_BOUND              -4      /* bound, ready to connect or accept */

@@ -150,10 +151,13 @@
         int64_t         tcp_time_wait_expire;
 
         struct conn_s   *tcp_connp;     /* back pointer to conn_t */
         tcp_stack_t     *tcp_tcps;      /* back pointer to tcp_stack_t */
 
+        struct cc_algo  *tcp_cc_algo;   /* congestion control algorithm */
+        struct cc_var   tcp_ccv;        /* congestion control specific vars */
+
         int32_t tcp_state;
         int32_t tcp_rcv_ws;             /* My window scale power */
         int32_t tcp_snd_ws;             /* Sender's window scale power */
         uint32_t tcp_ts_recent;         /* Timestamp of earliest unacked */
                                         /*  data segment */

@@ -504,11 +508,11 @@
 
 extern void     tcp_conn_reclaim(void *);
 extern void     tcp_free(tcp_t *tcp);
 extern void     tcp_ddi_g_init(void);
 extern void     tcp_ddi_g_destroy(void);
-extern void     *tcp_get_conn(void *arg, tcp_stack_t *);
+extern conn_t   *tcp_get_conn(void *arg, tcp_stack_t *);
 extern mblk_t   *tcp_snmp_get(queue_t *, mblk_t *, boolean_t);
 extern int      tcp_snmp_set(queue_t *, int, int, uchar_t *, int len);
 
 /* Pad for the tf_t structure to avoid false cache line sharing. */
 #define TF_CACHEL_PAD   64