From 4e3060a26be2efe87e040eef7be2199170a2d3e9 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Fri, 18 Sep 2020 10:39:17 +0300 Subject: [PATCH] net: tcp2: Retrigger resend if sending window is full If we try to send data but the sending window is full, then try to kick the resend of the pending data. Signed-off-by: Jukka Rissanen --- subsys/net/ip/tcp2.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/subsys/net/ip/tcp2.c b/subsys/net/ip/tcp2.c index 727de5cbe42..3180d69315d 100644 --- a/subsys/net/ip/tcp2.c +++ b/subsys/net/ip/tcp2.c @@ -1434,6 +1434,13 @@ int net_tcp_queue_data(struct net_context *context, struct net_pkt *pkt) k_mutex_lock(&conn->lock, K_FOREVER); if (tcp_window_full(conn)) { + /* Trigger resend if the timer is not active */ + if (!k_delayed_work_remaining_get(&conn->send_data_timer)) { + NET_DBG("Window full, trigger resend"); + tcp_resend_data( + (struct k_work *)&conn->send_data_timer); + } + ret = -EAGAIN; goto out; }