functions provide an API to network drivers for using
for enqueueing and dequeueing packets.
This is meant as a replacement for the IFQ interface for packet queuing.
It allows a packet to be enqueued with a single atomic and packet
dequeue to be done without any per-packet atomics as it is protected
by the drivers tx queue lock.
will assert that the tx queue lock is held when it is called.
function frees all the enqueued mbufs and then frees the buf_ring.
function is used to enqueue an mbuf to a buf_ring, falling back to the
ifnets IFQ if
function is used to dequeue an mbuf from a buf_ring or, if
is enabled, from the ifnets IFQ.
function is used to conditionally dequeue an mbuf from a buf_ring based
function frees all mbufs enqueued in the buf_ring and the ifnets IFQ.
if there are no mbufs enqueued,
function returns the number of mbufs enqueued.
Note to users that this is intrinsically racy as there is no guarantee that
there will not be more mbufs when
is actually called.
Provided the tx queue lock is held there will not be less.