+always_inline u32
+svm_fifo_nitems (svm_fifo_t * f)
+{
+ return f->nitems;
+}
+
+static inline void
+svm_fifo_add_want_tx_ntf (svm_fifo_t * f, u8 ntf_type)
+{
+ f->want_tx_ntf |= ntf_type;
+}
+
+static inline void
+svm_fifo_del_want_tx_ntf (svm_fifo_t * f, u8 ntf_type)
+{
+ f->want_tx_ntf &= ~ntf_type;
+}
+
+static inline void
+svm_fifo_clear_tx_ntf (svm_fifo_t * f)
+{
+ /* Set the flag if want_tx_notif_if_full was the only ntf requested */
+ f->has_tx_ntf = f->want_tx_ntf == SVM_FIFO_WANT_TX_NOTIF_IF_FULL;
+ svm_fifo_del_want_tx_ntf (f, SVM_FIFO_WANT_TX_NOTIF);
+}
+
+static inline void
+svm_fifo_reset_tx_ntf (svm_fifo_t * f)
+{
+ f->has_tx_ntf = 0;
+}
+
+static inline u8
+svm_fifo_needs_tx_ntf (svm_fifo_t * f, u32 n_last_deq)
+{
+ u8 want_ntf = f->want_tx_ntf;
+
+ if (PREDICT_TRUE (want_ntf == SVM_FIFO_NO_TX_NOTIF))
+ return 0;
+ else if (want_ntf & SVM_FIFO_WANT_TX_NOTIF)
+ return 1;
+ else if (want_ntf & SVM_FIFO_WANT_TX_NOTIF_IF_FULL)
+ {
+ u32 max_deq = svm_fifo_max_dequeue (f);
+ u32 nitems = svm_fifo_nitems (f);
+ if (!f->has_tx_ntf && max_deq < nitems
+ && max_deq + n_last_deq >= nitems)
+ return 1;
+
+ return 0;
+ }
+ return 0;
+}
+
+always_inline u8
+svm_fifo_n_subscribers (svm_fifo_t * f)
+{
+ return f->n_subscribers;
+}
+
+u32 svm_fifo_number_ooo_segments (svm_fifo_t * f);
+ooo_segment_t *svm_fifo_first_ooo_segment (svm_fifo_t * f);
+
+always_inline ooo_segment_t *
+svm_fifo_newest_ooo_segment (svm_fifo_t * f)
+{
+ if (f->ooos_newest == OOO_SEGMENT_INVALID_INDEX)
+ return 0;
+ return pool_elt_at_index (f->ooo_segments, f->ooos_newest);
+}
+
+always_inline void
+svm_fifo_newest_ooo_segment_reset (svm_fifo_t * f)
+{
+ f->ooos_newest = OOO_SEGMENT_INVALID_INDEX;
+}
+