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

Function lltable_drop_entry_queue

freebsd/net/if_llatbl.c:284–306  ·  view source on GitHub ↗

* Helper function used to drop all mbufs in hold queue. * * Returns the number of held packets, if any, that were dropped. */

Source from the content-addressed store, hash-verified

282 * Returns the number of held packets, if any, that were dropped.
283 */
284size_t
285lltable_drop_entry_queue(struct llentry *lle)
286{
287 size_t pkts_dropped;
288 struct mbuf *next;
289
290 LLE_WLOCK_ASSERT(lle);
291
292 pkts_dropped = 0;
293 while ((lle->la_numheld > 0) && (lle->la_hold != NULL)) {
294 next = lle->la_hold->m_nextpkt;
295 m_freem(lle->la_hold);
296 lle->la_hold = next;
297 lle->la_numheld--;
298 pkts_dropped++;
299 }
300
301 KASSERT(lle->la_numheld == 0,
302 ("%s: la_numheld %d > 0, pkts_droped %zd", __func__,
303 lle->la_numheld, pkts_dropped));
304
305 return (pkts_dropped);
306}
307
308void
309lltable_set_entry_addr(struct ifnet *ifp, struct llentry *lle,

Callers 1

llentry_freeFunction · 0.85

Calls 1

m_freemFunction · 0.50

Tested by

no test coverage detected