FreeBSD kernel IPv4 code
sctp_cc_functions.c File Reference
#include <sys/cdefs.h>
#include <netinet/sctp_os.h>
#include <netinet/sctp_var.h>
#include <netinet/sctp_sysctl.h>
#include <netinet/sctp_pcb.h>
#include <netinet/sctp_header.h>
#include <netinet/sctputil.h>
#include <netinet/sctp_output.h>
#include <netinet/sctp_input.h>
#include <netinet/sctp_indata.h>
#include <netinet/sctp_uio.h>
#include <netinet/sctp_timer.h>
#include <netinet/sctp_auth.h>
#include <netinet/sctp_asconf.h>
#include <netinet/sctp_kdtrace.h>
Include dependency graph for sctp_cc_functions.c:

Go to the source code of this file.

Data Structures

struct  sctp_hs_raise_drop
 

Macros

#define SHIFT_MPTCP_MULTI_N   40
 
#define SHIFT_MPTCP_MULTI_Z   16
 
#define SHIFT_MPTCP_MULTI   8
 
#define SCTP_INST_LOOSING   1 /* Losing to other flows */
 
#define SCTP_INST_NEUTRAL   2 /* Neutral, no indication */
 
#define SCTP_INST_GAINING   3 /* Gaining, step down possible */
 
#define SCTP_HS_TABLE_SIZE   73
 

Functions

 __FBSDID ("$FreeBSD$")
 
static void sctp_enforce_cwnd_limit (struct sctp_association *assoc, struct sctp_nets *net)
 
static void sctp_set_initial_cc_param (struct sctp_tcb *stcb, struct sctp_nets *net)
 
static void sctp_cwnd_update_after_fr (struct sctp_tcb *stcb, struct sctp_association *asoc)
 
static int cc_bw_same (struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, uint64_t rtt_offset, uint64_t vtag, uint8_t inst_ind)
 
static int cc_bw_decrease (struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, uint64_t rtt_offset, uint64_t vtag, uint8_t inst_ind)
 
static int cc_bw_increase (struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw, uint64_t vtag)
 
static int cc_bw_limit (struct sctp_tcb *stcb, struct sctp_nets *net, uint64_t nbw)
 
static void sctp_cwnd_update_after_sack_common (struct sctp_tcb *stcb, struct sctp_association *asoc, int accum_moved, int reneged_all SCTP_UNUSED, int will_exit, int use_rtcc)
 
static void sctp_cwnd_update_exit_pf_common (struct sctp_tcb *stcb, struct sctp_nets *net)
 
static void sctp_cwnd_update_after_timeout (struct sctp_tcb *stcb, struct sctp_nets *net)
 
static void sctp_cwnd_update_after_ecn_echo_common (struct sctp_tcb *stcb, struct sctp_nets *net, int in_window, int num_pkt_lost, int use_rtcc)
 
static void sctp_cwnd_update_after_packet_dropped (struct sctp_tcb *stcb, struct sctp_nets *net, struct sctp_pktdrop_chunk *cp, uint32_t *bottle_bw, uint32_t *on_queue)
 
static void sctp_cwnd_update_after_output (struct sctp_tcb *stcb, struct sctp_nets *net, int burst_limit)
 
static void sctp_cwnd_update_after_sack (struct sctp_tcb *stcb, struct sctp_association *asoc, int accum_moved, int reneged_all, int will_exit)
 
static void sctp_cwnd_update_after_ecn_echo (struct sctp_tcb *stcb, struct sctp_nets *net, int in_window, int num_pkt_lost)
 
static void sctp_cwnd_update_rtcc_after_ecn_echo (struct sctp_tcb *stcb, struct sctp_nets *net, int in_window, int num_pkt_lost)
 
static void sctp_cwnd_update_rtcc_tsn_acknowledged (struct sctp_nets *net, struct sctp_tmit_chunk *tp1)
 
static void sctp_cwnd_prepare_rtcc_net_for_sack (struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net)
 
static void sctp_cwnd_new_rtcc_transmission_begins (struct sctp_tcb *stcb, struct sctp_nets *net)
 
static void sctp_set_rtcc_initial_cc_param (struct sctp_tcb *stcb, struct sctp_nets *net)
 
static int sctp_cwnd_rtcc_socket_option (struct sctp_tcb *stcb, int setorget, struct sctp_cc_option *cc_opt)
 
static void sctp_cwnd_update_rtcc_packet_transmitted (struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net)
 
static void sctp_cwnd_update_rtcc_after_sack (struct sctp_tcb *stcb, struct sctp_association *asoc, int accum_moved, int reneged_all, int will_exit)
 
static void sctp_rtt_rtcc_calculated (struct sctp_tcb *stcb SCTP_UNUSED, struct sctp_nets *net, struct timeval *now SCTP_UNUSED)
 
static void sctp_hs_cwnd_increase (struct sctp_tcb *stcb, struct sctp_nets *net)
 
static void sctp_hs_cwnd_decrease (struct sctp_tcb *stcb, struct sctp_nets *net)
 
static void sctp_hs_cwnd_update_after_fr (struct sctp_tcb *stcb, struct sctp_association *asoc)
 
static void sctp_hs_cwnd_update_after_sack (struct sctp_tcb *stcb, struct sctp_association *asoc, int accum_moved, int reneged_all SCTP_UNUSED, int will_exit)
 
static int between (uint32_t seq1, uint32_t seq2, uint32_t seq3)
 
static uint32_t htcp_cong_time (struct htcp *ca)
 
static uint32_t htcp_ccount (struct htcp *ca)
 
static void htcp_reset (struct htcp *ca)
 
static void measure_rtt (struct sctp_nets *net)
 
static void measure_achieved_throughput (struct sctp_nets *net)
 
static void htcp_beta_update (struct htcp *ca, uint32_t minRTT, uint32_t maxRTT)
 
static void htcp_alpha_update (struct htcp *ca)
 
static void htcp_param_update (struct sctp_nets *net)
 
static uint32_t htcp_recalc_ssthresh (struct sctp_nets *net)
 
static void htcp_cong_avoid (struct sctp_tcb *stcb, struct sctp_nets *net)
 
static void htcp_init (struct sctp_nets *net)
 
static void sctp_htcp_set_initial_cc_param (struct sctp_tcb *stcb, struct sctp_nets *net)
 
static void sctp_htcp_cwnd_update_after_sack (struct sctp_tcb *stcb, struct sctp_association *asoc, int accum_moved, int reneged_all SCTP_UNUSED, int will_exit)
 
static void sctp_htcp_cwnd_update_after_fr (struct sctp_tcb *stcb, struct sctp_association *asoc)
 
static void sctp_htcp_cwnd_update_after_timeout (struct sctp_tcb *stcb, struct sctp_nets *net)
 
static void sctp_htcp_cwnd_update_after_ecn_echo (struct sctp_tcb *stcb, struct sctp_nets *net, int in_window, int num_pkt_lost SCTP_UNUSED)
 

Variables

static const struct sctp_hs_raise_drop sctp_cwnd_adjust [SCTP_HS_TABLE_SIZE]
 
static int use_rtt_scaling = 1
 
static int use_bandwidth_switch = 1
 
const struct sctp_cc_functions sctp_cc_functions []
 

Macro Definition Documentation

◆ SCTP_HS_TABLE_SIZE

#define SCTP_HS_TABLE_SIZE   73

Definition at line 1526 of file sctp_cc_functions.c.

◆ SCTP_INST_GAINING

#define SCTP_INST_GAINING   3 /* Gaining, step down possible */

Definition at line 249 of file sctp_cc_functions.c.

◆ SCTP_INST_LOOSING

#define SCTP_INST_LOOSING   1 /* Losing to other flows */

Definition at line 247 of file sctp_cc_functions.c.

◆ SCTP_INST_NEUTRAL

#define SCTP_INST_NEUTRAL   2 /* Neutral, no indication */

Definition at line 248 of file sctp_cc_functions.c.

◆ SHIFT_MPTCP_MULTI

#define SHIFT_MPTCP_MULTI   8

Definition at line 55 of file sctp_cc_functions.c.

◆ SHIFT_MPTCP_MULTI_N

#define SHIFT_MPTCP_MULTI_N   40

Definition at line 53 of file sctp_cc_functions.c.

◆ SHIFT_MPTCP_MULTI_Z

#define SHIFT_MPTCP_MULTI_Z   16

Definition at line 54 of file sctp_cc_functions.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ between()

static int between ( uint32_t  seq1,
uint32_t  seq2,
uint32_t  seq3 
)
inlinestatic

Definition at line 1851 of file sctp_cc_functions.c.

Referenced by htcp_beta_update().

Here is the caller graph for this function:

◆ cc_bw_decrease()

static int cc_bw_decrease ( struct sctp_tcb stcb,
struct sctp_nets net,
uint64_t  nbw,
uint64_t  rtt_offset,
uint64_t  vtag,
uint8_t  inst_ind 
)
static

◆ cc_bw_increase()

static int cc_bw_increase ( struct sctp_tcb stcb,
struct sctp_nets net,
uint64_t  nbw,
uint64_t  vtag 
)
static

◆ cc_bw_limit()

◆ cc_bw_same()

static int cc_bw_same ( struct sctp_tcb stcb,
struct sctp_nets net,
uint64_t  nbw,
uint64_t  rtt_offset,
uint64_t  vtag,
uint8_t  inst_ind 
)
static

◆ htcp_alpha_update()

static void htcp_alpha_update ( struct htcp ca)
inlinestatic

Definition at line 1977 of file sctp_cc_functions.c.

References htcp::alpha, ALPHA_BASE, htcp::beta, htcp_cong_time(), htcp::minRTT, and use_rtt_scaling.

Referenced by htcp_cong_avoid(), and htcp_param_update().

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

◆ htcp_beta_update()

static void htcp_beta_update ( struct htcp ca,
uint32_t  minRTT,
uint32_t  maxRTT 
)
inlinestatic

Definition at line 1949 of file sctp_cc_functions.c.

References htcp::beta, BETA_MAX, BETA_MIN, between(), htcp::maxB, htcp::modeswitch, htcp::old_maxB, sctp_msecs_to_ticks(), and use_bandwidth_switch.

Referenced by htcp_param_update().

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

◆ htcp_ccount()

static uint32_t htcp_ccount ( struct htcp ca)
inlinestatic

Definition at line 1863 of file sctp_cc_functions.c.

References htcp_cong_time(), and htcp::minRTT.

Referenced by measure_achieved_throughput(), and measure_rtt().

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

◆ htcp_cong_avoid()

◆ htcp_cong_time()

static uint32_t htcp_cong_time ( struct htcp ca)
inlinestatic

Definition at line 1857 of file sctp_cc_functions.c.

References htcp::last_cong, and sctp_get_tick_count.

Referenced by htcp_alpha_update(), and htcp_ccount().

Here is the caller graph for this function:

◆ htcp_init()

static void htcp_init ( struct sctp_nets net)
static

◆ htcp_param_update()

static void htcp_param_update ( struct sctp_nets net)
static

Definition at line 2012 of file sctp_cc_functions.c.

References sctp_nets::cc_mod, htcp_alpha_update(), htcp_beta_update(), sctp_nets::cc_control_data::htcp_ca, htcp::maxRTT, and htcp::minRTT.

Referenced by htcp_recalc_ssthresh().

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

◆ htcp_recalc_ssthresh()

static uint32_t htcp_recalc_ssthresh ( struct sctp_nets net)
static

Definition at line 2029 of file sctp_cc_functions.c.

References htcp::beta, sctp_nets::cc_mod, sctp_nets::cwnd, sctp_nets::cc_control_data::htcp_ca, htcp_param_update(), and sctp_nets::mtu.

Referenced by sctp_htcp_cwnd_update_after_ecn_echo(), sctp_htcp_cwnd_update_after_fr(), and sctp_htcp_cwnd_update_after_timeout().

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

◆ htcp_reset()

static void htcp_reset ( struct htcp ca)
inlinestatic

◆ measure_achieved_throughput()

static void measure_achieved_throughput ( struct sctp_nets net)
static

◆ measure_rtt()

static void measure_rtt ( struct sctp_nets net)
inlinestatic

Definition at line 1891 of file sctp_cc_functions.c.

References sctp_nets::cc_mod, sctp_nets::fast_retran_ip, sctp_nets::cc_control_data::htcp_ca, htcp_ccount(), sctp_nets::lastsa, htcp::maxRTT, htcp::minRTT, sctp_msecs_to_ticks(), SCTP_RTT_SHIFT, and sctp_nets::ssthresh.

Referenced by htcp_cong_avoid().

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

◆ sctp_cwnd_new_rtcc_transmission_begins()

◆ sctp_cwnd_prepare_rtcc_net_for_sack()

static void sctp_cwnd_prepare_rtcc_net_for_sack ( struct sctp_tcb *stcb  SCTP_UNUSED,
struct sctp_nets net 
)
static

◆ sctp_cwnd_rtcc_socket_option()

◆ sctp_cwnd_update_after_ecn_echo()

static void sctp_cwnd_update_after_ecn_echo ( struct sctp_tcb stcb,
struct sctp_nets net,
int  in_window,
int  num_pkt_lost 
)
static

Definition at line 1295 of file sctp_cc_functions.c.

References sctp_cwnd_update_after_ecn_echo_common().

Here is the call graph for this function:

◆ sctp_cwnd_update_after_ecn_echo_common()

static void sctp_cwnd_update_after_ecn_echo_common ( struct sctp_tcb stcb,
struct sctp_nets net,
int  in_window,
int  num_pkt_lost,
int  use_rtcc 
)
static

◆ sctp_cwnd_update_after_fr()

◆ sctp_cwnd_update_after_output()

static void sctp_cwnd_update_after_output ( struct sctp_tcb stcb,
struct sctp_nets net,
int  burst_limit 
)
static

◆ sctp_cwnd_update_after_packet_dropped()

◆ sctp_cwnd_update_after_sack()

static void sctp_cwnd_update_after_sack ( struct sctp_tcb stcb,
struct sctp_association asoc,
int  accum_moved,
int  reneged_all,
int  will_exit 
)
static

Definition at line 1286 of file sctp_cc_functions.c.

References sctp_cwnd_update_after_sack_common().

Here is the call graph for this function:

◆ sctp_cwnd_update_after_sack_common()

static void sctp_cwnd_update_after_sack_common ( struct sctp_tcb stcb,
struct sctp_association asoc,
int  accum_moved,
int reneged_all  SCTP_UNUSED,
int  will_exit,
int  use_rtcc 
)
static

◆ sctp_cwnd_update_after_timeout()

◆ sctp_cwnd_update_exit_pf_common()

static void sctp_cwnd_update_exit_pf_common ( struct sctp_tcb stcb,
struct sctp_nets net 
)
static

◆ sctp_cwnd_update_rtcc_after_ecn_echo()

static void sctp_cwnd_update_rtcc_after_ecn_echo ( struct sctp_tcb stcb,
struct sctp_nets net,
int  in_window,
int  num_pkt_lost 
)
static

Definition at line 1308 of file sctp_cc_functions.c.

References sctp_cwnd_update_after_ecn_echo_common().

Here is the call graph for this function:

◆ sctp_cwnd_update_rtcc_after_sack()

static void sctp_cwnd_update_rtcc_after_sack ( struct sctp_tcb stcb,
struct sctp_association asoc,
int  accum_moved,
int  reneged_all,
int  will_exit 
)
static

Definition at line 1502 of file sctp_cc_functions.c.

References sctp_cwnd_update_after_sack_common().

Here is the call graph for this function:

◆ sctp_cwnd_update_rtcc_packet_transmitted()

static void sctp_cwnd_update_rtcc_packet_transmitted ( struct sctp_tcb *stcb  SCTP_UNUSED,
struct sctp_nets net 
)
static

◆ sctp_cwnd_update_rtcc_tsn_acknowledged()

static void sctp_cwnd_update_rtcc_tsn_acknowledged ( struct sctp_nets net,
struct sctp_tmit_chunk tp1 
)
static

◆ sctp_enforce_cwnd_limit()

◆ sctp_hs_cwnd_decrease()

static void sctp_hs_cwnd_decrease ( struct sctp_tcb stcb,
struct sctp_nets net 
)
static

◆ sctp_hs_cwnd_increase()

static void sctp_hs_cwnd_increase ( struct sctp_tcb stcb,
struct sctp_nets net 
)
static

◆ sctp_hs_cwnd_update_after_fr()

◆ sctp_hs_cwnd_update_after_sack()

◆ sctp_htcp_cwnd_update_after_ecn_echo()

static void sctp_htcp_cwnd_update_after_ecn_echo ( struct sctp_tcb stcb,
struct sctp_nets net,
int  in_window,
int num_pkt_lost  SCTP_UNUSED 
)
static

◆ sctp_htcp_cwnd_update_after_fr()

◆ sctp_htcp_cwnd_update_after_sack()

◆ sctp_htcp_cwnd_update_after_timeout()

static void sctp_htcp_cwnd_update_after_timeout ( struct sctp_tcb stcb,
struct sctp_nets net 
)
static

◆ sctp_htcp_set_initial_cc_param()

static void sctp_htcp_set_initial_cc_param ( struct sctp_tcb stcb,
struct sctp_nets net 
)
static

◆ sctp_rtt_rtcc_calculated()

static void sctp_rtt_rtcc_calculated ( struct sctp_tcb *stcb  SCTP_UNUSED,
struct sctp_nets net,
struct timeval *now  SCTP_UNUSED 
)
static

◆ sctp_set_initial_cc_param()

◆ sctp_set_rtcc_initial_cc_param()

Variable Documentation

◆ sctp_cc_functions

Definition at line 2319 of file sctp_cc_functions.c.

◆ sctp_cwnd_adjust

const struct sctp_hs_raise_drop sctp_cwnd_adjust[SCTP_HS_TABLE_SIZE]
static

Definition at line 1528 of file sctp_cc_functions.c.

Referenced by sctp_hs_cwnd_decrease(), and sctp_hs_cwnd_increase().

◆ use_bandwidth_switch

int use_bandwidth_switch = 1
static

Definition at line 1848 of file sctp_cc_functions.c.

Referenced by htcp_beta_update(), and measure_achieved_throughput().

◆ use_rtt_scaling

int use_rtt_scaling = 1
static

Definition at line 1847 of file sctp_cc_functions.c.

Referenced by htcp_alpha_update().