Lines 58-63
Link Here
|
58 |
#include <sys/malloc.h> |
58 |
#include <sys/malloc.h> |
59 |
#include <sys/module.h> |
59 |
#include <sys/module.h> |
60 |
#include <sys/queue.h> |
60 |
#include <sys/queue.h> |
|
|
61 |
#include <sys/prng.h> |
61 |
#include <sys/socket.h> |
62 |
#include <sys/socket.h> |
62 |
#include <sys/socketvar.h> |
63 |
#include <sys/socketvar.h> |
63 |
#include <sys/sysctl.h> |
64 |
#include <sys/sysctl.h> |
Lines 309-315
cdg_cb_init(struct cc_var *ccv, void *ptr)
Link Here
|
309 |
cdg_data->queue_state = CDG_Q_UNKNOWN; |
310 |
cdg_data->queue_state = CDG_Q_UNKNOWN; |
310 |
cdg_data->maxrtt_in_rtt = 0; |
311 |
cdg_data->maxrtt_in_rtt = 0; |
311 |
cdg_data->maxrtt_in_prevrtt = 0; |
312 |
cdg_data->maxrtt_in_prevrtt = 0; |
312 |
cdg_data->minrtt_in_rtt = INT_MAX; |
313 |
cdg_data->minrtt_in_rtt = UINT_MAX; |
313 |
cdg_data->minrtt_in_prevrtt = 0; |
314 |
cdg_data->minrtt_in_prevrtt = 0; |
314 |
cdg_data->window_incr = 0; |
315 |
cdg_data->window_incr = 0; |
315 |
cdg_data->rtt_count = 0; |
316 |
cdg_data->rtt_count = 0; |
Lines 520-527
prob_backoff(long qtrend)
Link Here
|
520 |
idx = qtrend; |
521 |
idx = qtrend; |
521 |
|
522 |
|
522 |
/* Backoff probability proportional to rate of queue growth. */ |
523 |
/* Backoff probability proportional to rate of queue growth. */ |
523 |
p = (INT_MAX / (1 << EXP_PREC)) * probexp[idx]; |
524 |
p = (UINT_MAX / (1 << EXP_PREC)) * probexp[idx]; |
524 |
backoff = (random() < p); |
525 |
backoff = (prng32() < p); |
525 |
} |
526 |
} |
526 |
|
527 |
|
527 |
return (backoff); |
528 |
return (backoff); |
Lines 638-644
cdg_ack_received(struct cc_var *ccv, uint16_t ack_type)
Link Here
|
638 |
} |
639 |
} |
639 |
|
640 |
|
640 |
cdg_data->minrtt_in_prevrtt = cdg_data->minrtt_in_rtt; |
641 |
cdg_data->minrtt_in_prevrtt = cdg_data->minrtt_in_rtt; |
641 |
cdg_data->minrtt_in_rtt = INT_MAX; |
642 |
cdg_data->minrtt_in_rtt = UINT_MAX; |
642 |
cdg_data->maxrtt_in_prevrtt = cdg_data->maxrtt_in_rtt; |
643 |
cdg_data->maxrtt_in_prevrtt = cdg_data->maxrtt_in_rtt; |
643 |
cdg_data->maxrtt_in_rtt = 0; |
644 |
cdg_data->maxrtt_in_rtt = 0; |
644 |
e_t->flags &= ~ERTT_NEW_MEASUREMENT; |
645 |
e_t->flags &= ~ERTT_NEW_MEASUREMENT; |