FreeBSD kernel IPv4 code
cc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  cc_var
 
union  cc_var::ccv_container
 
struct  cc_algo
 

Macros

#define V_default_cc_ptr   VNET(default_cc_ptr)
 
#define V_cc_do_abe   VNET(cc_do_abe)
 
#define V_cc_abe_frlossreduce   VNET(cc_abe_frlossreduce)
 
#define CCF_ABC_SENTAWND   0x0001 /* ABC counted cwnd worth of bytes? */
 
#define CCF_CWND_LIMITED   0x0002 /* Are we currently cwnd limited? */
 
#define CCF_USE_LOCAL_ABC   0x0004 /* Dont use the system l_abc val */
 
#define CCF_ACKNOW   0x0008 /* Will this ack be sent now? */
 
#define CCF_IPHDR_CE   0x0010 /* Does this packet set CE bit? */
 
#define CCF_TCPHDR_CWR   0x0020 /* Does this packet set CWR bit? */
 
#define CCF_MAX_CWND   0x0040 /* Have we reached maximum cwnd? */
 
#define CCF_CHG_MAX_CWND   0x0080 /* Cubic max_cwnd changed, for K */
 
#define CCF_USR_IWND   0x0100 /* User specified initial window */
 
#define CCF_USR_IWND_INIT_NSEG   0x0200 /* Convert segs to bytes on conn init */
 
#define CCF_HYSTART_ALLOWED   0x0400 /* If the CC supports it Hystart is allowed */
 
#define CCF_HYSTART_CAN_SH_CWND   0x0800 /* Can hystart when going CSS -> CA slam the cwnd */
 
#define CCF_HYSTART_CONS_SSTH   0x1000 /* Should hystart use the more conservative ssthresh */
 
#define CC_ACK   0x0001 /* Regular in sequence ACK. */
 
#define CC_DUPACK   0x0002 /* Duplicate ACK. */
 
#define CC_PARTIALACK   0x0004 /* Not yet. */
 
#define CC_SACK   0x0008 /* Not yet. */
 
#define CC_ECN   0x00000001 /* ECN marked packet received. */
 
#define CC_RTO   0x00000002 /* RTO fired. */
 
#define CC_RTO_ERR   0x00000004 /* RTO fired in error. */
 
#define CC_NDUPACK   0x00000008 /* Threshold of dupack's reached. */
 
#define CC_SIGPRIVMASK   0xFF000000 /* Mask to check if sig is private. */
 
#define CC_MODULE_BEING_REMOVED   0x01 /* The module is being removed */
 
#define CC_ALGO(tp)   ((tp)->cc_algo)
 
#define CC_DATA(tp)   ((tp)->ccv->cc_data)
 
#define CC_DEFAULT_ALGO()   V_default_cc_ptr
 
#define CC_LIST_LOCK_INIT()   rw_init(&cc_list_lock, "cc_list")
 
#define CC_LIST_LOCK_DESTROY()   rw_destroy(&cc_list_lock)
 
#define CC_LIST_RLOCK()   rw_rlock(&cc_list_lock)
 
#define CC_LIST_RUNLOCK()   rw_runlock(&cc_list_lock)
 
#define CC_LIST_WLOCK()   rw_wlock(&cc_list_lock)
 
#define CC_LIST_WUNLOCK()   rw_wunlock(&cc_list_lock)
 
#define CC_LIST_LOCK_ASSERT()   rw_assert(&cc_list_lock, RA_LOCKED)
 
#define CC_ALGOOPT_LIMIT   2048
 

Functions

 MALLOC_DECLARE (M_CC_MEM)
 
 STAILQ_HEAD (cc_head, cc_algo) cc_list
 
 VNET_DECLARE (struct cc_algo *, default_cc_ptr)
 
 VNET_DECLARE (int, cc_do_abe)
 
 VNET_DECLARE (int, cc_abe_frlossreduce)
 
 SYSCTL_DECL (_net_inet_tcp_cc)
 
int cc_register_algo (struct cc_algo *add_cc)
 
int cc_deregister_algo (struct cc_algo *remove_cc)
 
void newreno_cc_post_recovery (struct cc_var *)
 
void newreno_cc_after_idle (struct cc_var *)
 
void newreno_cc_cong_signal (struct cc_var *, uint32_t)
 
void newreno_cc_ack_received (struct cc_var *, uint16_t)
 
void cc_refer (struct cc_algo *algo)
 
void cc_release (struct cc_algo *algo)
 
void cc_attach (struct tcpcb *, struct cc_algo *)
 
void cc_detach (struct tcpcb *)
 

Variables

const int tcprexmtthresh
 
uint32_t hystart_lowcwnd
 
uint32_t hystart_minrtt_thresh
 
uint32_t hystart_maxrtt_thresh
 
uint32_t hystart_n_rttsamples
 
uint32_t hystart_css_growth_div
 
uint32_t hystart_css_rounds
 
uint32_t hystart_bblogs
 
struct rwlock cc_list_lock
 

Macro Definition Documentation

◆ CC_ACK

#define CC_ACK   0x0001 /* Regular in sequence ACK. */

Definition at line 123 of file cc.h.

◆ CC_ALGO

#define CC_ALGO (   tp)    ((tp)->cc_algo)

Definition at line 210 of file cc.h.

◆ CC_ALGOOPT_LIMIT

#define CC_ALGOOPT_LIMIT   2048

Definition at line 227 of file cc.h.

◆ CC_DATA

#define CC_DATA (   tp)    ((tp)->ccv->cc_data)

Definition at line 213 of file cc.h.

◆ CC_DEFAULT_ALGO

#define CC_DEFAULT_ALGO ( )    V_default_cc_ptr

Definition at line 216 of file cc.h.

◆ CC_DUPACK

#define CC_DUPACK   0x0002 /* Duplicate ACK. */

Definition at line 124 of file cc.h.

◆ CC_ECN

#define CC_ECN   0x00000001 /* ECN marked packet received. */

Definition at line 134 of file cc.h.

◆ CC_LIST_LOCK_ASSERT

#define CC_LIST_LOCK_ASSERT ( )    rw_assert(&cc_list_lock, RA_LOCKED)

Definition at line 225 of file cc.h.

◆ CC_LIST_LOCK_DESTROY

#define CC_LIST_LOCK_DESTROY ( )    rw_destroy(&cc_list_lock)

Definition at line 220 of file cc.h.

◆ CC_LIST_LOCK_INIT

#define CC_LIST_LOCK_INIT ( )    rw_init(&cc_list_lock, "cc_list")

Definition at line 219 of file cc.h.

◆ CC_LIST_RLOCK

#define CC_LIST_RLOCK ( )    rw_rlock(&cc_list_lock)

Definition at line 221 of file cc.h.

◆ CC_LIST_RUNLOCK

#define CC_LIST_RUNLOCK ( )    rw_runlock(&cc_list_lock)

Definition at line 222 of file cc.h.

◆ CC_LIST_WLOCK

#define CC_LIST_WLOCK ( )    rw_wlock(&cc_list_lock)

Definition at line 223 of file cc.h.

◆ CC_LIST_WUNLOCK

#define CC_LIST_WUNLOCK ( )    rw_wunlock(&cc_list_lock)

Definition at line 224 of file cc.h.

◆ CC_MODULE_BEING_REMOVED

#define CC_MODULE_BEING_REMOVED   0x01 /* The module is being removed */

Definition at line 207 of file cc.h.

◆ CC_NDUPACK

#define CC_NDUPACK   0x00000008 /* Threshold of dupack's reached. */

Definition at line 137 of file cc.h.

◆ CC_PARTIALACK

#define CC_PARTIALACK   0x0004 /* Not yet. */

Definition at line 125 of file cc.h.

◆ CC_RTO

#define CC_RTO   0x00000002 /* RTO fired. */

Definition at line 135 of file cc.h.

◆ CC_RTO_ERR

#define CC_RTO_ERR   0x00000004 /* RTO fired in error. */

Definition at line 136 of file cc.h.

◆ CC_SACK

#define CC_SACK   0x0008 /* Not yet. */

Definition at line 126 of file cc.h.

◆ CC_SIGPRIVMASK

#define CC_SIGPRIVMASK   0xFF000000 /* Mask to check if sig is private. */

Definition at line 139 of file cc.h.

◆ CCF_ABC_SENTAWND

#define CCF_ABC_SENTAWND   0x0001 /* ABC counted cwnd worth of bytes? */

Definition at line 108 of file cc.h.

◆ CCF_ACKNOW

#define CCF_ACKNOW   0x0008 /* Will this ack be sent now? */

Definition at line 111 of file cc.h.

◆ CCF_CHG_MAX_CWND

#define CCF_CHG_MAX_CWND   0x0080 /* Cubic max_cwnd changed, for K */

Definition at line 115 of file cc.h.

◆ CCF_CWND_LIMITED

#define CCF_CWND_LIMITED   0x0002 /* Are we currently cwnd limited? */

Definition at line 109 of file cc.h.

◆ CCF_HYSTART_ALLOWED

#define CCF_HYSTART_ALLOWED   0x0400 /* If the CC supports it Hystart is allowed */

Definition at line 118 of file cc.h.

◆ CCF_HYSTART_CAN_SH_CWND

#define CCF_HYSTART_CAN_SH_CWND   0x0800 /* Can hystart when going CSS -> CA slam the cwnd */

Definition at line 119 of file cc.h.

◆ CCF_HYSTART_CONS_SSTH

#define CCF_HYSTART_CONS_SSTH   0x1000 /* Should hystart use the more conservative ssthresh */

Definition at line 120 of file cc.h.

◆ CCF_IPHDR_CE

#define CCF_IPHDR_CE   0x0010 /* Does this packet set CE bit? */

Definition at line 112 of file cc.h.

◆ CCF_MAX_CWND

#define CCF_MAX_CWND   0x0040 /* Have we reached maximum cwnd? */

Definition at line 114 of file cc.h.

◆ CCF_TCPHDR_CWR

#define CCF_TCPHDR_CWR   0x0020 /* Does this packet set CWR bit? */

Definition at line 113 of file cc.h.

◆ CCF_USE_LOCAL_ABC

#define CCF_USE_LOCAL_ABC   0x0004 /* Dont use the system l_abc val */

Definition at line 110 of file cc.h.

◆ CCF_USR_IWND

#define CCF_USR_IWND   0x0100 /* User specified initial window */

Definition at line 116 of file cc.h.

◆ CCF_USR_IWND_INIT_NSEG

#define CCF_USR_IWND_INIT_NSEG   0x0200 /* Convert segs to bytes on conn init */

Definition at line 117 of file cc.h.

◆ V_cc_abe_frlossreduce

#define V_cc_abe_frlossreduce   VNET(cc_abe_frlossreduce)

Definition at line 70 of file cc.h.

◆ V_cc_do_abe

#define V_cc_do_abe   VNET(cc_do_abe)

Definition at line 67 of file cc.h.

◆ V_default_cc_ptr

#define V_default_cc_ptr   VNET(default_cc_ptr)

Definition at line 64 of file cc.h.

Function Documentation

◆ cc_attach()

void cc_attach ( struct tcpcb tp,
struct cc_algo algo 
)

Definition at line 126 of file cc.c.

References CC_ALGO, CC_LIST_RLOCK, CC_LIST_RUNLOCK, and cc_refer().

Referenced by tcp_newtcpcb(), and tcp_set_cc_mod().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cc_deregister_algo()

int cc_deregister_algo ( struct cc_algo remove_cc)

Definition at line 284 of file cc.c.

References cc_check_default(), cc_list, CC_LIST_WLOCK, CC_LIST_WUNLOCK, CC_MODULE_BEING_REMOVED, cc_algo::cc_refcount, and cc_algo::flags.

Referenced by cc_modevent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cc_detach()

void cc_detach ( struct tcpcb tp)

Definition at line 138 of file cc.c.

References CC_ALGO, CC_LIST_RLOCK, CC_LIST_RUNLOCK, and cc_release().

Referenced by tcp_discardcb(), tcp_newtcpcb(), and tcp_set_cc_mod().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cc_refer()

void cc_refer ( struct cc_algo algo)

Definition at line 111 of file cc.c.

References CC_LIST_LOCK_ASSERT, and cc_algo::cc_refcount.

Referenced by cc_attach(), and tcp_set_cc_mod().

Here is the caller graph for this function:

◆ cc_register_algo()

int cc_register_algo ( struct cc_algo add_cc)

Definition at line 322 of file cc.c.

References CC_DEFAULT, cc_list, CC_LIST_WLOCK, CC_LIST_WUNLOCK, cc_algo::cc_refcount, cc_algo::name, and V_default_cc_ptr.

Referenced by cc_modevent().

Here is the caller graph for this function:

◆ cc_release()

void cc_release ( struct cc_algo algo)

Definition at line 118 of file cc.c.

References CC_LIST_LOCK_ASSERT, and cc_algo::cc_refcount.

Referenced by cc_detach(), and tcp_set_cc_mod().

Here is the caller graph for this function:

◆ MALLOC_DECLARE()

MALLOC_DECLARE ( M_CC_MEM  )

◆ newreno_cc_ack_received()

void newreno_cc_ack_received ( struct cc_var ccv,
uint16_t  type 
)

◆ newreno_cc_after_idle()

void newreno_cc_after_idle ( struct cc_var ccv)

Definition at line 415 of file cc.c.

References CCV, cc_var::ccvc, cc_var::ccv_container::tcp, tcp_compute_initwnd(), and tcp_maxseg().

Referenced by cubic_after_idle(), dctcp_after_idle(), and newreno_after_idle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ newreno_cc_cong_signal()

void newreno_cc_cong_signal ( struct cc_var ccv,
uint32_t  type 
)

Definition at line 447 of file cc.c.

References CC_ECN, CC_NDUPACK, CC_RTO, CC_SIGPRIVMASK, CCV, cc_var::ccvc, ENTER_CONGRECOVERY, ENTER_RECOVERY, IN_CONGRECOVERY, IN_FASTRECOVERY, cc_var::ccv_container::tcp, tcp_fixed_maxseg(), and V_newreno_beta.

Referenced by cdg_cong_signal(), chd_cong_signal(), dctcp_cong_signal(), hd_ack_received(), and vegas_cong_signal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ newreno_cc_post_recovery()

void newreno_cc_post_recovery ( struct cc_var ccv)

Definition at line 384 of file cc.c.

References CCV, cc_var::ccvc, cc_var::curack, IN_FASTRECOVERY, cc_var::ccv_container::tcp, tcp_compute_pipe(), and V_tcp_do_newsack.

Referenced by dctcp_post_recovery().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ STAILQ_HEAD()

STAILQ_HEAD ( cc_head  ,
cc_algo   
)

◆ SYSCTL_DECL()

SYSCTL_DECL ( _net_inet_tcp_cc  )

◆ VNET_DECLARE() [1/3]

VNET_DECLARE ( int  ,
cc_abe_frlossreduce   
)

◆ VNET_DECLARE() [2/3]

VNET_DECLARE ( int  ,
cc_do_abe   
)

◆ VNET_DECLARE() [3/3]

VNET_DECLARE ( struct cc_algo ,
default_cc_ptr   
)

Variable Documentation

◆ cc_list_lock

struct rwlock cc_list_lock
extern

Definition at line 103 of file cc.c.

◆ hystart_bblogs

uint32_t hystart_bblogs
extern

Definition at line 92 of file cc.c.

Referenced by cubic_log_hystart_event(), and newreno_log_hystart_event().

◆ hystart_css_growth_div

uint32_t hystart_css_growth_div
extern

Definition at line 90 of file cc.c.

Referenced by cubic_does_slow_start(), and newreno_ack_received().

◆ hystart_css_rounds

uint32_t hystart_css_rounds
extern

Definition at line 91 of file cc.c.

Referenced by cubic_newround(), and newreno_newround().

◆ hystart_lowcwnd

uint32_t hystart_lowcwnd
extern

◆ hystart_maxrtt_thresh

uint32_t hystart_maxrtt_thresh
extern

Definition at line 88 of file cc.c.

Referenced by cubic_does_slow_start(), and newreno_ack_received().

◆ hystart_minrtt_thresh

uint32_t hystart_minrtt_thresh
extern

Definition at line 87 of file cc.c.

Referenced by cubic_does_slow_start(), and newreno_ack_received().

◆ hystart_n_rttsamples

uint32_t hystart_n_rttsamples
extern

◆ tcprexmtthresh

const int tcprexmtthresh
extern

Definition at line 135 of file tcp_input.c.

Referenced by tcp_do_prr_ack(), and tcp_do_segment().