Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/cc/cc_dctcp.c
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | |||||
#define DCTCP_SHIFT 10 | #define DCTCP_SHIFT 10 | ||||
#define MAX_ALPHA_VALUE (1<<DCTCP_SHIFT) | #define MAX_ALPHA_VALUE (1<<DCTCP_SHIFT) | ||||
VNET_DEFINE_STATIC(uint32_t, dctcp_alpha) = MAX_ALPHA_VALUE; | VNET_DEFINE_STATIC(uint32_t, dctcp_alpha) = MAX_ALPHA_VALUE; | ||||
#define V_dctcp_alpha VNET(dctcp_alpha) | #define V_dctcp_alpha VNET(dctcp_alpha) | ||||
VNET_DEFINE_STATIC(uint32_t, dctcp_shift_g) = 4; | VNET_DEFINE_STATIC(uint32_t, dctcp_shift_g) = 4; | ||||
#define V_dctcp_shift_g VNET(dctcp_shift_g) | #define V_dctcp_shift_g VNET(dctcp_shift_g) | ||||
VNET_DEFINE_STATIC(uint32_t, dctcp_slowstart) = 0; | VNET_DEFINE_STATIC(uint32_t, dctcp_slowstart) = 0; | ||||
#define V_dctcp_slowstart VNET(dctcp_slowstart) | #define V_dctcp_slowstart VNET(dctcp_slowstart) | ||||
VNET_DEFINE_STATIC(uint32_t, dctcp_ect1) = 0; | |||||
rgrimes: By setting this to 1 here doesnt this change the default to be ect(1) marking | |||||
#define V_dctcp_ect1 VNET(dctcp_ect1) | |||||
struct dctcp { | struct dctcp { | ||||
uint32_t bytes_ecn; /* # of marked bytes during a RTT */ | uint32_t bytes_ecn; /* # of marked bytes during a RTT */ | ||||
uint32_t bytes_total; /* # of acked bytes during a RTT */ | uint32_t bytes_total; /* # of acked bytes during a RTT */ | ||||
int alpha; /* the fraction of marked bytes */ | int alpha; /* the fraction of marked bytes */ | ||||
int ce_prev; /* CE state of the last segment */ | int ce_prev; /* CE state of the last segment */ | ||||
tcp_seq save_sndnxt; /* end sequence number of the current window */ | tcp_seq save_sndnxt; /* end sequence number of the current window */ | ||||
int ece_curr; /* ECE flag in this segment */ | int ece_curr; /* ECE flag in this segment */ | ||||
▲ Show 20 Lines • Show All 229 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
dctcp_conn_init(struct cc_var *ccv) | dctcp_conn_init(struct cc_var *ccv) | ||||
{ | { | ||||
struct dctcp *dctcp_data; | struct dctcp *dctcp_data; | ||||
dctcp_data = ccv->cc_data; | dctcp_data = ccv->cc_data; | ||||
if (CCV(ccv, t_flags2) & TF2_ECN_PERMIT) | if (CCV(ccv, t_flags2) & TF2_ECN_PERMIT) { | ||||
dctcp_data->save_sndnxt = CCV(ccv, snd_nxt); | dctcp_data->save_sndnxt = CCV(ccv, snd_nxt); | ||||
if (V_dctcp_ect1) | |||||
CCV(ccv, t_flags2) |= TF2_ECN_USE_ECT1; | |||||
} | } | ||||
} | |||||
/* | /* | ||||
* Perform any necessary tasks before we exit congestion recovery. | * Perform any necessary tasks before we exit congestion recovery. | ||||
*/ | */ | ||||
static void | static void | ||||
dctcp_post_recovery(struct cc_var *ccv) | dctcp_post_recovery(struct cc_var *ccv) | ||||
{ | { | ||||
newreno_cc_post_recovery(ccv); | newreno_cc_post_recovery(ccv); | ||||
▲ Show 20 Lines • Show All 145 Lines • ▼ Show 20 Lines | SYSCTL_PROC(_net_inet_tcp_cc_dctcp, OID_AUTO, shift_g, | ||||
CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | ||||
&VNET_NAME(dctcp_shift_g), 4, &dctcp_shift_g_handler, "IU", | &VNET_NAME(dctcp_shift_g), 4, &dctcp_shift_g_handler, "IU", | ||||
"dctcp shift parameter"); | "dctcp shift parameter"); | ||||
SYSCTL_PROC(_net_inet_tcp_cc_dctcp, OID_AUTO, slowstart, | SYSCTL_PROC(_net_inet_tcp_cc_dctcp, OID_AUTO, slowstart, | ||||
CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | ||||
&VNET_NAME(dctcp_slowstart), 0, &dctcp_slowstart_handler, "IU", | &VNET_NAME(dctcp_slowstart), 0, &dctcp_slowstart_handler, "IU", | ||||
"half CWND reduction after the first slow start"); | "half CWND reduction after the first slow start"); | ||||
SYSCTL_UINT(_net_inet_tcp_cc_dctcp, OID_AUTO, ect1, | |||||
CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | |||||
&VNET_NAME(dctcp_ect1), 0, | |||||
"Send DCTCP segments with ÍP ECT(0) or ECT(1)"); | |||||
Not Done Inline ActionsIsnt "Send DCTCP segments with IP ECT(1) *instead of* ECT(0)" the correct statement here? rgrimes: Isnt "Send DCTCP segments with IP ECT(1) *instead of* ECT(0)" the correct statement here? | |||||
DECLARE_CC_MODULE(dctcp, &dctcp_cc_algo); | DECLARE_CC_MODULE(dctcp, &dctcp_cc_algo); | ||||
MODULE_VERSION(dctcp, 2); | MODULE_VERSION(dctcp, 2); |
By setting this to 1 here doesnt this change the default to be ect(1) marking