From 132d2145a6e89ac0f4454ba7f257a910da2ef674 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Thu, 10 Dec 2020 18:11:20 +0100 Subject: ipcpd: Pass previous ECN value in congestion API The previous value of the ECN field should be passed to the congestion notification function. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/unicast/pol/ca-mb-ecn.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/ipcpd/unicast/pol/ca-mb-ecn.c') diff --git a/src/ipcpd/unicast/pol/ca-mb-ecn.c b/src/ipcpd/unicast/pol/ca-mb-ecn.c index 1baaca7a..1791e42a 100644 --- a/src/ipcpd/unicast/pol/ca-mb-ecn.c +++ b/src/ipcpd/unicast/pol/ca-mb-ecn.c @@ -222,8 +222,9 @@ void mb_ecn_ctx_update_ece(void * _ctx, ctx->tx_cav = true; } -uint8_t mb_ecn_calc_ecn(int fd, - size_t len) +int mb_ecn_calc_ecn(int fd, + uint8_t * ecn, + size_t len) { size_t q; @@ -231,7 +232,9 @@ uint8_t mb_ecn_calc_ecn(int fd, q = ipcp_flow_queued(fd); - return (uint8_t) (q >> ECN_Q_SHFT); + *ecn |= (uint8_t) (q >> ECN_Q_SHFT); + + return 0; } ssize_t mb_ecn_print_stats(void * _ctx, -- cgit v1.2.3