+ /* The ring->head acts as a guard variable between Tx and Rx
+ * threads, so using load-acquire pairs with store-release
+ * to synchronize it between threads.
+ */
+ slot = __atomic_load_n(&ring->head, __ATOMIC_ACQUIRE);
+ n_free = ring_size - slot + mq->last_tail;