xnu-4903.241.1/bsd/net/if_llatbl.c
/*
 * Helper function used to drop all mbufs in hold queue.
 *
 * Returns the number of held packets, if any, that were dropped.
 */
Helper function used to drop all mbufs in hold queue.
Returns the number of held packets, if any, that were dropped.
Helper function used to drop all mbufs in hold queue . Returns the number of held packets if any that were dropped .
size_t
lltable_drop_entry_queue(struct llentry *lle)
{
	size_t pkts_dropped;
	struct mbuf *next;
	LLE_WLOCK_ASSERT(lle);
	pkts_dropped = 0;
	while ((lle->la_numheld > 0) && (lle->la_hold != NULL)) {
		next = lle->la_hold->m_nextpkt;
		m_freem(lle->la_hold);
		lle->la_hold = next;
		lle->la_numheld--;
		pkts_dropped++;
	}
	KASSERT(lle->la_numheld == 0,
		("%s: la_numheld %d > 0, pkts_droped %zd", __func__,
		 lle->la_numheld, pkts_dropped));
	return (pkts_dropped);
}
size_t lltable_drop_entry_queue ( struct llentry * lle ) { size_t pkts_dropped ; struct mbuf * next ; LLE_WLOCK_ASSERT ( lle ) ; pkts_dropped = 0 ; while ( ( lle -> la_numheld > 0 ) && ( lle -> la_hold != NULL ) ) { next = lle -> la_hold -> m_nextpkt ; m_freem ( lle -> la_hold ) ; lle -> la_hold = next ; lle -> la_numheld -- ; pkts_dropped ++ ; } KASSERT ( lle -> la_numheld == 0 , ( " " , __func__ , lle -> la_numheld , pkts_dropped ) ) ; return ( pkts_dropped ) ; }
Helper function used to drop all mbufs in hold queue.
Helper function used to drop all mbufs in hold queue .