summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_output.c
diff options
context:
space:
mode:
authorSimon Zhang <yuwei1.zhang@intel.com>2019-09-24 21:16:56 +0800
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-10-22 11:18:01 +0000
commit4ac265adc6560ae19b3877ef1b61ac0b2ad703e2 (patch)
tree74dad0c5a3e093685d672fa38a4ea7d9e1cd282b /src/vnet/tcp/tcp_output.c
parentbe2d536f87e996ba0067af0ea5fab6dd45d20822 (diff)
tcp: fix tso not work in single buffer issue
Type: fix Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com> Change-Id: Iddb6fd41812e8c97af58859ef43279cfc0f9d1df Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com> (cherry picked from commit 8a047ed741072bdb8d93b0841473eae06ae3c9d0)
Diffstat (limited to 'src/vnet/tcp/tcp_output.c')
-rw-r--r--src/vnet/tcp/tcp_output.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index 081a6bf521a..a7b0e398d36 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -2261,13 +2261,16 @@ tcp_output_push_ip (vlib_main_t * vm, vlib_buffer_t * b0,
always_inline void
tcp_check_if_gso (tcp_connection_t * tc, vlib_buffer_t * b)
{
- if (PREDICT_TRUE (!(b->flags & VLIB_BUFFER_TOTAL_LENGTH_VALID)))
+ if (!tc->is_tso)
return;
- u16 data_len =
- b->current_length + b->total_length_not_including_first_buffer -
- sizeof (tcp_header_t) - tc->snd_opts_len;
+ u16 data_len = b->current_length - sizeof (tcp_header_t) - tc->snd_opts_len;
- if (data_len > tc->snd_mss)
+ if (PREDICT_FALSE (b->flags & VLIB_BUFFER_TOTAL_LENGTH_VALID))
+ data_len += b->total_length_not_including_first_buffer;
+
+ if (PREDICT_TRUE (data_len <= tc->snd_mss))
+ return;
+ else
{
ASSERT ((b->flags & VNET_BUFFER_F_L3_HDR_OFFSET_VALID) != 0);
ASSERT ((b->flags & VNET_BUFFER_F_L4_HDR_OFFSET_VALID) != 0);