From 8e43d04ca4f4496aaefc4f5e2b6e1c0951624099 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Fri, 4 May 2018 15:46:57 -0700 Subject: 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 --- src/svm/svm_fifo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/svm') 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); } } -- cgit 1.2.3-korg