+ clib_atomic_swap_acq_n (&f->has_event, 0);
+}
+
+/**
+ * Set specific want notification flag
+ *
+ * For list of flags see @ref svm_fifo_deq_ntf_t
+ *
+ * @param f fifo
+ * @param ntf_type type of notification requested
+ */
+static inline void
+svm_fifo_add_want_deq_ntf (svm_fifo_t * f, u8 ntf_type)
+{
+ f->want_deq_ntf |= ntf_type;
+}
+
+/**
+ * Clear specific want notification flag
+ *
+ * For list of flags see @ref svm_fifo_ntf_t
+ *
+ * @param f fifo
+ * @param ntf_type type of notification to be cleared
+ */
+static inline void
+svm_fifo_del_want_deq_ntf (svm_fifo_t * f, u8 ntf_type)
+{
+ f->want_deq_ntf &= ~ntf_type;
+}
+
+/**
+ * Clear the want notification flag and set has notification
+ *
+ * Should be used after enqueuing an event. This clears the
+ * SVM_FIFO_WANT_NOTIF flag but it does not clear
+ * SVM_FIFO_WANT_NOTIF_IF_FULL. If the latter was set, has_ntf is
+ * set to avoid enqueueing events for for all dequeue operations until
+ * it is manually cleared.
+ *
+ * @param f fifo
+ */
+static inline void
+svm_fifo_clear_deq_ntf (svm_fifo_t * f)
+{
+ /* Set the flag if want_notif_if_full was the only ntf requested */
+ f->has_deq_ntf = f->want_deq_ntf == SVM_FIFO_WANT_DEQ_NOTIF_IF_FULL;
+ svm_fifo_del_want_deq_ntf (f, SVM_FIFO_WANT_DEQ_NOTIF);
+}
+
+/**
+ * Clear has notification flag
+ *
+ * The fifo generates only one event per SVM_FIFO_WANT_NOTIF_IF_FULL
+ * request and sets has_ntf. To received new events the flag must be
+ * cleared using this function.
+ *
+ * @param f fifo
+ */
+static inline void
+svm_fifo_reset_has_deq_ntf (svm_fifo_t * f)
+{
+ f->has_deq_ntf = 0;
+}
+
+/**
+ * Check if fifo needs dequeue notification
+ *
+ * Determines based on notification request flags and state of the fifo if
+ * an event should be generated.
+ *
+ * @param f fifo
+ * @param n_last_deq number of bytes last dequeued
+ * @return 1 if event should be generated, 0 otherwise
+ */
+static inline u8
+svm_fifo_needs_deq_ntf (svm_fifo_t * f, u32 n_last_deq)
+{
+ u8 want_ntf = f->want_deq_ntf;
+
+ if (PREDICT_TRUE (want_ntf == SVM_FIFO_NO_DEQ_NOTIF))