SVM_FIFO_WANT_DEQ_NOTIF = 1, /**< Notify on dequeue */
SVM_FIFO_WANT_DEQ_NOTIF_IF_FULL = 2, /**< Notify on transition from full */
SVM_FIFO_WANT_DEQ_NOTIF_IF_EMPTY = 4, /**< Notify on transition to empty */
- SVM_FIFO_WANT_DEQ_NOTIF_IF_LEQ_THRESH = 5, /**< Notify on transition to less
- than or equal threshold */
} svm_fifo_deq_ntf_t;
typedef enum svm_fifo_flag_
* @param max_bytes max bytes to be mapped to fifo segments
* @return number of bytes in fifo segments or SVM_FIFO_EEMPTY
*/
-int svm_fifo_segments (svm_fifo_t * f, u32 offset, svm_fifo_seg_t * fs,
- u32 n_segs, u32 max_bytes);
+int svm_fifo_segments (svm_fifo_t *f, u32 offset, svm_fifo_seg_t *fs,
+ u32 *n_segs, u32 max_bytes);
/**
* Add io events subscriber to list
*
/* Set the flag if want_notif_if_full was the only ntf requested */
f->shr->has_deq_ntf =
f->shr->want_deq_ntf == SVM_FIFO_WANT_DEQ_NOTIF_IF_FULL;
- svm_fifo_del_want_deq_ntf (f, SVM_FIFO_WANT_DEQ_NOTIF |
- SVM_FIFO_WANT_DEQ_NOTIF_IF_LEQ_THRESH);
+ svm_fifo_del_want_deq_ntf (f, SVM_FIFO_WANT_DEQ_NOTIF);
}
/**
if (PREDICT_TRUE (want_ntf == SVM_FIFO_NO_DEQ_NOTIF))
return 0;
else if (want_ntf & SVM_FIFO_WANT_DEQ_NOTIF)
- return 1;
+ return (svm_fifo_max_enqueue (f) >= f->shr->deq_thresh);
if (want_ntf & SVM_FIFO_WANT_DEQ_NOTIF_IF_FULL)
{
u32 max_deq = svm_fifo_max_dequeue_cons (f);
if (!f->shr->has_deq_ntf && svm_fifo_is_empty (f))
return 1;
}
- if (want_ntf & SVM_FIFO_WANT_DEQ_NOTIF_IF_LEQ_THRESH)
- {
- if (!f->shr->has_deq_ntf &&
- (svm_fifo_max_dequeue (f) <= f->shr->deq_thresh))
- return 1;
- }
return 0;
}
* Set the fifo dequeue threshold which will be used for notifications.
*
* Note: If not set, by default threshold is zero, equivalent to
- * empty.
+ * generating notification on each dequeue event.
*/
static inline void
svm_fifo_set_deq_thresh (svm_fifo_t *f, u32 thresh)