Code Review
/
deb_dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
| inline |
side by side
Imported Upstream version 17.05.2
[deb_dpdk.git]
/
lib
/
librte_kni
/
rte_kni_fifo.h
diff --git
a/lib/librte_kni/rte_kni_fifo.h
b/lib/librte_kni/rte_kni_fifo.h
index
8cb8587
..
c7cd5c2
100644
(file)
--- a/
lib/librte_kni/rte_kni_fifo.h
+++ b/
lib/librte_kni/rte_kni_fifo.h
@@
-91,3
+91,12
@@
kni_fifo_get(struct rte_kni_fifo *fifo, void **data, unsigned num)
fifo->read = new_read;
return i;
}
+
+/**
+ * Get the num of elements in the fifo
+ */
+static inline uint32_t
+kni_fifo_count(struct rte_kni_fifo *fifo)
+{
+ return (fifo->len + fifo->write - fifo->read) & (fifo->len - 1);
+}