summaryrefslogtreecommitdiffstats
path: root/src/svm/svm_fifo.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2021-12-29 15:44:48 -0800
committerFlorin Coras <fcoras@cisco.com>2021-12-30 09:11:17 -0800
commit03e40e6230bf14aebf7b8d058ca9a32fe3d4e4fc (patch)
tree4fe5f1c32fecefa74dda8ceae8e0869c45fd5ff7 /src/svm/svm_fifo.h
parentfe2231f01fb56af21d6b4d6f63d7e1a2c4d14848 (diff)
svm: merge want deq and leq threshold notifications
Type: improvement Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I2775af35386a4e52ba82991c68bce6c56f13410f
Diffstat (limited to 'src/svm/svm_fifo.h')
-rw-r--r--src/svm/svm_fifo.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/svm/svm_fifo.h b/src/svm/svm_fifo.h
index 42efb5af6b3..9b55f720e5b 100644
--- a/src/svm/svm_fifo.h
+++ b/src/svm/svm_fifo.h
@@ -35,8 +35,6 @@ typedef enum svm_fifo_deq_ntf_
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_
@@ -795,8 +793,7 @@ svm_fifo_clear_deq_ntf (svm_fifo_t * f)
/* 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);
}
/**
@@ -832,7 +829,7 @@ svm_fifo_needs_deq_ntf (svm_fifo_t * f, u32 n_last_deq)
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);
@@ -846,12 +843,6 @@ svm_fifo_needs_deq_ntf (svm_fifo_t * f, u32 n_last_deq)
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;
}
@@ -859,7 +850,7 @@ svm_fifo_needs_deq_ntf (svm_fifo_t * f, u32 n_last_deq)
* 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)