From b066b8aa71be68586e7dd88fcb530733536aa30b Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Tue, 20 Jul 2021 18:42:37 +0200 Subject: ipcpd: Fix additive increase in CA-MB-ECN The logic for additive increase was botched. It was adding to the current window limit, and to avoid a count-to-infinity when sending below the limit, I added a check that the application was trying to send more than the current limit. This fails in congestion avoidance mode when the IPCP is throttling traffic below the limit; causing the app to never increase the congestion window (and even worse, to keep decreasing in some cases). The Additive Increase will now always add bandwidth to the latest sending rate instead of the window bandwidth limit, avoiding all the problems. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/unicast/pol/ca-mb-ecn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipcpd/unicast/pol/ca-mb-ecn.c b/src/ipcpd/unicast/pol/ca-mb-ecn.c index a2454072..6cf140f5 100644 --- a/src/ipcpd/unicast/pol/ca-mb-ecn.c +++ b/src/ipcpd/unicast/pol/ca-mb-ecn.c @@ -135,8 +135,8 @@ ca_wnd_t mb_ecn_ctx_update_snd(void * _ctx, if (ctx->tx_ece) /* Mult. Decrease */ ctx->tx_wbl -= (ctx->tx_wbl * ctx->tx_ece) >> (CA_SHFT + 8); - else if (ctx->tx_wbc > ctx->tx_wbl) /* Add. Increase */ - ctx->tx_wbl = ctx->tx_wbl + ctx->tx_inc; + else /* Add. Increase */ + ctx->tx_wbl = ctx->tx_wbc + ctx->tx_inc; } /* Window scaling */ -- cgit v1.2.3