* Drain all packets currently held in a particular protocol work queue. */
| 606 | * Drain all packets currently held in a particular protocol work queue. |
| 607 | */ |
| 608 | static void |
| 609 | netisr_drain_proto(struct netisr_work *npwp) |
| 610 | { |
| 611 | struct mbuf *m; |
| 612 | |
| 613 | /* |
| 614 | * We would assert the lock on the workstream but it's not passed in. |
| 615 | */ |
| 616 | while ((m = npwp->nw_head) != NULL) { |
| 617 | npwp->nw_head = m->m_nextpkt; |
| 618 | m->m_nextpkt = NULL; |
| 619 | if (npwp->nw_head == NULL) |
| 620 | npwp->nw_tail = NULL; |
| 621 | npwp->nw_len--; |
| 622 | m_freem(m); |
| 623 | } |
| 624 | KASSERT(npwp->nw_tail == NULL, ("%s: tail", __func__)); |
| 625 | KASSERT(npwp->nw_len == 0, ("%s: len", __func__)); |
| 626 | } |
| 627 | |
| 628 | /* |
| 629 | * Remove the registration of a network protocol, which requires clearing |
no test coverage detected