FreeBSD/sys/net/netisr.c
/*
 * Drain all packets currently held in a particular protocol work queue.
 */
Drain all packets currently held in a particular protocol work queue.
Drain all packets currently held in a particular protocol work queue .
static void
netisr_drain_proto(struct netisr_work *npwp)
{
	struct mbuf *m;
	while ((m = npwp->nw_head) != NULL) {
		npwp->nw_head = m->m_nextpkt;
		m->m_nextpkt = NULL;
		if (npwp->nw_head == NULL)
			npwp->nw_tail = NULL;
		npwp->nw_len--;
		m_freem(m);
	}
	KASSERT(npwp->nw_tail == NULL, ("%s: tail", __func__));
	KASSERT(npwp->nw_len == 0, ("%s: len", __func__));
}
static void netisr_drain_proto ( struct netisr_work * npwp ) { struct mbuf * m ; while ( ( m = npwp -> nw_head ) != NULL ) { npwp -> nw_head = m -> m_nextpkt ; m -> m_nextpkt = NULL ; if ( npwp -> nw_head == NULL ) npwp -> nw_tail = NULL ; npwp -> nw_len -- ; m_freem ( m ) ; } KASSERT ( npwp -> nw_tail == NULL , ( " " , __func__ ) ) ; KASSERT ( npwp -> nw_len == 0 , ( " " , __func__ ) ) ; }
Drain all packets currently held in a particular protocol work queue.
Drain all packets currently held in a particular protocol work queue .
/*
	 * We would assert the lock on the workstream but it's not passed in.
	 */