36 #include <linux/string.h>
37 #include <linux/slab.h>
39 #include "../../dccp.h"
56 if (tfrc_tx_hist_slab !=
NULL) {
58 tfrc_tx_hist_slab =
NULL;
79 while (head !=
NULL) {
104 if (tfrc_rx_hist_slab !=
NULL) {
106 tfrc_rx_hist_slab =
NULL;
129 tfrc_rx_hist_entry_from_skb(entry, skb, ndp);
138 if (dccp_delta_seqno(tfrc_rx_hist_loss_prev(h)->
tfrchrx_seqno, seq) <= 0)
150 const u8 idx_a = tfrc_rx_hist_index(h, a),
151 idx_b = tfrc_rx_hist_index(h, b);
169 u64 s0 = tfrc_rx_hist_loss_prev(h)->tfrchrx_seqno,
172 if (!dccp_loss_free(s0,
s1, n1)) {
180 u64 s0 = tfrc_rx_hist_loss_prev(h)->tfrchrx_seqno,
192 if (dccp_loss_free(s0,
s2, n2)) {
195 if (dccp_loss_free(
s2,
s1, n1)) {
201 tfrc_rx_hist_entry_from_skb(tfrc_rx_hist_loss_prev(h), skb, n2);
207 tfrc_rx_hist_swap(h, 0, 3);
217 u64 s0 = tfrc_rx_hist_loss_prev(h)->tfrchrx_seqno,
230 if (dccp_delta_seqno(
s1,
s3) > 0) {
234 tfrc_rx_hist_swap(h, 2, 3);
242 if (dccp_loss_free(s0,
s3, n3)) {
245 if (dccp_loss_free(
s3,
s1, n1)) {
249 if (dccp_loss_free(
s1,
s2, n2)) {
260 tfrc_rx_hist_entry_from_skb(tfrc_rx_hist_loss_prev(h), skb, n3);
269 tfrc_rx_hist_swap(h, 0, 3);
292 if (dccp_loss_free(s1,
s2, n2)) {
294 if (dccp_loss_free(
s2,
s3, n3)) {
334 __do_track_loss(h, skb, ndp);
336 __one_after_loss(h, skb, ndp);
339 }
else if (__two_after_loss(h, skb, ndp)) {
344 __three_after_loss(h);
396 return h->
ring[h->rtt_sample_prev];
410 if (delta_v < 1 || delta_v > 4) {
411 if (h->rtt_sample_prev == 2) {
415 sample = 4 / sample *
425 " => prev = %u, last = %u",
428 }
else if (delta_v < 1) {
429 h->rtt_sample_prev = 1;
430 goto keep_ref_for_next_time;
433 }
else if (delta_v == 4)
434 sample = ktime_to_us(net_timedelta(tfrc_rx_hist_rtt_last_s(h)->
tfrchrx_tstamp));
436 h->rtt_sample_prev = 2;
437 goto keep_ref_for_next_time;
441 DCCP_WARN(
"RTT sample %u too large, using max\n", sample);
445 h->rtt_sample_prev = 0;
446 keep_ref_for_next_time: