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

Function _ring_peek_one

freebsd/net/iflib.c:3685–3703  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3683}
3684
3685static struct mbuf **
3686_ring_peek_one(struct ifmp_ring *r, int cidx, int offset, int remaining)
3687{
3688 int next, size;
3689 struct mbuf **items;
3690
3691 size = r->size;
3692 next = (cidx + CACHE_PTR_INCREMENT) & (size-1);
3693 items = __DEVOLATILE(struct mbuf **, &r->items[0]);
3694
3695 prefetch(items[(cidx + offset) & (size-1)]);
3696 if (remaining > 1) {
3697 prefetch2cachelines(&items[next]);
3698 prefetch2cachelines(items[(cidx + offset + 1) & (size-1)]);
3699 prefetch2cachelines(items[(cidx + offset + 2) & (size-1)]);
3700 prefetch2cachelines(items[(cidx + offset + 3) & (size-1)]);
3701 }
3702 return (__DEVOLATILE(struct mbuf **, &r->items[(cidx + offset) & (size-1)]));
3703}
3704
3705static void
3706iflib_txq_check_drain(iflib_txq_t txq, int budget)

Callers 2

iflib_txq_drainFunction · 0.85
iflib_txq_drain_freeFunction · 0.85

Calls 2

prefetchFunction · 0.85
prefetch2cachelinesFunction · 0.85

Tested by

no test coverage detected