aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/gso
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2019-12-25 00:12:52 +0100
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-01-02 12:50:19 +0000
commit222b709ad97a837b59703c64cfac317f22fa1b46 (patch)
tree5ab16b9548faeef9fc2a85d65484c5b1f88a66db /src/vnet/gso
parent7ade2f51ada560c37d8ac4760f232379deb0afc5 (diff)
gso: fix number of buffers required for segmentation
Type: fix Change-Id: I73ef0ce81b2d6a799f6a6e59908ec24cc2290a2c Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/gso')
-rw-r--r--src/vnet/gso/node.c7
1 files changed, 4 insertions, 3 deletions
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]);