aboutsummaryrefslogtreecommitdiffstats
path: root/src/svm/svm_fifo.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-05-04 15:46:57 -0700
committerDave Barach <openvpp@barachs.net>2018-05-09 11:34:06 +0000
commit8e43d04ca4f4496aaefc4f5e2b6e1c0951624099 (patch)
tree3addc5766002d5224dde2c7fa4efe018480830e4 /src/svm/svm_fifo.c
parentee7f0bd9e7ce4106d3b9511b0efede4326bded51 (diff)
session: cleanup session tx function
- rework the function to declutter and avoid building more than one tx frame - add dual loop although benefits in my tests seem to be minimal - improve tcp/udp echo external apps. They have slightly better throughput than internal echo apps. - udp bugfixes Change-Id: Iea4a245b1b1bb407a7f403dedcce2664a49f774b Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/svm/svm_fifo.c')
-rw-r--r--src/svm/svm_fifo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/svm/svm_fifo.c b/src/svm/svm_fifo.c
index 3552192a768..dbdb813a7df 100644
--- a/src/svm/svm_fifo.c
+++ b/src/svm/svm_fifo.c
@@ -622,14 +622,14 @@ void
svm_fifo_overwrite_head (svm_fifo_t * f, u8 * data, u32 len)
{
u32 first_chunk;
+ first_chunk = f->nitems - f->head;
ASSERT (len <= f->nitems);
- if (len < f->nitems - f->head)
+ if (len <= first_chunk)
clib_memcpy (&f->data[f->head], data, len);
else
{
- first_chunk = len - (f->nitems - f->head);
clib_memcpy (&f->data[f->head], data, first_chunk);
- clib_memcpy (f->data, data + first_chunk, len - first_chunk);
+ clib_memcpy (&f->data[0], data + first_chunk, len - first_chunk);
}
}