From 222b709ad97a837b59703c64cfac317f22fa1b46 Mon Sep 17 00:00:00 2001 From: Mohsin Kazmi Date: Wed, 25 Dec 2019 00:12:52 +0100 Subject: gso: fix number of buffers required for segmentation Type: fix Change-Id: I73ef0ce81b2d6a799f6a6e59908ec24cc2290a2c Signed-off-by: Mohsin Kazmi --- src/vnet/gso/node.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/vnet/gso/node.c b/src/vnet/gso/node.c index d7248c90147..a48a8b69a23 100644 --- a/src/vnet/gso/node.c +++ b/src/vnet/gso/node.c @@ -55,10 +55,11 @@ static_always_inline u16 tso_alloc_tx_bufs (vlib_main_t * vm, vnet_interface_per_thread_data_t * ptd, vlib_buffer_t * b0, u32 n_bytes_b0, u16 l234_sz, - u16 gso_size) + u16 gso_size, gso_header_offset_t * gho) { u16 size = - clib_min (gso_size, vlib_buffer_get_default_data_size (vm) - l234_sz); + clib_min (gso_size, vlib_buffer_get_default_data_size (vm) - l234_sz + - gho->l2_hdr_offset); /* rounded-up division */ u16 n_bufs = (n_bytes_b0 - l234_sz + (size - 1)) / size; @@ -170,7 +171,7 @@ tso_segment_buffer (vlib_main_t * vm, vnet_interface_per_thread_data_t * ptd, next_tcp_seq += first_data_size; if (PREDICT_FALSE - (!tso_alloc_tx_bufs (vm, ptd, sb0, n_bytes_b0, l234_sz, gso_size))) + (!tso_alloc_tx_bufs (vm, ptd, sb0, n_bytes_b0, l234_sz, gso_size, gho))) return 0; vlib_buffer_t *b0 = vlib_get_buffer (vm, ptd->split_buffers[0]); -- cgit 1.2.3-korg