|
@@ -119,6 +119,13 @@ static inline void ccid3_update_send_interval(struct ccid3_hc_tx_sock *hctx)
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static u32 ccid3_hc_tx_idle_rtt(struct ccid3_hc_tx_sock *hctx, ktime_t now)
|
|
|
|
+{
|
|
|
|
+ u32 delta = ktime_us_delta(now, hctx->ccid3hctx_t_last_win_count);
|
|
|
|
+
|
|
|
|
+ return delta / hctx->ccid3hctx_rtt;
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* ccid3_hc_tx_update_x - Update allowed sending rate X
|
|
* ccid3_hc_tx_update_x - Update allowed sending rate X
|
|
* @stamp: most recent time if available - can be left NULL.
|
|
* @stamp: most recent time if available - can be left NULL.
|
|
@@ -139,10 +146,11 @@ static void ccid3_hc_tx_update_x(struct sock *sk, ktime_t *stamp)
|
|
|
|
|
|
/*
|
|
/*
|
|
* Handle IDLE periods: do not reduce below RFC3390 initial sending rate
|
|
* Handle IDLE periods: do not reduce below RFC3390 initial sending rate
|
|
- * when idling [RFC 4342, 5.1]. See also draft-ietf-dccp-rfc3448bis.
|
|
|
|
|
|
+ * when idling [RFC 4342, 5.1]. Definition of idling is from rfc3448bis:
|
|
|
|
+ * a sender is idle if it has not sent anything over a 2-RTT-period.
|
|
* For consistency with X and X_recv, min_rate is also scaled by 2^6.
|
|
* For consistency with X and X_recv, min_rate is also scaled by 2^6.
|
|
*/
|
|
*/
|
|
- if (unlikely(hctx->ccid3hctx_idle)) {
|
|
|
|
|
|
+ if (ccid3_hc_tx_idle_rtt(hctx, now) >= 2) {
|
|
min_rate = rfc3390_initial_rate(sk);
|
|
min_rate = rfc3390_initial_rate(sk);
|
|
min_rate = max(min_rate, 2 * hctx->ccid3hctx_x_recv);
|
|
min_rate = max(min_rate, 2 * hctx->ccid3hctx_x_recv);
|
|
}
|
|
}
|
|
@@ -228,8 +236,6 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data)
|
|
ccid3_pr_debug("%s(%p, state=%s) - entry \n", dccp_role(sk), sk,
|
|
ccid3_pr_debug("%s(%p, state=%s) - entry \n", dccp_role(sk), sk,
|
|
ccid3_tx_state_name(hctx->ccid3hctx_state));
|
|
ccid3_tx_state_name(hctx->ccid3hctx_state));
|
|
|
|
|
|
- hctx->ccid3hctx_idle = 1;
|
|
|
|
-
|
|
|
|
switch (hctx->ccid3hctx_state) {
|
|
switch (hctx->ccid3hctx_state) {
|
|
case TFRC_SSTATE_NO_FBACK:
|
|
case TFRC_SSTATE_NO_FBACK:
|
|
/* RFC 3448, 4.4: Halve send rate directly */
|
|
/* RFC 3448, 4.4: Halve send rate directly */
|
|
@@ -372,7 +378,6 @@ static int ccid3_hc_tx_send_packet(struct sock *sk, struct sk_buff *skb)
|
|
/* prepare to send now (add options etc.) */
|
|
/* prepare to send now (add options etc.) */
|
|
dp->dccps_hc_tx_insert_options = 1;
|
|
dp->dccps_hc_tx_insert_options = 1;
|
|
DCCP_SKB_CB(skb)->dccpd_ccval = hctx->ccid3hctx_last_win_count;
|
|
DCCP_SKB_CB(skb)->dccpd_ccval = hctx->ccid3hctx_last_win_count;
|
|
- hctx->ccid3hctx_idle = 0;
|
|
|
|
|
|
|
|
/* set the nominal send time for the next following packet */
|
|
/* set the nominal send time for the next following packet */
|
|
hctx->ccid3hctx_t_nom = ktime_add_us(hctx->ccid3hctx_t_nom,
|
|
hctx->ccid3hctx_t_nom = ktime_add_us(hctx->ccid3hctx_t_nom,
|
|
@@ -531,9 +536,6 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
|
|
|
|
|
|
sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer,
|
|
sk_reset_timer(sk, &hctx->ccid3hctx_no_feedback_timer,
|
|
jiffies + usecs_to_jiffies(t_nfb));
|
|
jiffies + usecs_to_jiffies(t_nfb));
|
|
-
|
|
|
|
- /* set idle flag */
|
|
|
|
- hctx->ccid3hctx_idle = 1;
|
|
|
|
break;
|
|
break;
|
|
case TFRC_SSTATE_NO_SENT: /* fall through */
|
|
case TFRC_SSTATE_NO_SENT: /* fall through */
|
|
case TFRC_SSTATE_TERM: /* ignore feedback when closing */
|
|
case TFRC_SSTATE_TERM: /* ignore feedback when closing */
|