Skip to content

Commit

Permalink
Add downstream fix for UDP buffer chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan4th committed Apr 8, 2021
1 parent 6214489 commit 861eeb3
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions vpp-patches/0013-session-fix-populating-chained-buffers.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From bbee13b6f04515ee42f066f3f0bfc6b675b5a9a3 Mon Sep 17 00:00:00 2001
From: Ivan Shvedunov <[email protected]>
Date: Mon, 15 Mar 2021 19:05:14 +0300
Subject: [PATCH] session: fix populating chained buffers

Type: fix

Signed-off-by: Ivan Shvedunov <[email protected]>
Change-Id: I3fdc1711d508bc5b0c2f56b3bd3fb4a56056eb54
---
src/vnet/session/session_node.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 2fde85b03..0add12b97 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -630,16 +630,18 @@ session_tx_fifo_chain_tail (vlib_main_t * vm, session_tx_context_t * ctx,
svm_fifo_t *f = ctx->s->tx_fifo;
session_dgram_hdr_t *hdr = &ctx->hdr;
u16 deq_now;
+ u32 offset;
+
deq_now = clib_min (hdr->data_length - hdr->data_offset,
len_to_deq);
- n_bytes_read = svm_fifo_peek (f, hdr->data_offset, deq_now,
- data);
+ offset = hdr->data_offset + SESSION_CONN_HDR_LEN;
+ n_bytes_read = svm_fifo_peek (f, offset, deq_now, data);
ASSERT (n_bytes_read > 0);

hdr->data_offset += n_bytes_read;
if (hdr->data_offset == hdr->data_length)
{
- u32 offset = hdr->data_length + SESSION_CONN_HDR_LEN;
+ offset = hdr->data_length + SESSION_CONN_HDR_LEN;
svm_fifo_dequeue_drop (f, offset);
if (ctx->left_to_snd > n_bytes_read)
svm_fifo_peek (ctx->s->tx_fifo, 0, sizeof (ctx->hdr),
--
2.30.2

0 comments on commit 861eeb3

Please sign in to comment.