Cleanup the management of CC functions.
MFC after: 3 months.
This commit is contained in:
parent
166bee2858
commit
0e9a9c104e
@ -41,12 +41,11 @@
|
||||
#include <netinet/sctp_timer.h>
|
||||
#include <netinet/sctp_auth.h>
|
||||
#include <netinet/sctp_asconf.h>
|
||||
#include <netinet/sctp_cc_functions.h>
|
||||
#include <netinet/sctp_dtrace_declare.h>
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
void
|
||||
static void
|
||||
sctp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net)
|
||||
{
|
||||
struct sctp_association *assoc;
|
||||
@ -84,7 +83,7 @@ sctp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
sctp_cwnd_update_after_fr(struct sctp_tcb *stcb,
|
||||
struct sctp_association *asoc)
|
||||
{
|
||||
@ -191,7 +190,7 @@ sctp_cwnd_update_after_fr(struct sctp_tcb *stcb,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
sctp_cwnd_update_after_sack(struct sctp_tcb *stcb,
|
||||
struct sctp_association *asoc,
|
||||
int accum_moved, int reneged_all, int will_exit)
|
||||
@ -447,7 +446,7 @@ sctp_cwnd_update_after_sack(struct sctp_tcb *stcb,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
sctp_cwnd_update_after_timeout(struct sctp_tcb *stcb, struct sctp_nets *net)
|
||||
{
|
||||
int old_cwnd = net->cwnd;
|
||||
@ -489,7 +488,7 @@ sctp_cwnd_update_after_timeout(struct sctp_tcb *stcb, struct sctp_nets *net)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net)
|
||||
{
|
||||
int old_cwnd = net->cwnd;
|
||||
@ -512,7 +511,7 @@ sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
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)
|
||||
@ -628,7 +627,7 @@ sctp_cwnd_update_after_packet_dropped(struct sctp_tcb *stcb,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
sctp_cwnd_update_after_output(struct sctp_tcb *stcb,
|
||||
struct sctp_nets *net, int burst_limit)
|
||||
{
|
||||
@ -647,7 +646,7 @@ sctp_cwnd_update_after_output(struct sctp_tcb *stcb,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
sctp_cwnd_update_after_fr_timer(struct sctp_inpcb *inp,
|
||||
struct sctp_tcb *stcb, struct sctp_nets *net)
|
||||
{
|
||||
@ -836,7 +835,7 @@ sctp_hs_cwnd_decrease(struct sctp_tcb *stcb, struct sctp_nets *net)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
sctp_hs_cwnd_update_after_fr(struct sctp_tcb *stcb,
|
||||
struct sctp_association *asoc)
|
||||
{
|
||||
@ -908,7 +907,7 @@ sctp_hs_cwnd_update_after_fr(struct sctp_tcb *stcb,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
sctp_hs_cwnd_update_after_sack(struct sctp_tcb *stcb,
|
||||
struct sctp_association *asoc,
|
||||
int accum_moved, int reneged_all, int will_exit)
|
||||
@ -1374,7 +1373,7 @@ htcp_init(struct sctp_tcb *stcb, struct sctp_nets *net)
|
||||
net->htcp_ca.last_cong = sctp_get_tick_count();
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
sctp_htcp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net)
|
||||
{
|
||||
/*
|
||||
@ -1390,7 +1389,7 @@ sctp_htcp_set_initial_cc_param(struct sctp_tcb *stcb, struct sctp_nets *net)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
sctp_htcp_cwnd_update_after_sack(struct sctp_tcb *stcb,
|
||||
struct sctp_association *asoc,
|
||||
int accum_moved, int reneged_all, int will_exit)
|
||||
@ -1550,7 +1549,7 @@ sctp_htcp_cwnd_update_after_sack(struct sctp_tcb *stcb,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
sctp_htcp_cwnd_update_after_fr(struct sctp_tcb *stcb,
|
||||
struct sctp_association *asoc)
|
||||
{
|
||||
@ -1629,7 +1628,7 @@ sctp_htcp_cwnd_update_after_fr(struct sctp_tcb *stcb,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
sctp_htcp_cwnd_update_after_timeout(struct sctp_tcb *stcb,
|
||||
struct sctp_nets *net)
|
||||
{
|
||||
@ -1645,7 +1644,7 @@ sctp_htcp_cwnd_update_after_timeout(struct sctp_tcb *stcb,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
sctp_htcp_cwnd_update_after_fr_timer(struct sctp_inpcb *inp,
|
||||
struct sctp_tcb *stcb, struct sctp_nets *net)
|
||||
{
|
||||
@ -1669,7 +1668,7 @@ sctp_htcp_cwnd_update_after_fr_timer(struct sctp_inpcb *inp,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
sctp_htcp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb,
|
||||
struct sctp_nets *net)
|
||||
{
|
||||
@ -1691,3 +1690,36 @@ sctp_htcp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb,
|
||||
sctp_log_cwnd(stcb, net, (net->cwnd - old_cwnd), SCTP_CWND_LOG_FROM_SAT);
|
||||
}
|
||||
}
|
||||
|
||||
struct sctp_cc_functions sctp_cc_functions[] = {
|
||||
{
|
||||
.sctp_set_initial_cc_param = sctp_set_initial_cc_param,
|
||||
.sctp_cwnd_update_after_sack = sctp_cwnd_update_after_sack,
|
||||
.sctp_cwnd_update_after_fr = sctp_cwnd_update_after_fr,
|
||||
.sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout,
|
||||
.sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_after_ecn_echo,
|
||||
.sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped,
|
||||
.sctp_cwnd_update_after_output = sctp_cwnd_update_after_output,
|
||||
.sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer
|
||||
},
|
||||
{
|
||||
.sctp_set_initial_cc_param = sctp_set_initial_cc_param,
|
||||
.sctp_cwnd_update_after_sack = sctp_hs_cwnd_update_after_sack,
|
||||
.sctp_cwnd_update_after_fr = sctp_hs_cwnd_update_after_fr,
|
||||
.sctp_cwnd_update_after_timeout = sctp_cwnd_update_after_timeout,
|
||||
.sctp_cwnd_update_after_ecn_echo = sctp_cwnd_update_after_ecn_echo,
|
||||
.sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped,
|
||||
.sctp_cwnd_update_after_output = sctp_cwnd_update_after_output,
|
||||
.sctp_cwnd_update_after_fr_timer = sctp_cwnd_update_after_fr_timer
|
||||
},
|
||||
{
|
||||
.sctp_set_initial_cc_param = sctp_htcp_set_initial_cc_param,
|
||||
.sctp_cwnd_update_after_sack = sctp_htcp_cwnd_update_after_sack,
|
||||
.sctp_cwnd_update_after_fr = sctp_htcp_cwnd_update_after_fr,
|
||||
.sctp_cwnd_update_after_timeout = sctp_htcp_cwnd_update_after_timeout,
|
||||
.sctp_cwnd_update_after_ecn_echo = sctp_htcp_cwnd_update_after_ecn_echo,
|
||||
.sctp_cwnd_update_after_packet_dropped = sctp_cwnd_update_after_packet_dropped,
|
||||
.sctp_cwnd_update_after_output = sctp_cwnd_update_after_output,
|
||||
.sctp_cwnd_update_after_fr_timer = sctp_htcp_cwnd_update_after_fr_timer
|
||||
}
|
||||
};
|
||||
|
@ -1,116 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* a) Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* b) Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* c) Neither the name of Cisco Systems, Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
||||
* THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#ifndef __sctp_cc_functions_h__
|
||||
#define __sctp_cc_functions_h__
|
||||
|
||||
#if defined(_KERNEL) || defined(__Userspace__)
|
||||
|
||||
void
|
||||
sctp_set_initial_cc_param(struct sctp_tcb *stcb,
|
||||
struct sctp_nets *net);
|
||||
|
||||
void
|
||||
sctp_cwnd_update_after_fr(struct sctp_tcb *stcb,
|
||||
struct sctp_association *asoc);
|
||||
|
||||
void
|
||||
sctp_cwnd_update_after_sack(struct sctp_tcb *stcb,
|
||||
struct sctp_association *asoc,
|
||||
int accum_moved, int reneged_all, int will_exit);
|
||||
|
||||
void
|
||||
sctp_cwnd_update_after_timeout(struct sctp_tcb *stcb,
|
||||
struct sctp_nets *net);
|
||||
|
||||
void
|
||||
sctp_hs_cwnd_update_after_fr(struct sctp_tcb *stcb,
|
||||
struct sctp_association *asoc);
|
||||
|
||||
void
|
||||
sctp_hs_cwnd_update_after_sack(struct sctp_tcb *stcb,
|
||||
struct sctp_association *asoc,
|
||||
int accum_moved, int reneged_all, int will_exit);
|
||||
|
||||
void
|
||||
sctp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb,
|
||||
struct sctp_nets *net);
|
||||
|
||||
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);
|
||||
|
||||
void
|
||||
sctp_cwnd_update_after_output(struct sctp_tcb *stcb,
|
||||
struct sctp_nets *net, int burst_limit);
|
||||
|
||||
void
|
||||
sctp_cwnd_update_after_fr_timer(struct sctp_inpcb *inp,
|
||||
struct sctp_tcb *stcb, struct sctp_nets *net);
|
||||
|
||||
/*
|
||||
* HTCP algorithms are directly taken from
|
||||
* R.N.Shorten, D.J.Leith and are work/outcome from
|
||||
* a Cisco-URP grant to enhance HTCP for satellite
|
||||
* communications. We use the BSD Liscense
|
||||
* granted from his source and have modified his
|
||||
* algorithms to fit within the SCTP BSD framework.
|
||||
*/
|
||||
|
||||
void
|
||||
sctp_htcp_set_initial_cc_param(struct sctp_tcb *stcb,
|
||||
struct sctp_nets *net);
|
||||
|
||||
void
|
||||
sctp_htcp_cwnd_update_after_fr(struct sctp_tcb *stcb,
|
||||
struct sctp_association *asoc);
|
||||
|
||||
void
|
||||
sctp_htcp_cwnd_update_after_sack(struct sctp_tcb *stcb,
|
||||
struct sctp_association *asoc,
|
||||
int accum_moved, int reneged_all, int will_exit);
|
||||
|
||||
void
|
||||
sctp_htcp_cwnd_update_after_timeout(struct sctp_tcb *stcb,
|
||||
struct sctp_nets *net);
|
||||
|
||||
void
|
||||
sctp_htcp_cwnd_update_after_ecn_echo(struct sctp_tcb *stcb,
|
||||
struct sctp_nets *net);
|
||||
|
||||
void
|
||||
sctp_htcp_cwnd_update_after_fr_timer(struct sctp_inpcb *inp,
|
||||
struct sctp_tcb *stcb, struct sctp_nets *net);
|
||||
|
||||
#endif
|
||||
#endif
|
@ -2516,13 +2516,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id)
|
||||
m->sctp_sws_sender = SCTP_SWS_SENDER_DEF;
|
||||
m->sctp_sws_receiver = SCTP_SWS_RECEIVER_DEF;
|
||||
m->max_burst = SCTP_BASE_SYSCTL(sctp_max_burst_default);
|
||||
if ((SCTP_BASE_SYSCTL(sctp_default_cc_module) >= SCTP_CC_RFC2581) &&
|
||||
(SCTP_BASE_SYSCTL(sctp_default_cc_module) <= SCTP_CC_HTCP)) {
|
||||
m->sctp_default_cc_module = SCTP_BASE_SYSCTL(sctp_default_cc_module);
|
||||
} else {
|
||||
/* sysctl done with invalid value, set to 2581 */
|
||||
m->sctp_default_cc_module = SCTP_CC_RFC2581;
|
||||
}
|
||||
m->sctp_default_cc_module = SCTP_BASE_SYSCTL(sctp_default_cc_module);
|
||||
/* number of streams to pre-open on a association */
|
||||
m->pre_open_stream_count = SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default);
|
||||
|
||||
|
@ -48,11 +48,11 @@ __FBSDID("$FreeBSD$");
|
||||
#include <netinet/sctp_timer.h>
|
||||
#include <netinet/sctp_auth.h>
|
||||
#include <netinet/sctp_bsd_addr.h>
|
||||
#include <netinet/sctp_cc_functions.h>
|
||||
#include <netinet/udp.h>
|
||||
|
||||
|
||||
|
||||
extern struct sctp_cc_functions sctp_cc_functions[];
|
||||
|
||||
void
|
||||
sctp_init(void)
|
||||
@ -2867,75 +2867,26 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
|
||||
SCTP_FIND_STCB(inp, stcb, av->assoc_id);
|
||||
if (stcb) {
|
||||
switch (av->assoc_value) {
|
||||
/*
|
||||
* JRS - Standard TCP congestion
|
||||
* control
|
||||
*/
|
||||
case SCTP_CC_RFC2581:
|
||||
{
|
||||
stcb->asoc.congestion_control_module = SCTP_CC_RFC2581;
|
||||
stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_cwnd_update_after_sack;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_cwnd_update_after_fr;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer;
|
||||
SCTP_TCB_UNLOCK(stcb);
|
||||
break;
|
||||
}
|
||||
/*
|
||||
* JRS - High Speed TCP congestion
|
||||
* control (Floyd)
|
||||
*/
|
||||
case SCTP_CC_HSTCP:
|
||||
{
|
||||
stcb->asoc.congestion_control_module = SCTP_CC_HSTCP;
|
||||
stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_hs_cwnd_update_after_sack;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_hs_cwnd_update_after_fr;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer;
|
||||
SCTP_TCB_UNLOCK(stcb);
|
||||
break;
|
||||
}
|
||||
/* JRS - HTCP congestion control */
|
||||
case SCTP_CC_HTCP:
|
||||
{
|
||||
stcb->asoc.congestion_control_module = SCTP_CC_HTCP;
|
||||
stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_htcp_set_initial_cc_param;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_htcp_cwnd_update_after_sack;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_htcp_cwnd_update_after_fr;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_htcp_cwnd_update_after_timeout;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_htcp_cwnd_update_after_ecn_echo;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_htcp_cwnd_update_after_fr_timer;
|
||||
SCTP_TCB_UNLOCK(stcb);
|
||||
break;
|
||||
}
|
||||
/*
|
||||
* JRS - All other values are
|
||||
* invalid
|
||||
*/
|
||||
stcb->asoc.cc_functions = sctp_cc_functions[av->assoc_value];
|
||||
stcb->asoc.congestion_control_module = av->assoc_value;
|
||||
break;
|
||||
default:
|
||||
{
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
||||
error = EINVAL;
|
||||
SCTP_TCB_UNLOCK(stcb);
|
||||
break;
|
||||
}
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
||||
error = EINVAL;
|
||||
break;
|
||||
}
|
||||
SCTP_TCB_UNLOCK(stcb);
|
||||
} else {
|
||||
switch (av->assoc_value) {
|
||||
case SCTP_CC_RFC2581:
|
||||
case SCTP_CC_HSTCP:
|
||||
case SCTP_CC_HTCP:
|
||||
SCTP_INP_WLOCK(inp);
|
||||
inp->sctp_ep.sctp_default_cc_module = av->assoc_value;
|
||||
SCTP_INP_WUNLOCK(inp);
|
||||
break;
|
||||
default:
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
||||
|
@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <netinet/sctp_indata.h>/* for sctp_deliver_data() */
|
||||
#include <netinet/sctp_auth.h>
|
||||
#include <netinet/sctp_asconf.h>
|
||||
#include <netinet/sctp_cc_functions.h>
|
||||
#include <netinet/sctp_bsd_addr.h>
|
||||
|
||||
|
||||
@ -55,6 +54,8 @@ __FBSDID("$FreeBSD$");
|
||||
#define KTR_SCTP KTR_SUBSYS
|
||||
#endif
|
||||
|
||||
extern struct sctp_cc_functions sctp_cc_functions[];
|
||||
|
||||
void
|
||||
sctp_sblog(struct sockbuf *sb,
|
||||
struct sctp_tcb *stcb, int from, int incr)
|
||||
@ -1044,67 +1045,17 @@ sctp_init_asoc(struct sctp_inpcb *m, struct sctp_tcb *stcb,
|
||||
|
||||
asoc->sctp_autoclose_ticks = m->sctp_ep.auto_close_time;
|
||||
|
||||
/*
|
||||
* JRS - Pick the default congestion control module based on the
|
||||
* sysctl.
|
||||
*/
|
||||
switch (m->sctp_ep.sctp_default_cc_module) {
|
||||
/* JRS - Standard TCP congestion control */
|
||||
case SCTP_CC_RFC2581:
|
||||
{
|
||||
stcb->asoc.congestion_control_module = SCTP_CC_RFC2581;
|
||||
stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_cwnd_update_after_sack;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_cwnd_update_after_fr;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer;
|
||||
break;
|
||||
}
|
||||
/* JRS - High Speed TCP congestion control (Floyd) */
|
||||
case SCTP_CC_HSTCP:
|
||||
{
|
||||
stcb->asoc.congestion_control_module = SCTP_CC_HSTCP;
|
||||
stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_hs_cwnd_update_after_sack;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_hs_cwnd_update_after_fr;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer;
|
||||
break;
|
||||
}
|
||||
/* JRS - HTCP congestion control */
|
||||
case SCTP_CC_HTCP:
|
||||
{
|
||||
stcb->asoc.congestion_control_module = SCTP_CC_HTCP;
|
||||
stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_htcp_set_initial_cc_param;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_htcp_cwnd_update_after_sack;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_htcp_cwnd_update_after_fr;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_htcp_cwnd_update_after_timeout;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_htcp_cwnd_update_after_ecn_echo;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_htcp_cwnd_update_after_fr_timer;
|
||||
break;
|
||||
}
|
||||
/* JRS - By default, use RFC2581 */
|
||||
stcb->asoc.congestion_control_module = m->sctp_ep.sctp_default_cc_module;
|
||||
stcb->asoc.cc_functions = sctp_cc_functions[m->sctp_ep.sctp_default_cc_module];
|
||||
break;
|
||||
default:
|
||||
{
|
||||
stcb->asoc.congestion_control_module = SCTP_CC_RFC2581;
|
||||
stcb->asoc.cc_functions.sctp_set_initial_cc_param = &sctp_set_initial_cc_param;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_sack = &sctp_cwnd_update_after_sack;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_fr = &sctp_cwnd_update_after_fr;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_timeout = &sctp_cwnd_update_after_timeout;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo = &sctp_cwnd_update_after_ecn_echo;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_packet_dropped = &sctp_cwnd_update_after_packet_dropped;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_output = &sctp_cwnd_update_after_output;
|
||||
stcb->asoc.cc_functions.sctp_cwnd_update_after_fr_timer = &sctp_cwnd_update_after_fr_timer;
|
||||
break;
|
||||
}
|
||||
stcb->asoc.congestion_control_module = SCTP_CC_RFC2581;
|
||||
stcb->asoc.cc_functions = sctp_cc_functions[SCTP_CC_RFC2581];
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user