aboutsummaryrefslogtreecommitdiffstats
path: root/src/svm/svm_fifo.h
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2019-05-22 18:41:50 +0200
committerFlorin Coras <florin.coras@gmail.com>2019-06-28 19:28:17 +0000
commite82a7ade8a9667f1e49067bf59010f60beda5452 (patch)
tree619ead31dfa9a20e1fcd0043e79da5fb564b9a9f /src/svm/svm_fifo.h
parentf73d4c2084c9cb6df4a1f8582acef523e4ba0cb2 (diff)
quic : Use TX event for app read notification
Type: feature Change-Id: I1846cdeb35f079249f66a0351aa244c540923a43 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/svm/svm_fifo.h')
-rw-r--r--src/svm/svm_fifo.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/svm/svm_fifo.h b/src/svm/svm_fifo.h
index b5b26ac479b..ce73be2d0f0 100644
--- a/src/svm/svm_fifo.h
+++ b/src/svm/svm_fifo.h
@@ -45,6 +45,7 @@ typedef enum svm_fifo_tx_ntf_
SVM_FIFO_NO_TX_NOTIF = 0,
SVM_FIFO_WANT_TX_NOTIF = 1,
SVM_FIFO_WANT_TX_NOTIF_IF_FULL = 2,
+ SVM_FIFO_WANT_TX_NOTIF_IF_EMPTY = 4,
} svm_fifo_tx_ntf_t;
typedef struct
@@ -820,15 +821,18 @@ svm_fifo_needs_tx_ntf (svm_fifo_t * f, u32 n_last_deq)
return 0;
else if (want_ntf & SVM_FIFO_WANT_TX_NOTIF)
return 1;
- else if (want_ntf & SVM_FIFO_WANT_TX_NOTIF_IF_FULL)
+ if (want_ntf & SVM_FIFO_WANT_TX_NOTIF_IF_FULL)
{
u32 max_deq = svm_fifo_max_dequeue_cons (f);
u32 nitems = f->nitems;
if (!f->has_tx_ntf && max_deq < nitems
&& max_deq + n_last_deq >= nitems)
return 1;
-
- return 0;
+ }
+ if (want_ntf & SVM_FIFO_WANT_TX_NOTIF_IF_EMPTY)
+ {
+ if (!f->has_tx_ntf && svm_fifo_is_empty (f))
+ return 1;
}
return 0;
}