summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/interface_output.c')
-rw-r--r--src/vnet/interface_output.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vnet/interface_output.c b/src/vnet/interface_output.c
index 60953b0f35a..21a1f84b36e 100644
--- a/src/vnet/interface_output.c
+++ b/src/vnet/interface_output.c
@@ -235,8 +235,11 @@ tso_alloc_tx_bufs (vlib_main_t * vm,
vlib_buffer_t * b0, u32 n_bytes_b0, u16 l234_sz,
u16 gso_size)
{
+ u16 size =
+ clib_min (gso_size, vlib_buffer_get_default_data_size (vm) - l234_sz);
+
/* rounded-up division */
- u16 n_bufs = (n_bytes_b0 - l234_sz + (gso_size - 1)) / gso_size;
+ u16 n_bufs = (n_bytes_b0 - l234_sz + (size - 1)) / size;
u16 n_alloc;
ASSERT (n_bufs > 0);