aboutsummaryrefslogtreecommitdiffstats
path: root/src/svm
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-09-04 08:57:27 -0700
committerDave Barach <openvpp@barachs.net>2020-09-08 16:14:08 +0000
commit97d39e3e054ee681335197205e94fbf9a97a40e4 (patch)
tree4a57ae25cf64289f0cb555f9d415f10ca5b12318 /src/svm
parentfb7e7ed2cd10446d5ecd1b1e8df470e706c448ed (diff)
svm session: document unsupported fifo deq combinations
Type: fix - Document that ooo dequeues with ooo lookups cannot be done in combination with in order dequeues. - Added assert to capture this scenario and de-initialized rbtrees for cut-through tx fifo Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic40d020b3f0391fcf022ea3c906b86121744144f
Diffstat (limited to 'src/svm')
-rw-r--r--src/svm/svm_fifo.c4
-rw-r--r--src/svm/svm_fifo.h6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/svm/svm_fifo.c b/src/svm/svm_fifo.c
index 8e3bb0a7c8c..fda9481e721 100644
--- a/src/svm/svm_fifo.c
+++ b/src/svm/svm_fifo.c
@@ -1024,6 +1024,10 @@ svm_fifo_dequeue (svm_fifo_t * f, u32 len, u8 * dst)
svm_fifo_copy_from_chunk (f, f->head_chunk, head, dst, len, &f->head_chunk);
head = head + len;
+ /* In order dequeues are not supported in combination with ooo peeking.
+ * Use svm_fifo_dequeue_drop instead. */
+ ASSERT (rb_tree_n_nodes (&f->ooo_deq_lookup) <= 1);
+
if (f_pos_geq (head, f_chunk_end (f->start_chunk)))
fsh_collect_chunks (f->fs_hdr, f->slice_index,
f_unlink_chunks (f, head, 0));
diff --git a/src/svm/svm_fifo.h b/src/svm/svm_fifo.h
index e08b3e9dfa5..f7503c8e900 100644
--- a/src/svm/svm_fifo.h
+++ b/src/svm/svm_fifo.h
@@ -295,7 +295,7 @@ void svm_fifo_enqueue_nocopy (svm_fifo_t * f, u32 len);
* Overwrite fifo head with new data
*
* This should be typically used by dgram transport protocols that need
- * to update the dgram header after dequeueing a chunk of data. It assumes
+ * to update the dgram header after dequeuing a chunk of data. It assumes
* that the dgram header is at most spread over two chunks.
*
* @param f fifo
@@ -307,7 +307,9 @@ void svm_fifo_overwrite_head (svm_fifo_t * f, u8 * src, u32 len);
* Dequeue data from fifo
*
* Data is dequeued to consumer provided buffer and head is atomically
- * updated.
+ * updated. This should not be used in combination with ooo lookups. If
+ * ooo peeking of data is needed in combination with dequeuing use @ref
+ * svm_fifo_dequeue_drop.
*
* @param f fifo
* @param len length of data to dequeue