Lines Matching refs:hs
106 tqhash_min(struct tailq_hash *hs) in tqhash_min() argument
110 rsm = hs->rsm_min; in tqhash_min()
115 tqhash_max(struct tailq_hash *hs) in tqhash_max() argument
119 rsm = hs->rsm_max; in tqhash_max()
124 tqhash_empty(struct tailq_hash *hs) in tqhash_empty() argument
126 if (hs->count == 0) in tqhash_empty()
132 tqhash_find(struct tailq_hash *hs, uint32_t seq) in tqhash_find() argument
137 if ((SEQ_LT(seq, hs->min)) || in tqhash_find()
138 (hs->count == 0) || in tqhash_find()
139 (SEQ_GEQ(seq, hs->max))) { in tqhash_find()
146 if (TAILQ_EMPTY(&hs->ht[bindex])) { in tqhash_find()
149 TAILQ_FOREACH(e, &hs->ht[bindex], next) { in tqhash_find()
176 TAILQ_FOREACH_REVERSE(e, &hs->ht[pbucket], rack_head, next) { in tqhash_find()
189 tqhash_next(struct tailq_hash *hs, struct rack_sendmap *rsm) in tqhash_next() argument
201 e = TAILQ_FIRST(&hs->ht[nxt]); in tqhash_next()
207 tqhash_prev(struct tailq_hash *hs, struct rack_sendmap *rsm) in tqhash_prev() argument
219 e = TAILQ_LAST(&hs->ht[prev], rack_head); in tqhash_prev()
225 tqhash_remove(struct tailq_hash *hs, struct rack_sendmap *rsm, int type) in tqhash_remove() argument
228 hs->count--; in tqhash_remove()
229 if (hs->count == 0) { in tqhash_remove()
230 hs->min = hs->max; in tqhash_remove()
231 hs->rsm_max = hs->rsm_min = NULL; in tqhash_remove()
233 hs->min = rsm->r_end; in tqhash_remove()
234 hs->rsm_min = tqhash_next(hs, rsm); in tqhash_remove()
235 } else if (rsm == hs->rsm_max) { in tqhash_remove()
236 hs->rsm_max = tqhash_prev(hs, rsm); in tqhash_remove()
237 hs->max = hs->rsm_max->r_end; in tqhash_remove()
239 TAILQ_REMOVE(&hs->ht[rsm->bindex], rsm, next); in tqhash_remove()
243 tqhash_insert(struct tailq_hash *hs, struct rack_sendmap *rsm) in tqhash_insert() argument
250 if (hs->count > 0) { in tqhash_insert()
251 if ((rsm->r_end - hs->min) > MAX_ALLOWED_SEQ_RANGE) { in tqhash_insert()
254 e = tqhash_find(hs, rsm->r_start); in tqhash_insert()
270 if (hs->count == 0) { in tqhash_insert()
272 hs->min = rsm->r_start; in tqhash_insert()
273 hs->max = rsm->r_end; in tqhash_insert()
274 hs->rsm_min = hs->rsm_max = rsm; in tqhash_insert()
275 hs->count = 1; in tqhash_insert()
277 hs->count++; in tqhash_insert()
278 if (SEQ_GEQ(rsm->r_end, hs->max)) { in tqhash_insert()
279 hs->max = rsm->r_end; in tqhash_insert()
280 hs->rsm_max = rsm; in tqhash_insert()
281 } if (SEQ_LEQ(rsm->r_start, hs->min)) { in tqhash_insert()
282 hs->min = rsm->r_start; in tqhash_insert()
283 hs->rsm_min = rsm; in tqhash_insert()
287 l = TAILQ_LAST(&hs->ht[rsm->bindex], rack_head); in tqhash_insert()
289 TAILQ_INSERT_TAIL(&hs->ht[rsm->bindex], rsm, next); in tqhash_insert()
292 TAILQ_FOREACH(e, &hs->ht[rsm->bindex], next) { in tqhash_insert()
300 TAILQ_INSERT_TAIL(&hs->ht[rsm->bindex], rsm, next); in tqhash_insert()
306 tqhash_init(struct tailq_hash *hs) in tqhash_init() argument
311 TAILQ_INIT(&hs->ht[i]); in tqhash_init()
313 hs->min = hs->max = 0; in tqhash_init()
314 hs->rsm_min = hs->rsm_max = NULL; in tqhash_init()
315 hs->count = 0; in tqhash_init()
319 tqhash_trim(struct tailq_hash *hs, uint32_t th_ack) in tqhash_trim() argument
323 if (SEQ_LT(th_ack, hs->min)) { in tqhash_trim()
327 if (SEQ_GEQ(th_ack, hs->max)) { in tqhash_trim()
331 rsm = tqhash_min(hs); in tqhash_trim()
343 if (SEQ_GT(th_ack, hs->min)) in tqhash_trim()
344 hs->min = th_ack; in tqhash_trim()
356 tqhash_update_end(struct tailq_hash *hs, struct rack_sendmap *rsm, in tqhash_update_end() argument
359 if (hs->max == rsm->r_end) in tqhash_update_end()
360 hs->max = th_ack; in tqhash_update_end()