summaryrefslogtreecommitdiffstats
path: root/src/svm/svm_fifo.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-08-18 19:28:03 -0700
committerDave Barach <openvpp@barachs.net>2017-08-25 16:39:42 +0000
commit1f152cd6faf96b524b6b7071b5cffe1916f9c5cc (patch)
treeb778792a51e949cd1133b5ca03e5645538e6cf1a /src/svm/svm_fifo.c
parent27de761048e561f849fdda690d69e5644a9360d4 (diff)
tcp: retransmit and multi-buffer segment fixes and improvements
- set session state as closed on session manager delete - enable retransmit as opposed to persist timer after persist timer completes - properly discard buffer chain bytes when new data overlaps ooo segments - don't use rxt bytes in snd space estimate used on tx path Change-Id: Id9cab686e532e5fe70c775d5440260e8eb890a9f Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/svm/svm_fifo.c')
-rw-r--r--src/svm/svm_fifo.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/svm/svm_fifo.c b/src/svm/svm_fifo.c
index 7f8127cfa69..8fe82f56abd 100644
--- a/src/svm/svm_fifo.c
+++ b/src/svm/svm_fifo.c
@@ -53,10 +53,12 @@ ooo_segment_end_pos (svm_fifo_t * f, ooo_segment_t * s)
u8 *
format_ooo_segment (u8 * s, va_list * args)
{
+ svm_fifo_t *f = va_arg (*args, svm_fifo_t *);
ooo_segment_t *seg = va_arg (*args, ooo_segment_t *);
-
- s = format (s, "pos %u, len %u, next %d, prev %d",
- seg->start, seg->length, seg->next, seg->prev);
+ u32 normalized_start = (seg->start + f->nitems - f->tail) % f->nitems;
+ s = format (s, "[%u, %u], len %u, next %d, prev %d", normalized_start,
+ (normalized_start + seg->length) % f->nitems, seg->length,
+ seg->next, seg->prev);
return s;
}
@@ -154,7 +156,7 @@ format_ooo_list (u8 * s, va_list * args)
while (ooo_segment_index != OOO_SEGMENT_INVALID_INDEX)
{
seg = pool_elt_at_index (f->ooo_segments, ooo_segment_index);
- s = format (s, " %U\n", format_ooo_segment, seg);
+ s = format (s, " %U\n", format_ooo_segment, f, seg);
ooo_segment_index = seg->next;
}
@@ -557,7 +559,6 @@ svm_fifo_enqueue_with_offset_internal (svm_fifo_t * f,
{
u32 total_copy_bytes, first_copy_bytes, second_copy_bytes;
u32 cursize, nitems, normalized_offset;
- u32 offset_from_tail;
f->ooos_newest = OOO_SEGMENT_INVALID_INDEX;
@@ -570,8 +571,7 @@ svm_fifo_enqueue_with_offset_internal (svm_fifo_t * f,
normalized_offset = (f->tail + offset) % nitems;
/* Will this request fit? */
- offset_from_tail = (nitems + normalized_offset - f->tail) % nitems;
- if ((required_bytes + offset_from_tail) > (nitems - cursize))
+ if ((required_bytes + offset) > (nitems - cursize))
return -1;
svm_fifo_trace_add (f, offset, required_bytes, 1);