diff options
authorMariusz Drost <mariuszx.drost@intel.com>2020-03-11 13:34:34 +0000
committerMariusz Drost <mariuszx.drost@intel.com>2020-03-11 14:41:55 +0000
commit71ba97fe8ee93aa2bb17e774c1d73c6e58c03b2b (patch)
parentdb273c223d19def56728fb3a2b3d41885da5065d (diff)
l4p/tcp: Reset wscale when timestamp is not set
wscale value calculation and handling is tightly coupled with timestamp value. When timestamp sending is off on the other end of the connection, wscale is being wrongly calculated, which leads to traffic being stuck. To overcome that issue, wscale value needs to be reset during handshake when timestamps are off. It results with slower connection, but traffic is sustained. Here are ofo/lost segment test script results, which were run with and without timestamps set. Test Protocol File Status Time Time timestmaps on timestamps off Reorder 4 ipv4 8MB [OK] 1m12.594s 0m58.419s Reorder 9 ipv4 8MB [OK] 0m27.260s 0m31.142s Reorder 4 ipv4 8MB [OK] 0m58.093s 1m34.772s Reorder 9 ipv4 8MB [OK] 0m28.798s 0m34.016s Loss 0 ipv4 8MB [OK] 0m0.047s 0m0.046s Loss 20 ipv4 8MB [OK] 2m34.807s 2m20.491s Loss 0 ipv4 8MB [OK] 0m0.047s 0m0.047s Loss 20 ipv4 8MB [OK] 0m57.360s 2m15.736s Reorder 4 ipv6 8MB [OK] 1m0.237s 0m46.347s Reorder 9 ipv6 8MB [OK] 0m25.977s 0m32.035s Reorder 4 ipv6 8MB [OK] 0m53.248s 0m50.953s Reorder 9 ipv6 8MB [OK] 0m26.501s 0m29.248s Loss 0 ipv6 8MB [OK] 0m0.044s 0m0.042s Loss 20 ipv6 8MB [OK] 1m0.388s 2m14.005s Loss 0 ipv6 8MB [OK] 0m0.045s 0m0.042s Loss 20 ipv6 8MB [OK] 0m58.344s 2m1.191s Signed-off-by: Mariusz Drost <mariuszx.drost@intel.com> Change-Id: Id89823409e5e6a87722689d0c2322de7ef0f6cf9
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libtle_l4p/tcp_rxtx.c b/lib/libtle_l4p/tcp_rxtx.c
index b71a565..b4bc626 100644
--- a/lib/libtle_l4p/tcp_rxtx.c
+++ b/lib/libtle_l4p/tcp_rxtx.c
@@ -653,6 +653,10 @@ sync_ack(struct tle_tcp_stream *s, const union pkt_info *pi,
m->l2_len + m->l3_len);
get_syn_opts(&s->tcb.so, (uintptr_t)(th + 1), m->l4_len - sizeof(*th));
+ /* reset wscale option if timestamp is not present */
+ if (s->tcb.so.ts.val == 0)
+ s->tcb.so.wscale = 0;
s->tcb.rcv.nxt = si->seq + 1;
seq = sync_gen_seq(pi, s->tcb.rcv.nxt, ts, s->tcb.so.mss,