| 364 | } |
| 365 | |
| 366 | static inline void |
| 367 | hpts_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 | |
| 399 | static inline void |
| 400 | hpts_sane_pace_insert(struct tcp_hpts_entry *hpts, struct inpcb *inp, struct hptsh *head, int line, int noref) |
no test coverage detected