Lines Matching full:hs

104 tqhash_min(struct tailq_hash *hs)  in tqhash_min()  argument
108 rsm = hs->rsm_min; in tqhash_min()
113 tqhash_max(struct tailq_hash *hs) in tqhash_max() argument
117 rsm = hs->rsm_max; in tqhash_max()
122 tqhash_empty(struct tailq_hash *hs) in tqhash_empty() argument
124 if (hs->count == 0) in tqhash_empty()
130 tqhash_find(struct tailq_hash *hs, uint32_t seq) in tqhash_find() argument
135 if ((SEQ_LT(seq, hs->min)) || in tqhash_find()
136 (hs->count == 0) || in tqhash_find()
137 (SEQ_GEQ(seq, hs->max))) { in tqhash_find()
144 if (TAILQ_EMPTY(&hs->ht[bindex])) { in tqhash_find()
147 TAILQ_FOREACH(e, &hs->ht[bindex], next) { in tqhash_find()
174 TAILQ_FOREACH_REVERSE(e, &hs->ht[pbucket], rack_head, next) { in tqhash_find()
187 tqhash_next(struct tailq_hash *hs, struct rack_sendmap *rsm) in tqhash_next() argument
199 e = TAILQ_FIRST(&hs->ht[nxt]); in tqhash_next()
205 tqhash_prev(struct tailq_hash *hs, struct rack_sendmap *rsm) in tqhash_prev() argument
217 e = TAILQ_LAST(&hs->ht[prev], rack_head); in tqhash_prev()
223 tqhash_remove(struct tailq_hash *hs, struct rack_sendmap *rsm, int type) in tqhash_remove() argument
226 hs->count--; in tqhash_remove()
227 if (hs->count == 0) { in tqhash_remove()
228 hs->min = hs->max; in tqhash_remove()
229 hs->rsm_max = hs->rsm_min = NULL; in tqhash_remove()
231 hs->min = rsm->r_end; in tqhash_remove()
232 hs->rsm_min = tqhash_next(hs, rsm); in tqhash_remove()
233 } else if (rsm == hs->rsm_max) { in tqhash_remove()
234 hs->rsm_max = tqhash_prev(hs, rsm); in tqhash_remove()
235 hs->max = hs->rsm_max->r_end; in tqhash_remove()
237 TAILQ_REMOVE(&hs->ht[rsm->bindex], rsm, next); in tqhash_remove()
241 tqhash_insert(struct tailq_hash *hs, struct rack_sendmap *rsm) in tqhash_insert() argument
248 if (hs->count > 0) { in tqhash_insert()
249 if ((rsm->r_end - hs->min) > MAX_ALLOWED_SEQ_RANGE) { in tqhash_insert()
252 e = tqhash_find(hs, rsm->r_start); in tqhash_insert()
268 if (hs->count == 0) { in tqhash_insert()
270 hs->min = rsm->r_start; in tqhash_insert()
271 hs->max = rsm->r_end; in tqhash_insert()
272 hs->rsm_min = hs->rsm_max = rsm; in tqhash_insert()
273 hs->count = 1; in tqhash_insert()
275 hs->count++; in tqhash_insert()
276 if (SEQ_GEQ(rsm->r_end, hs->max)) { in tqhash_insert()
277 hs->max = rsm->r_end; in tqhash_insert()
278 hs->rsm_max = rsm; in tqhash_insert()
279 } if (SEQ_LEQ(rsm->r_start, hs->min)) { in tqhash_insert()
280 hs->min = rsm->r_start; in tqhash_insert()
281 hs->rsm_min = rsm; in tqhash_insert()
285 l = TAILQ_LAST(&hs->ht[rsm->bindex], rack_head); in tqhash_insert()
287 TAILQ_INSERT_TAIL(&hs->ht[rsm->bindex], rsm, next); in tqhash_insert()
290 TAILQ_FOREACH(e, &hs->ht[rsm->bindex], next) { in tqhash_insert()
298 TAILQ_INSERT_TAIL(&hs->ht[rsm->bindex], rsm, next); in tqhash_insert()
304 tqhash_init(struct tailq_hash *hs) in tqhash_init() argument
309 TAILQ_INIT(&hs->ht[i]); in tqhash_init()
311 hs->min = hs->max = 0; in tqhash_init()
312 hs->rsm_min = hs->rsm_max = NULL; in tqhash_init()
313 hs->count = 0; in tqhash_init()
317 tqhash_trim(struct tailq_hash *hs, uint32_t th_ack) in tqhash_trim() argument
321 if (SEQ_LT(th_ack, hs->min)) { in tqhash_trim()
325 if (SEQ_GEQ(th_ack, hs->max)) { in tqhash_trim()
329 rsm = tqhash_min(hs); in tqhash_trim()
341 if (SEQ_GT(th_ack, hs->min)) in tqhash_trim()
342 hs->min = th_ack; in tqhash_trim()
354 tqhash_update_end(struct tailq_hash *hs, struct rack_sendmap *rsm, in tqhash_update_end() argument
357 if (hs->max == rsm->r_end) in tqhash_update_end()
358 hs->max = th_ack; in tqhash_update_end()