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

Function netisr_drain_proto

freebsd/net/netisr.c:608–626  ·  view source on GitHub ↗

* Drain all packets currently held in a particular protocol work queue. */

Source from the content-addressed store, hash-verified

606 * Drain all packets currently held in a particular protocol work queue.
607 */
608static void
609netisr_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

Callers 1

netisr_unregisterFunction · 0.85

Calls 1

m_freemFunction · 0.50

Tested by

no test coverage detected