Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171446061
D59357.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
8 KB
Referenced Files
None
Subscribers
None
D59357.diff
View Options
diff --git a/sys/netinet/cc/cc.h b/sys/netinet/cc/cc.h
--- a/sys/netinet/cc/cc.h
+++ b/sys/netinet/cc/cc.h
@@ -173,7 +173,10 @@
/* Called on detection of a congestion signal. */
void (*cong_signal)(struct cc_var *ccv, ccsignal_t type);
- /* Called after exiting congestion recovery. */
+ /* Called before exiting congestion recovery. */
+ void (*pre_post_recovery)(struct cc_var *ccv);
+
+ /* Called at exiting congestion recovery. */
void (*post_recovery)(struct cc_var *ccv);
/* Called when data transfer resumes after an idle period. */
@@ -227,6 +230,7 @@
* module that wishes to use NewReno type behaviour (along
* with anything else they may add on, pre or post call).
*/
+void newreno_cc_pre_post_recovery(struct cc_var *ccv);
void newreno_cc_post_recovery(struct cc_var *);
void newreno_cc_after_idle(struct cc_var *);
void newreno_cc_cong_signal(struct cc_var *, ccsignal_t);
diff --git a/sys/netinet/cc/cc.c b/sys/netinet/cc/cc.c
--- a/sys/netinet/cc/cc.c
+++ b/sys/netinet/cc/cc.c
@@ -389,7 +389,7 @@
* Perform any necessary tasks before we exit congestion recovery.
*/
void
-newreno_cc_post_recovery(struct cc_var *ccv)
+newreno_cc_pre_post_recovery(struct cc_var *ccv)
{
int pipe;
uint32_t mss = tcp_fixed_maxseg(ccv->tp);
@@ -414,6 +414,16 @@
}
}
+/*
+ * start exiting congestion recovery.
+ */
+void
+newreno_cc_post_recovery(struct cc_var *ccv)
+{
+ EXIT_RECOVERY(CCV(ccv, t_flags));
+ CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh);
+}
+
void
newreno_cc_after_idle(struct cc_var *ccv)
{
diff --git a/sys/netinet/cc/cc_cdg.c b/sys/netinet/cc/cc_cdg.c
--- a/sys/netinet/cc/cc_cdg.c
+++ b/sys/netinet/cc/cc_cdg.c
@@ -236,6 +236,7 @@
.cong_signal = cdg_cong_signal,
.mod_destroy = cdg_mod_destroy,
.cc_data_sz = cdg_data_sz,
+ .pre_post_recovery = newreno_cc_pre_post_recovery,
.post_recovery = newreno_cc_post_recovery,
.after_idle = newreno_cc_after_idle,
};
diff --git a/sys/netinet/cc/cc_chd.c b/sys/netinet/cc/cc_chd.c
--- a/sys/netinet/cc/cc_chd.c
+++ b/sys/netinet/cc/cc_chd.c
@@ -140,6 +140,7 @@
.mod_init = chd_mod_init,
.cc_data_sz = chd_data_sz,
.after_idle = newreno_cc_after_idle,
+ .pre_post_recovery = newreno_cc_pre_post_recovery,
.post_recovery = newreno_cc_post_recovery,
};
diff --git a/sys/netinet/cc/cc_cubic.c b/sys/netinet/cc/cc_cubic.c
--- a/sys/netinet/cc/cc_cubic.c
+++ b/sys/netinet/cc/cc_cubic.c
@@ -79,7 +79,7 @@
static void cubic_cong_signal(struct cc_var *ccv, ccsignal_t type);
static void cubic_conn_init(struct cc_var *ccv);
static int cubic_mod_init(void);
-static void cubic_post_recovery(struct cc_var *ccv);
+static void cubic_pre_post_recovery(struct cc_var *ccv);
static void cubic_record_rtt(struct cc_var *ccv);
static uint32_t cubic_get_ssthresh(struct cc_var *ccv, uint32_t maxseg);
static void cubic_after_idle(struct cc_var *ccv);
@@ -96,7 +96,8 @@
.cong_signal = cubic_cong_signal,
.conn_init = cubic_conn_init,
.mod_init = cubic_mod_init,
- .post_recovery = cubic_post_recovery,
+ .pre_post_recovery = cubic_pre_post_recovery,
+ .post_recovery = newreno_cc_post_recovery,
.after_idle = cubic_after_idle,
.cc_data_sz = cubic_data_sz,
.rttsample = cubic_rttsample,
@@ -528,7 +529,7 @@
* Perform any necessary tasks before we exit congestion recovery.
*/
static void
-cubic_post_recovery(struct cc_var *ccv)
+cubic_pre_post_recovery(struct cc_var *ccv)
{
struct cubic *cubic_data;
int pipe;
@@ -600,7 +601,7 @@
* If the connection is within its first congestion
* epoch, ensure we prime mean_rtt_usecs with a
* reasonable value until the epoch average RTT is
- * calculated in cubic_post_recovery().
+ * calculated in cubic_pre_post_recovery().
*/
if (cubic_data->min_rtt_usecs >
cubic_data->mean_rtt_usecs)
diff --git a/sys/netinet/cc/cc_dctcp.c b/sys/netinet/cc/cc_dctcp.c
--- a/sys/netinet/cc/cc_dctcp.c
+++ b/sys/netinet/cc/cc_dctcp.c
@@ -85,7 +85,7 @@
static int dctcp_cb_init(struct cc_var *ccv, void *ptr);
static void dctcp_cong_signal(struct cc_var *ccv, ccsignal_t type);
static void dctcp_conn_init(struct cc_var *ccv);
-static void dctcp_post_recovery(struct cc_var *ccv);
+static void dctcp_pre_post_recovery(struct cc_var *ccv);
static void dctcp_ecnpkt_handler(struct cc_var *ccv);
static void dctcp_update_alpha(struct cc_var *ccv);
static size_t dctcp_data_sz(void);
@@ -97,7 +97,8 @@
.cb_init = dctcp_cb_init,
.cong_signal = dctcp_cong_signal,
.conn_init = dctcp_conn_init,
- .post_recovery = dctcp_post_recovery,
+ .pre_post_recovery = dctcp_pre_post_recovery,
+ .post_recovery = newreno_cc_post_recovery,
.ecnpkt_handler = dctcp_ecnpkt_handler,
.after_idle = dctcp_after_idle,
.cc_data_sz = dctcp_data_sz,
@@ -328,9 +329,9 @@
* Perform any necessary tasks before we exit congestion recovery.
*/
static void
-dctcp_post_recovery(struct cc_var *ccv)
+dctcp_pre_post_recovery(struct cc_var *ccv)
{
- newreno_cc_post_recovery(ccv);
+ newreno_cc_pre_post_recovery(ccv);
if (CCV(ccv, t_flags2) & TF2_ECN_PERMIT)
dctcp_update_alpha(ccv);
diff --git a/sys/netinet/cc/cc_hd.c b/sys/netinet/cc/cc_hd.c
--- a/sys/netinet/cc/cc_hd.c
+++ b/sys/netinet/cc/cc_hd.c
@@ -101,6 +101,7 @@
.cc_data_sz = hd_data_sz,
.after_idle = newreno_cc_after_idle,
.cong_signal = newreno_cc_cong_signal,
+ .pre_post_recovery = newreno_cc_pre_post_recovery,
.post_recovery = newreno_cc_post_recovery,
};
diff --git a/sys/netinet/cc/cc_htcp.c b/sys/netinet/cc/cc_htcp.c
--- a/sys/netinet/cc/cc_htcp.c
+++ b/sys/netinet/cc/cc_htcp.c
@@ -141,7 +141,7 @@
static int htcp_cb_init(struct cc_var *ccv, void *ptr);
static void htcp_cong_signal(struct cc_var *ccv, ccsignal_t type);
static int htcp_mod_init(void);
-static void htcp_post_recovery(struct cc_var *ccv);
+static void htcp_pre_post_recovery(struct cc_var *ccv);
static void htcp_recalc_alpha(struct cc_var *ccv);
static void htcp_recalc_beta(struct cc_var *ccv);
static void htcp_record_rtt(struct cc_var *ccv);
@@ -184,7 +184,8 @@
.cb_init = htcp_cb_init,
.cong_signal = htcp_cong_signal,
.mod_init = htcp_mod_init,
- .post_recovery = htcp_post_recovery,
+ .pre_post_recovery = htcp_pre_post_recovery,
+ .post_recovery = newreno_cc_post_recovery,
.cc_data_sz = htcp_data_sz,
.after_idle = newreno_cc_after_idle,
};
@@ -361,7 +362,7 @@
* Perform any necessary tasks before we exit congestion recovery.
*/
static void
-htcp_post_recovery(struct cc_var *ccv)
+htcp_pre_post_recovery(struct cc_var *ccv)
{
int pipe;
struct htcp *htcp_data;
diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c
--- a/sys/netinet/cc/cc_newreno.c
+++ b/sys/netinet/cc/cc_newreno.c
@@ -105,6 +105,7 @@
.ack_received = newreno_ack_received,
.after_idle = newreno_after_idle,
.cong_signal = newreno_cong_signal,
+ .pre_post_recovery = newreno_cc_pre_post_recovery,
.post_recovery = newreno_cc_post_recovery,
.ctl_output = newreno_ctl_output,
.newround = newreno_newround,
diff --git a/sys/netinet/cc/cc_vegas.c b/sys/netinet/cc/cc_vegas.c
--- a/sys/netinet/cc/cc_vegas.c
+++ b/sys/netinet/cc/cc_vegas.c
@@ -115,6 +115,7 @@
.mod_init = vegas_mod_init,
.cc_data_sz = vegas_data_sz,
.after_idle = newreno_cc_after_idle,
+ .pre_post_recovery = newreno_cc_pre_post_recovery,
.post_recovery = newreno_cc_post_recovery,
};
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -482,21 +482,23 @@
{
INP_WLOCK_ASSERT(tptoinpcb(tp));
- if (CC_ALGO(tp)->post_recovery != NULL) {
+ if (CC_ALGO(tp)->pre_post_recovery != NULL) {
if (SEQ_LT(tp->snd_fack, th->th_ack) ||
SEQ_GT(tp->snd_fack, tp->snd_max)) {
tp->snd_fack = th->th_ack;
}
tp->t_ccv.curack = th->th_ack;
- CC_ALGO(tp)->post_recovery(&tp->t_ccv);
+ CC_ALGO(tp)->pre_post_recovery(&tp->t_ccv);
}
- EXIT_RECOVERY(tp->t_flags);
+
+ KASSERT(CC_ALGO(tp)->post_recovery != NULL,
+ ("%s: post_recovery == NULL", __func__));
+ CC_ALGO(tp)->post_recovery(&tp->t_ccv);
tp->t_bytes_acked = 0;
tp->sackhint.delivered_data = 0;
tp->sackhint.prr_delivered = 0;
tp->sackhint.prr_out = 0;
- tp->snd_cwnd = tp->snd_ssthresh;
}
/*
diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -5492,9 +5492,9 @@
INP_WLOCK_ASSERT(tptoinpcb(tp));
rack = (struct tcp_rack *)tp->t_fb_ptr;
/* only alert CC if we alerted when we entered */
- if (CC_ALGO(tp)->post_recovery != NULL) {
+ if (CC_ALGO(tp)->pre_post_recovery != NULL) {
tp->t_ccv.curack = th_ack;
- CC_ALGO(tp)->post_recovery(&tp->t_ccv);
+ CC_ALGO(tp)->pre_post_recovery(&tp->t_ccv);
if (tp->snd_cwnd < tp->snd_ssthresh) {
/*
* Rack has burst control and pacing
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Sep 12, 4:16 AM (2 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38291583
Default Alt Text
D59357.diff (8 KB)
Attached To
Mode
D59357: tcp cc: split the cc relevant part of cc_post_recovery() and move them into cc modules.
Attached
Detach File
Event Timeline
Log In to Comment