-void ionic_q_flush(struct ionic_queue *q);
-void ionic_q_post(struct ionic_queue *q, bool ring_doorbell, desc_cb cb,
- void *cb_arg);
-uint32_t ionic_q_space_avail(struct ionic_queue *q);
-bool ionic_q_has_space(struct ionic_queue *q, uint32_t want);
-void ionic_q_service(struct ionic_queue *q, uint32_t cq_desc_index,
- uint32_t stop_index, void *service_cb_arg);
-
-int ionic_adminq_post(struct ionic_lif *lif, struct ionic_admin_ctx *ctx);
+void ionic_q_post(struct ionic_queue *q, bool ring_doorbell, void *cb_arg);
+
+static inline uint16_t
+ionic_q_space_avail(struct ionic_queue *q)
+{
+ uint16_t avail = q->tail_idx;
+
+ if (q->head_idx >= avail)
+ avail += q->num_descs - q->head_idx - 1;
+ else
+ avail -= q->head_idx + 1;
+
+ return avail;
+}
+
+static inline void
+ionic_q_flush(struct ionic_queue *q)
+{
+ uint64_t val = IONIC_DBELL_QID(q->hw_index) | q->head_idx;
+
+ rte_write64(rte_cpu_to_le_64(val), q->db);
+}