17 static const int tfrc_lh_weights[
NINTERVAL] = { 10, 10, 10, 10, 8, 6, 4, 2 };
20 static inline u8 LIH_INDEX(
const u8 ctr)
35 return lh->
ring[LIH_INDEX(lh->
counter - i - 1)]->li_length;
51 if (!tfrc_lh_is_initialised(lh))
64 u32 i_i, i_tot0 = 0, i_tot1 = 0, w_tot = 0;
65 int i,
k = tfrc_lh_length(lh) - 1;
70 for (i = 0; i <=
k; i++) {
71 i_i = tfrc_lh_get_interval(lh, i);
74 i_tot0 += i_i * tfrc_lh_weights[
i];
75 w_tot += tfrc_lh_weights[
i];
78 i_tot1 += i_i * tfrc_lh_weights[i-1];
113 if (tfrc_lh_length(lh) == 1)
117 tfrc_lh_calc_i_mean(lh);
119 return lh->
i_mean < old_i_mean;
144 if (cur !=
NULL && !tfrc_lh_is_new_loss(cur, tfrc_rx_hist_loss_prev(rh)))
147 new = tfrc_lh_demand_next(lh);
149 DCCP_CRIT(
"Cannot allocate/add loss record.");
153 new->li_seqno = tfrc_rx_hist_loss_prev(rh)->tfrchrx_seqno;
154 new->li_ccval = tfrc_rx_hist_loss_prev(rh)->tfrchrx_ccval;
155 new->li_is_closed = 0;
158 lh->
i_mean =
new->li_length = (*calc_first_li)(
sk);
161 new->li_length = dccp_delta_seqno(new->li_seqno,
162 tfrc_rx_hist_last_rcv(rh)->tfrchrx_seqno) + 1;
166 tfrc_lh_calc_i_mean(lh);
181 if (tfrc_lh_slab !=
NULL) {