summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-05-02 12:40:39 -0700
committerDave Barach <openvpp@barachs.net>2017-05-02 21:52:56 +0000
commit4269098e14603e38936ea7351705373ad55c08a7 (patch)
tree52fd936551278b3eacc51d4022c4e3f753119a77 /src/vnet
parentf3bcdbf071c98ed676591bd22c3d3f8601009fa8 (diff)
Fix TCP tx when snd_wnd < smss
Fixes VPP-728, VPP-729, VPP-730 Change-Id: Ie8c6c0dd006f98527525e87d19b508bb8d39db69 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/tcp/tcp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index 245a35aba2f..de4edfa6b22 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -573,7 +573,7 @@ tcp_session_send_mss (transport_connection_t * trans_conn)
u32
tcp_session_send_space (transport_connection_t * trans_conn)
{
- u32 snd_space;
+ u32 snd_space, chunk;
tcp_connection_t *tc = (tcp_connection_t *) trans_conn;
/* If we haven't gotten dupacks or if we did and have gotten sacked bytes
@@ -582,14 +582,15 @@ tcp_session_send_space (transport_connection_t * trans_conn)
&& (tc->rcv_dupacks == 0
|| tc->sack_sb.last_sacked_bytes)))
{
+ chunk = tc->snd_wnd > tc->snd_mss ? tc->snd_mss : tc->snd_wnd;
snd_space = tcp_available_snd_space (tc);
/* If we can't write at least a segment, don't try at all */
- if (snd_space < tc->snd_mss)
+ if (chunk == 0 || snd_space < chunk)
return 0;
/* round down to mss multiple */
- return snd_space - (snd_space % tc->snd_mss);
+ return snd_space - (snd_space % chunk);
}
/* If in fast recovery, send 1 SMSS if wnd allows */