Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111538
b: refs/heads/master
c: 3ca7aea
h: refs/heads/master
v: v3
  • Loading branch information
Gerrit Renker committed Sep 4, 2008
1 parent 2909f1e commit 9b01f98
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d20ed95f8bf3d98d31dbbab8b00bb4c1a4a140f3
refs/heads/master: 3ca7aea04152255bb65275b0018d3c673bc1f4e7
8 changes: 0 additions & 8 deletions trunk/net/dccp/ccids/ccid3.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,15 +767,7 @@ static void ccid3_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb)
*/
if (sample != 0)
hcrx->rtt = tfrc_ewma(hcrx->rtt, sample, 9);

} else if (tfrc_lh_update_i_mean(&hcrx->li_hist, skb)) {
/*
* Step (3) of [RFC 3448, 6.1]: Recompute I_mean and, if I_mean
* has decreased (resp. p has increased), send feedback now.
*/
do_feedback = CCID3_FBACK_PARAM_CHANGE;
}

/*
* Check if the periodic once-per-RTT feedback is due; RFC 4342, 10.3
*/
Expand Down
20 changes: 11 additions & 9 deletions trunk/net/dccp/ccids/lib/loss_interval.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,26 @@ static void tfrc_lh_calc_i_mean(struct tfrc_loss_hist *lh)

/**
* tfrc_lh_update_i_mean - Update the `open' loss interval I_0
* For recomputing p: returns `true' if p > p_prev <=> 1/p < 1/p_prev
* This updates I_mean as the sequence numbers increase. As a consequence, the
* open loss interval I_0 increases, hence p = W_tot/max(I_tot0, I_tot1)
* decreases, and thus there is no need to send renewed feedback.
*/
u8 tfrc_lh_update_i_mean(struct tfrc_loss_hist *lh, struct sk_buff *skb)
void tfrc_lh_update_i_mean(struct tfrc_loss_hist *lh, struct sk_buff *skb)
{
struct tfrc_loss_interval *cur = tfrc_lh_peek(lh);
u32 old_i_mean = lh->i_mean;
s64 len;

if (cur == NULL) /* not initialised */
return 0;
return;

/* FIXME: should probably also count non-data packets (RFC 4342, 6.1) */
if (!dccp_data_packet(skb))
return;

len = dccp_delta_seqno(cur->li_seqno, DCCP_SKB_CB(skb)->dccpd_seq) + 1;

if (len - (s64)cur->li_length <= 0) /* duplicate or reordered */
return 0;
return;

if (SUB16(dccp_hdr(skb)->dccph_ccval, cur->li_ccval) > 4)
/*
Expand All @@ -114,14 +119,11 @@ u8 tfrc_lh_update_i_mean(struct tfrc_loss_hist *lh, struct sk_buff *skb)
cur->li_is_closed = 1;

if (tfrc_lh_length(lh) == 1) /* due to RFC 3448, 6.3.1 */
return 0;
return;

cur->li_length = len;
tfrc_lh_calc_i_mean(lh);

return (lh->i_mean < old_i_mean);
}
EXPORT_SYMBOL_GPL(tfrc_lh_update_i_mean);

/* Determine if `new_loss' does begin a new loss interval [RFC 4342, 10.2] */
static inline u8 tfrc_lh_is_new_loss(struct tfrc_loss_interval *cur,
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/dccp/ccids/lib/loss_interval.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct tfrc_rx_hist;

extern int tfrc_lh_interval_add(struct tfrc_loss_hist *, struct tfrc_rx_hist *,
u32 (*first_li)(struct sock *), struct sock *);
extern u8 tfrc_lh_update_i_mean(struct tfrc_loss_hist *lh, struct sk_buff *);
extern void tfrc_lh_update_i_mean(struct tfrc_loss_hist *lh, struct sk_buff *);
extern void tfrc_lh_cleanup(struct tfrc_loss_hist *lh);

#endif /* _DCCP_LI_HIST_ */
5 changes: 5 additions & 0 deletions trunk/net/dccp/ccids/lib/packet_history.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,11 @@ int tfrc_rx_handle_loss(struct tfrc_rx_hist *h,
is_new_loss = tfrc_lh_interval_add(lh, h, calc_first_li, sk);
__three_after_loss(h);
}

/* RFC 3448, 6.1: update I_0, whose growth implies p <= p_prev */
if (!is_new_loss)
tfrc_lh_update_i_mean(lh, skb);

return is_new_loss;
}
EXPORT_SYMBOL_GPL(tfrc_rx_handle_loss);
Expand Down

0 comments on commit 9b01f98

Please sign in to comment.