MCPcopy Create free account
hub / github.com/F-Stack/f-stack / hpts_sane_pace_remove

Function hpts_sane_pace_remove

freebsd/netinet/tcp_hpts.c:366–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364}
365
366static inline void
367hpts_sane_pace_remove(struct tcp_hpts_entry *hpts, struct inpcb *inp, struct hptsh *head, int clear)
368{
369#ifdef INVARIANTS
370 if (mtx_owned(&hpts->p_mtx) == 0) {
371 /* We don't own the mutex? */
372 panic("%s: hpts:%p inp:%p no hpts mutex", __FUNCTION__, hpts, inp);
373 }
374 if (hpts->p_cpu != inp->inp_hpts_cpu) {
375 /* It is not the right cpu/mutex? */
376 panic("%s: hpts:%p inp:%p incorrect CPU", __FUNCTION__, hpts, inp);
377 }
378 if (inp->inp_in_hpts == 0) {
379 /* We are not on the hpts? */
380 panic("%s: hpts:%p inp:%p not on the hpts?", __FUNCTION__, hpts, inp);
381 }
382#endif
383 TAILQ_REMOVE(head, inp, inp_hpts);
384 hpts->p_on_queue_cnt--;
385 if (hpts->p_on_queue_cnt < 0) {
386 /* Count should not go negative .. */
387#ifdef INVARIANTS
388 panic("Hpts goes negative inp:%p hpts:%p",
389 inp, hpts);
390#endif
391 hpts->p_on_queue_cnt = 0;
392 }
393 if (clear) {
394 inp->inp_hpts_request = 0;
395 inp->inp_in_hpts = 0;
396 }
397}
398
399static inline void
400hpts_sane_pace_insert(struct tcp_hpts_entry *hpts, struct inpcb *inp, struct hptsh *head, int line, int noref)

Callers 2

tcp_hptsiFunction · 0.85

Calls 1

panicFunction · 0.50

Tested by

no test coverage detected