aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids/lib
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/ccids/lib')
-rw-r--r--net/dccp/ccids/lib/packet_history.h4
-rw-r--r--net/dccp/ccids/lib/tfrc_equation.c18
2 files changed, 11 insertions, 11 deletions
diff --git a/net/dccp/ccids/lib/packet_history.h b/net/dccp/ccids/lib/packet_history.h
index 1f960c19ea1b..60d00f015390 100644
--- a/net/dccp/ccids/lib/packet_history.h
+++ b/net/dccp/ccids/lib/packet_history.h
@@ -137,7 +137,7 @@ extern void dccp_rx_hist_delete(struct dccp_rx_hist *hist);
137static inline struct dccp_rx_hist_entry * 137static inline struct dccp_rx_hist_entry *
138 dccp_rx_hist_entry_new(struct dccp_rx_hist *hist, 138 dccp_rx_hist_entry_new(struct dccp_rx_hist *hist,
139 const struct sock *sk, 139 const struct sock *sk,
140 const u32 ndp, 140 const u32 ndp,
141 const struct sk_buff *skb, 141 const struct sk_buff *skb,
142 const gfp_t prio) 142 const gfp_t prio)
143{ 143{
@@ -169,7 +169,7 @@ static inline struct dccp_rx_hist_entry *
169} 169}
170 170
171extern int dccp_rx_hist_find_entry(const struct list_head *list, const u64 seq, 171extern int dccp_rx_hist_find_entry(const struct list_head *list, const u64 seq,
172 u8 *ccval); 172 u8 *ccval);
173extern struct dccp_rx_hist_entry * 173extern struct dccp_rx_hist_entry *
174 dccp_rx_hist_find_data_packet(const struct list_head *list); 174 dccp_rx_hist_find_data_packet(const struct list_head *list);
175 175
diff --git a/net/dccp/ccids/lib/tfrc_equation.c b/net/dccp/ccids/lib/tfrc_equation.c
index 90009fd77e15..e4e64b76c10c 100644
--- a/net/dccp/ccids/lib/tfrc_equation.c
+++ b/net/dccp/ccids/lib/tfrc_equation.c
@@ -26,7 +26,7 @@
26 The following two-column lookup table implements a part of the TCP throughput 26 The following two-column lookup table implements a part of the TCP throughput
27 equation from [RFC 3448, sec. 3.1]: 27 equation from [RFC 3448, sec. 3.1]:
28 28
29 s 29 s
30 X_calc = -------------------------------------------------------------- 30 X_calc = --------------------------------------------------------------
31 R * sqrt(2*b*p/3) + (3 * t_RTO * sqrt(3*b*p/8) * (p + 32*p^3)) 31 R * sqrt(2*b*p/3) + (3 * t_RTO * sqrt(3*b*p/8) * (p + 32*p^3))
32 32
@@ -35,7 +35,7 @@
35 s is the packet size in bytes 35 s is the packet size in bytes
36 R is the round trip time in seconds 36 R is the round trip time in seconds
37 p is the loss event rate, between 0 and 1.0, of the number of loss 37 p is the loss event rate, between 0 and 1.0, of the number of loss
38 events as a fraction of the number of packets transmitted 38 events as a fraction of the number of packets transmitted
39 t_RTO is the TCP retransmission timeout value in seconds 39 t_RTO is the TCP retransmission timeout value in seconds
40 b is the number of packets acknowledged by a single TCP ACK 40 b is the number of packets acknowledged by a single TCP ACK
41 41
@@ -47,9 +47,9 @@
47 47
48 which we can break down into: 48 which we can break down into:
49 49
50 s 50 s
51 X_calc = --------- 51 X_calc = ---------
52 R * f(p) 52 R * f(p)
53 53
54 where f(p) is given for 0 < p <= 1 by: 54 where f(p) is given for 0 < p <= 1 by:
55 55
@@ -62,7 +62,7 @@
62 * the return result f(p) 62 * the return result f(p)
63 The lookup table therefore actually tabulates the following function g(q): 63 The lookup table therefore actually tabulates the following function g(q):
64 64
65 g(q) = 1000000 * f(q/1000000) 65 g(q) = 1000000 * f(q/1000000)
66 66
67 Hence, when p <= 1, q must be less than or equal to 1000000. To achieve finer 67 Hence, when p <= 1, q must be less than or equal to 1000000. To achieve finer
68 granularity for the practically more relevant case of small values of p (up to 68 granularity for the practically more relevant case of small values of p (up to
@@ -628,7 +628,7 @@ u32 tfrc_calc_x(u16 s, u32 R, u32 p)
628 if (R == 0) { /* possible divide by zero */ 628 if (R == 0) { /* possible divide by zero */
629 DCCP_CRIT("WARNING: RTT is 0, returning maximum X_calc."); 629 DCCP_CRIT("WARNING: RTT is 0, returning maximum X_calc.");
630 return ~0U; 630 return ~0U;
631 } 631 }
632 632
633 if (p <= TFRC_CALC_X_SPLIT) { /* 0.0000 < p <= 0.05 */ 633 if (p <= TFRC_CALC_X_SPLIT) { /* 0.0000 < p <= 0.05 */
634 if (p < TFRC_SMALLEST_P) { /* 0.0000 < p < 0.0001 */ 634 if (p < TFRC_SMALLEST_P) { /* 0.0000 < p < 0.0001 */
@@ -638,7 +638,7 @@ u32 tfrc_calc_x(u16 s, u32 R, u32 p)
638 } else /* 0.0001 <= p <= 0.05 */ 638 } else /* 0.0001 <= p <= 0.05 */
639 index = p/TFRC_SMALLEST_P - 1; 639 index = p/TFRC_SMALLEST_P - 1;
640 640
641 f = tfrc_calc_x_lookup[index][1]; 641 f = tfrc_calc_x_lookup[index][1];
642 642
643 } else { /* 0.05 < p <= 1.00 */ 643 } else { /* 0.05 < p <= 1.00 */
644 index = p/(1000000/TFRC_CALC_X_ARRSIZE) - 1; 644 index = p/(1000000/TFRC_CALC_X_ARRSIZE) - 1;
@@ -687,8 +687,8 @@ u32 tfrc_calc_x_reverse_lookup(u32 fvalue)
687 if (fvalue <= tfrc_calc_x_lookup[TFRC_CALC_X_ARRSIZE - 1][1]) { 687 if (fvalue <= tfrc_calc_x_lookup[TFRC_CALC_X_ARRSIZE - 1][1]) {
688 index = tfrc_binsearch(fvalue, 1); 688 index = tfrc_binsearch(fvalue, 1);
689 return (index + 1) * TFRC_CALC_X_SPLIT / TFRC_CALC_X_ARRSIZE; 689 return (index + 1) * TFRC_CALC_X_SPLIT / TFRC_CALC_X_ARRSIZE;
690 } 690 }
691 691
692 /* else ... it must be in the coarse-grained column */ 692 /* else ... it must be in the coarse-grained column */
693 index = tfrc_binsearch(fvalue, 0); 693 index = tfrc_binsearch(fvalue, 0);
694 return (index + 1) * 1000000 / TFRC_CALC_X_ARRSIZE; 694 return (index + 1) * 1000000 / TFRC_CALC_X_ARRSIZE;