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

Function drbr_dequeue_cond

freebsd/net/ifq.h:423–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421}
422
423static __inline struct mbuf *
424drbr_dequeue_cond(struct ifnet *ifp, struct buf_ring *br,
425 int (*func) (struct mbuf *, void *), void *arg)
426{
427 struct mbuf *m;
428#ifdef ALTQ
429 if (ALTQ_IS_ENABLED(&ifp->if_snd)) {
430 IFQ_LOCK(&ifp->if_snd);
431 IFQ_POLL_NOLOCK(&ifp->if_snd, m);
432 if (m != NULL && func(m, arg) == 0) {
433 IFQ_UNLOCK(&ifp->if_snd);
434 return (NULL);
435 }
436 IFQ_DEQUEUE_NOLOCK(&ifp->if_snd, m);
437 IFQ_UNLOCK(&ifp->if_snd);
438 return (m);
439 }
440#endif
441 m = (struct mbuf *)buf_ring_peek(br);
442 if (m == NULL || func(m, arg) == 0)
443 return (NULL);
444
445 return ((struct mbuf *)buf_ring_dequeue_sc(br));
446}
447
448static __inline int
449drbr_empty(struct ifnet *ifp, struct buf_ring *br)

Callers

nothing calls this directly

Calls 2

buf_ring_peekFunction · 0.85
buf_ring_dequeue_scFunction · 0.85

Tested by

no test coverage detected