diff options
Diffstat (limited to 'net/dccp/ccids/lib')
-rw-r--r-- | net/dccp/ccids/lib/loss_interval.c | 14 | ||||
-rw-r--r-- | net/dccp/ccids/lib/packet_history.c | 90 | ||||
-rw-r--r-- | net/dccp/ccids/lib/packet_history.h | 48 |
3 files changed, 76 insertions, 76 deletions
diff --git a/net/dccp/ccids/lib/loss_interval.c b/net/dccp/ccids/lib/loss_interval.c index f2ca4eb74dd..a5f59af8df4 100644 --- a/net/dccp/ccids/lib/loss_interval.c +++ b/net/dccp/ccids/lib/loss_interval.c | |||
@@ -129,7 +129,7 @@ static u32 dccp_li_calc_first_li(struct sock *sk, | |||
129 | u16 s, u32 bytes_recv, | 129 | u16 s, u32 bytes_recv, |
130 | u32 previous_x_recv) | 130 | u32 previous_x_recv) |
131 | { | 131 | { |
132 | struct dccp_rx_hist_entry *entry, *next, *tail = NULL; | 132 | struct tfrc_rx_hist_entry *entry, *next, *tail = NULL; |
133 | u32 x_recv, p; | 133 | u32 x_recv, p; |
134 | suseconds_t rtt, delta; | 134 | suseconds_t rtt, delta; |
135 | ktime_t tstamp = ktime_set(0, 0); | 135 | ktime_t tstamp = ktime_set(0, 0); |
@@ -138,18 +138,18 @@ static u32 dccp_li_calc_first_li(struct sock *sk, | |||
138 | int step = 0; | 138 | int step = 0; |
139 | u64 fval; | 139 | u64 fval; |
140 | 140 | ||
141 | list_for_each_entry_safe(entry, next, hist_list, dccphrx_node) { | 141 | list_for_each_entry_safe(entry, next, hist_list, tfrchrx_node) { |
142 | if (dccp_rx_hist_entry_data_packet(entry)) { | 142 | if (tfrc_rx_hist_entry_data_packet(entry)) { |
143 | tail = entry; | 143 | tail = entry; |
144 | 144 | ||
145 | switch (step) { | 145 | switch (step) { |
146 | case 0: | 146 | case 0: |
147 | tstamp = entry->dccphrx_tstamp; | 147 | tstamp = entry->tfrchrx_tstamp; |
148 | win_count = entry->dccphrx_ccval; | 148 | win_count = entry->tfrchrx_ccval; |
149 | step = 1; | 149 | step = 1; |
150 | break; | 150 | break; |
151 | case 1: | 151 | case 1: |
152 | interval = win_count - entry->dccphrx_ccval; | 152 | interval = win_count - entry->tfrchrx_ccval; |
153 | if (interval < 0) | 153 | if (interval < 0) |
154 | interval += TFRC_WIN_COUNT_LIMIT; | 154 | interval += TFRC_WIN_COUNT_LIMIT; |
155 | if (interval > 4) | 155 | if (interval > 4) |
@@ -176,7 +176,7 @@ found: | |||
176 | return ~0; | 176 | return ~0; |
177 | } | 177 | } |
178 | 178 | ||
179 | delta = ktime_us_delta(tstamp, tail->dccphrx_tstamp); | 179 | delta = ktime_us_delta(tstamp, tail->tfrchrx_tstamp); |
180 | DCCP_BUG_ON(delta < 0); | 180 | DCCP_BUG_ON(delta < 0); |
181 | 181 | ||
182 | rtt = delta * 4 / interval; | 182 | rtt = delta * 4 / interval; |
diff --git a/net/dccp/ccids/lib/packet_history.c b/net/dccp/ccids/lib/packet_history.c index e1ab853c38d..255cca1ca73 100644 --- a/net/dccp/ccids/lib/packet_history.c +++ b/net/dccp/ccids/lib/packet_history.c | |||
@@ -116,58 +116,58 @@ EXPORT_SYMBOL_GPL(tfrc_tx_hist_rtt); | |||
116 | */ | 116 | */ |
117 | static struct kmem_cache *tfrc_rx_hist_slab; | 117 | static struct kmem_cache *tfrc_rx_hist_slab; |
118 | 118 | ||
119 | struct dccp_rx_hist_entry *dccp_rx_hist_entry_new(const u32 ndp, | 119 | struct tfrc_rx_hist_entry *tfrc_rx_hist_entry_new(const u32 ndp, |
120 | const struct sk_buff *skb, | 120 | const struct sk_buff *skb, |
121 | const gfp_t prio) | 121 | const gfp_t prio) |
122 | { | 122 | { |
123 | struct dccp_rx_hist_entry *entry = kmem_cache_alloc(tfrc_rx_hist_slab, | 123 | struct tfrc_rx_hist_entry *entry = kmem_cache_alloc(tfrc_rx_hist_slab, |
124 | prio); | 124 | prio); |
125 | 125 | ||
126 | if (entry != NULL) { | 126 | if (entry != NULL) { |
127 | const struct dccp_hdr *dh = dccp_hdr(skb); | 127 | const struct dccp_hdr *dh = dccp_hdr(skb); |
128 | 128 | ||
129 | entry->dccphrx_seqno = DCCP_SKB_CB(skb)->dccpd_seq; | 129 | entry->tfrchrx_seqno = DCCP_SKB_CB(skb)->dccpd_seq; |
130 | entry->dccphrx_ccval = dh->dccph_ccval; | 130 | entry->tfrchrx_ccval = dh->dccph_ccval; |
131 | entry->dccphrx_type = dh->dccph_type; | 131 | entry->tfrchrx_type = dh->dccph_type; |
132 | entry->dccphrx_ndp = ndp; | 132 | entry->tfrchrx_ndp = ndp; |
133 | entry->dccphrx_tstamp = ktime_get_real(); | 133 | entry->tfrchrx_tstamp = ktime_get_real(); |
134 | } | 134 | } |
135 | 135 | ||
136 | return entry; | 136 | return entry; |
137 | } | 137 | } |
138 | EXPORT_SYMBOL_GPL(dccp_rx_hist_entry_new); | 138 | EXPORT_SYMBOL_GPL(tfrc_rx_hist_entry_new); |
139 | 139 | ||
140 | static inline void dccp_rx_hist_entry_delete(struct dccp_rx_hist_entry *entry) | 140 | static inline void tfrc_rx_hist_entry_delete(struct tfrc_rx_hist_entry *entry) |
141 | { | 141 | { |
142 | kmem_cache_free(tfrc_rx_hist_slab, entry); | 142 | kmem_cache_free(tfrc_rx_hist_slab, entry); |
143 | } | 143 | } |
144 | 144 | ||
145 | int dccp_rx_hist_find_entry(const struct list_head *list, const u64 seq, | 145 | int tfrc_rx_hist_find_entry(const struct list_head *list, const u64 seq, |
146 | u8 *ccval) | 146 | u8 *ccval) |
147 | { | 147 | { |
148 | struct dccp_rx_hist_entry *packet = NULL, *entry; | 148 | struct tfrc_rx_hist_entry *packet = NULL, *entry; |
149 | 149 | ||
150 | list_for_each_entry(entry, list, dccphrx_node) | 150 | list_for_each_entry(entry, list, tfrchrx_node) |
151 | if (entry->dccphrx_seqno == seq) { | 151 | if (entry->tfrchrx_seqno == seq) { |
152 | packet = entry; | 152 | packet = entry; |
153 | break; | 153 | break; |
154 | } | 154 | } |
155 | 155 | ||
156 | if (packet) | 156 | if (packet) |
157 | *ccval = packet->dccphrx_ccval; | 157 | *ccval = packet->tfrchrx_ccval; |
158 | 158 | ||
159 | return packet != NULL; | 159 | return packet != NULL; |
160 | } | 160 | } |
161 | 161 | ||
162 | EXPORT_SYMBOL_GPL(dccp_rx_hist_find_entry); | 162 | EXPORT_SYMBOL_GPL(tfrc_rx_hist_find_entry); |
163 | struct dccp_rx_hist_entry * | 163 | struct tfrc_rx_hist_entry * |
164 | dccp_rx_hist_find_data_packet(const struct list_head *list) | 164 | tfrc_rx_hist_find_data_packet(const struct list_head *list) |
165 | { | 165 | { |
166 | struct dccp_rx_hist_entry *entry, *packet = NULL; | 166 | struct tfrc_rx_hist_entry *entry, *packet = NULL; |
167 | 167 | ||
168 | list_for_each_entry(entry, list, dccphrx_node) | 168 | list_for_each_entry(entry, list, tfrchrx_node) |
169 | if (entry->dccphrx_type == DCCP_PKT_DATA || | 169 | if (entry->tfrchrx_type == DCCP_PKT_DATA || |
170 | entry->dccphrx_type == DCCP_PKT_DATAACK) { | 170 | entry->tfrchrx_type == DCCP_PKT_DATAACK) { |
171 | packet = entry; | 171 | packet = entry; |
172 | break; | 172 | break; |
173 | } | 173 | } |
@@ -175,29 +175,29 @@ struct dccp_rx_hist_entry * | |||
175 | return packet; | 175 | return packet; |
176 | } | 176 | } |
177 | 177 | ||
178 | EXPORT_SYMBOL_GPL(dccp_rx_hist_find_data_packet); | 178 | EXPORT_SYMBOL_GPL(tfrc_rx_hist_find_data_packet); |
179 | 179 | ||
180 | void dccp_rx_hist_add_packet(struct list_head *rx_list, | 180 | void tfrc_rx_hist_add_packet(struct list_head *rx_list, |
181 | struct list_head *li_list, | 181 | struct list_head *li_list, |
182 | struct dccp_rx_hist_entry *packet, | 182 | struct tfrc_rx_hist_entry *packet, |
183 | u64 nonloss_seqno) | 183 | u64 nonloss_seqno) |
184 | { | 184 | { |
185 | struct dccp_rx_hist_entry *entry, *next; | 185 | struct tfrc_rx_hist_entry *entry, *next; |
186 | u8 num_later = 0; | 186 | u8 num_later = 0; |
187 | 187 | ||
188 | list_add(&packet->dccphrx_node, rx_list); | 188 | list_add(&packet->tfrchrx_node, rx_list); |
189 | 189 | ||
190 | num_later = TFRC_RECV_NUM_LATE_LOSS + 1; | 190 | num_later = TFRC_RECV_NUM_LATE_LOSS + 1; |
191 | 191 | ||
192 | if (!list_empty(li_list)) { | 192 | if (!list_empty(li_list)) { |
193 | list_for_each_entry_safe(entry, next, rx_list, dccphrx_node) { | 193 | list_for_each_entry_safe(entry, next, rx_list, tfrchrx_node) { |
194 | if (num_later == 0) { | 194 | if (num_later == 0) { |
195 | if (after48(nonloss_seqno, | 195 | if (after48(nonloss_seqno, |
196 | entry->dccphrx_seqno)) { | 196 | entry->tfrchrx_seqno)) { |
197 | list_del_init(&entry->dccphrx_node); | 197 | list_del_init(&entry->tfrchrx_node); |
198 | dccp_rx_hist_entry_delete(entry); | 198 | tfrc_rx_hist_entry_delete(entry); |
199 | } | 199 | } |
200 | } else if (dccp_rx_hist_entry_data_packet(entry)) | 200 | } else if (tfrc_rx_hist_entry_data_packet(entry)) |
201 | --num_later; | 201 | --num_later; |
202 | } | 202 | } |
203 | } else { | 203 | } else { |
@@ -208,7 +208,7 @@ void dccp_rx_hist_add_packet(struct list_head *rx_list, | |||
208 | * We have no loss interval history so we need at least one | 208 | * We have no loss interval history so we need at least one |
209 | * rtt:s of data packets to approximate rtt. | 209 | * rtt:s of data packets to approximate rtt. |
210 | */ | 210 | */ |
211 | list_for_each_entry_safe(entry, next, rx_list, dccphrx_node) { | 211 | list_for_each_entry_safe(entry, next, rx_list, tfrchrx_node) { |
212 | if (num_later == 0) { | 212 | if (num_later == 0) { |
213 | switch (step) { | 213 | switch (step) { |
214 | case 0: | 214 | case 0: |
@@ -220,10 +220,10 @@ void dccp_rx_hist_add_packet(struct list_head *rx_list, | |||
220 | step = 2; | 220 | step = 2; |
221 | /* OK, find next data packet */ | 221 | /* OK, find next data packet */ |
222 | num_later = 1; | 222 | num_later = 1; |
223 | win_count = entry->dccphrx_ccval; | 223 | win_count = entry->tfrchrx_ccval; |
224 | break; | 224 | break; |
225 | case 2: | 225 | case 2: |
226 | tmp = win_count - entry->dccphrx_ccval; | 226 | tmp = win_count - entry->tfrchrx_ccval; |
227 | if (tmp < 0) | 227 | if (tmp < 0) |
228 | tmp += TFRC_WIN_COUNT_LIMIT; | 228 | tmp += TFRC_WIN_COUNT_LIMIT; |
229 | if (tmp > TFRC_WIN_COUNT_PER_RTT + 1) { | 229 | if (tmp > TFRC_WIN_COUNT_PER_RTT + 1) { |
@@ -236,29 +236,29 @@ void dccp_rx_hist_add_packet(struct list_head *rx_list, | |||
236 | num_later = 1; | 236 | num_later = 1; |
237 | break; | 237 | break; |
238 | case 3: | 238 | case 3: |
239 | list_del_init(&entry->dccphrx_node); | 239 | list_del_init(&entry->tfrchrx_node); |
240 | dccp_rx_hist_entry_delete(entry); | 240 | tfrc_rx_hist_entry_delete(entry); |
241 | break; | 241 | break; |
242 | } | 242 | } |
243 | } else if (dccp_rx_hist_entry_data_packet(entry)) | 243 | } else if (tfrc_rx_hist_entry_data_packet(entry)) |
244 | --num_later; | 244 | --num_later; |
245 | } | 245 | } |
246 | } | 246 | } |
247 | } | 247 | } |
248 | 248 | ||
249 | EXPORT_SYMBOL_GPL(dccp_rx_hist_add_packet); | 249 | EXPORT_SYMBOL_GPL(tfrc_rx_hist_add_packet); |
250 | 250 | ||
251 | void dccp_rx_hist_purge(struct list_head *list) | 251 | void tfrc_rx_hist_purge(struct list_head *list) |
252 | { | 252 | { |
253 | struct dccp_rx_hist_entry *entry, *next; | 253 | struct tfrc_rx_hist_entry *entry, *next; |
254 | 254 | ||
255 | list_for_each_entry_safe(entry, next, list, dccphrx_node) { | 255 | list_for_each_entry_safe(entry, next, list, tfrchrx_node) { |
256 | list_del_init(&entry->dccphrx_node); | 256 | list_del_init(&entry->tfrchrx_node); |
257 | dccp_rx_hist_entry_delete(entry); | 257 | tfrc_rx_hist_entry_delete(entry); |
258 | } | 258 | } |
259 | } | 259 | } |
260 | 260 | ||
261 | EXPORT_SYMBOL_GPL(dccp_rx_hist_purge); | 261 | EXPORT_SYMBOL_GPL(tfrc_rx_hist_purge); |
262 | 262 | ||
263 | __init int packet_history_init(void) | 263 | __init int packet_history_init(void) |
264 | { | 264 | { |
@@ -269,7 +269,7 @@ __init int packet_history_init(void) | |||
269 | goto out_err; | 269 | goto out_err; |
270 | 270 | ||
271 | tfrc_rx_hist_slab = kmem_cache_create("tfrc_rx_hist", | 271 | tfrc_rx_hist_slab = kmem_cache_create("tfrc_rx_hist", |
272 | sizeof(struct dccp_rx_hist_entry), 0, | 272 | sizeof(struct tfrc_rx_hist_entry), 0, |
273 | SLAB_HWCACHE_ALIGN, NULL); | 273 | SLAB_HWCACHE_ALIGN, NULL); |
274 | if (tfrc_rx_hist_slab == NULL) | 274 | if (tfrc_rx_hist_slab == NULL) |
275 | goto out_free_tx; | 275 | goto out_free_tx; |
diff --git a/net/dccp/ccids/lib/packet_history.h b/net/dccp/ccids/lib/packet_history.h index 34b180b0eda..5b0b9834340 100644 --- a/net/dccp/ccids/lib/packet_history.h +++ b/net/dccp/ccids/lib/packet_history.h | |||
@@ -57,51 +57,51 @@ extern u32 tfrc_tx_hist_rtt(struct tfrc_tx_hist_entry *head, | |||
57 | /* | 57 | /* |
58 | * Receiver History data structures and declarations | 58 | * Receiver History data structures and declarations |
59 | */ | 59 | */ |
60 | struct dccp_rx_hist_entry { | 60 | struct tfrc_rx_hist_entry { |
61 | struct list_head dccphrx_node; | 61 | struct list_head tfrchrx_node; |
62 | u64 dccphrx_seqno:48, | 62 | u64 tfrchrx_seqno:48, |
63 | dccphrx_ccval:4, | 63 | tfrchrx_ccval:4, |
64 | dccphrx_type:4; | 64 | tfrchrx_type:4; |
65 | u32 dccphrx_ndp; /* In fact it is from 8 to 24 bits */ | 65 | u32 tfrchrx_ndp; /* In fact it is from 8 to 24 bits */ |
66 | ktime_t dccphrx_tstamp; | 66 | ktime_t tfrchrx_tstamp; |
67 | }; | 67 | }; |
68 | 68 | ||
69 | extern struct dccp_rx_hist_entry * | 69 | extern struct tfrc_rx_hist_entry * |
70 | dccp_rx_hist_entry_new(const u32 ndp, | 70 | tfrc_rx_hist_entry_new(const u32 ndp, |
71 | const struct sk_buff *skb, | 71 | const struct sk_buff *skb, |
72 | const gfp_t prio); | 72 | const gfp_t prio); |
73 | 73 | ||
74 | static inline struct dccp_rx_hist_entry * | 74 | static inline struct tfrc_rx_hist_entry * |
75 | dccp_rx_hist_head(struct list_head *list) | 75 | tfrc_rx_hist_head(struct list_head *list) |
76 | { | 76 | { |
77 | struct dccp_rx_hist_entry *head = NULL; | 77 | struct tfrc_rx_hist_entry *head = NULL; |
78 | 78 | ||
79 | if (!list_empty(list)) | 79 | if (!list_empty(list)) |
80 | head = list_entry(list->next, struct dccp_rx_hist_entry, | 80 | head = list_entry(list->next, struct tfrc_rx_hist_entry, |
81 | dccphrx_node); | 81 | tfrchrx_node); |
82 | return head; | 82 | return head; |
83 | } | 83 | } |
84 | 84 | ||
85 | extern int dccp_rx_hist_find_entry(const struct list_head *list, const u64 seq, | 85 | extern int tfrc_rx_hist_find_entry(const struct list_head *list, const u64 seq, |
86 | u8 *ccval); | 86 | u8 *ccval); |
87 | extern struct dccp_rx_hist_entry * | 87 | extern struct tfrc_rx_hist_entry * |
88 | dccp_rx_hist_find_data_packet(const struct list_head *list); | 88 | tfrc_rx_hist_find_data_packet(const struct list_head *list); |
89 | 89 | ||
90 | extern void dccp_rx_hist_add_packet(struct list_head *rx_list, | 90 | extern void tfrc_rx_hist_add_packet(struct list_head *rx_list, |
91 | struct list_head *li_list, | 91 | struct list_head *li_list, |
92 | struct dccp_rx_hist_entry *packet, | 92 | struct tfrc_rx_hist_entry *packet, |
93 | u64 nonloss_seqno); | 93 | u64 nonloss_seqno); |
94 | 94 | ||
95 | extern void dccp_rx_hist_purge(struct list_head *list); | 95 | extern void tfrc_rx_hist_purge(struct list_head *list); |
96 | 96 | ||
97 | static inline int | 97 | static inline int |
98 | dccp_rx_hist_entry_data_packet(const struct dccp_rx_hist_entry *entry) | 98 | tfrc_rx_hist_entry_data_packet(const struct tfrc_rx_hist_entry *entry) |
99 | { | 99 | { |
100 | return entry->dccphrx_type == DCCP_PKT_DATA || | 100 | return entry->tfrchrx_type == DCCP_PKT_DATA || |
101 | entry->dccphrx_type == DCCP_PKT_DATAACK; | 101 | entry->tfrchrx_type == DCCP_PKT_DATAACK; |
102 | } | 102 | } |
103 | 103 | ||
104 | extern u64 dccp_rx_hist_detect_loss(struct list_head *rx_list, | 104 | extern u64 tfrc_rx_hist_detect_loss(struct list_head *rx_list, |
105 | struct list_head *li_list, u8 *win_loss); | 105 | struct list_head *li_list, u8 *win_loss); |
106 | 106 | ||
107 | #endif /* _DCCP_PKT_HIST_ */ | 107 | #endif /* _DCCP_PKT_HIST_ */ |