From ba6025c9ee7049fbc8ac91b5a1c91a853c4faccb Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 19 Dec 2020 15:46:39 +0100 Subject: ipcpd: Pass qoscube to ECN marking function The ECN marking function should be able to use the packet QoS to allow prioritizing traffic under congestion. Not yet implemented in MB-ECN. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/unicast/ca.c | 3 ++- src/ipcpd/unicast/ca.h | 2 ++ src/ipcpd/unicast/dt.c | 4 ++-- src/ipcpd/unicast/pol-ca-ops.h | 1 + src/ipcpd/unicast/pol/ca-mb-ecn.c | 2 ++ src/ipcpd/unicast/pol/ca-mb-ecn.h | 1 + src/ipcpd/unicast/pol/ca-nop.c | 2 ++ src/ipcpd/unicast/pol/ca-nop.h | 1 + 8 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ipcpd/unicast/ca.c b/src/ipcpd/unicast/ca.c index 3add2a7d..f5bbdc7e 100644 --- a/src/ipcpd/unicast/ca.c +++ b/src/ipcpd/unicast/ca.c @@ -94,9 +94,10 @@ void ca_wnd_wait(ca_wnd_t wnd) int ca_calc_ecn(int fd, uint8_t * ecn, + qoscube_t qc, size_t len) { - return ca.ops->calc_ecn(fd, ecn, len); + return ca.ops->calc_ecn(fd, ecn, qc, len); } ssize_t ca_print_stats(void * ctx, diff --git a/src/ipcpd/unicast/ca.h b/src/ipcpd/unicast/ca.h index 0604a161..567909c8 100644 --- a/src/ipcpd/unicast/ca.h +++ b/src/ipcpd/unicast/ca.h @@ -24,6 +24,7 @@ #define OUROBOROS_IPCPD_UNICAST_CA_H #include +#include #include #include @@ -57,6 +58,7 @@ void ca_wnd_wait(ca_wnd_t wnd); int ca_calc_ecn(int fd, uint8_t * ecn, + qoscube_t qc, size_t len); ssize_t ca_print_stats(void * ctx, diff --git a/src/ipcpd/unicast/dt.c b/src/ipcpd/unicast/dt.c index 1360371a..92c0f270 100644 --- a/src/ipcpd/unicast/dt.c +++ b/src/ipcpd/unicast/dt.c @@ -480,7 +480,7 @@ static void packet_handler(int fd, return; } - (void) ca_calc_ecn(ofd, head + dt_pci_info.ecn_o, len); + (void) ca_calc_ecn(ofd, head + dt_pci_info.ecn_o, qc, len); ret = ipcp_flow_write(ofd, sdb); if (ret < 0) { @@ -816,7 +816,7 @@ int dt_write_packet(uint64_t dst_addr, dt_pci.eid = eid; dt_pci.ecn = 0; - (void) ca_calc_ecn(fd, &dt_pci.ecn, len); + (void) ca_calc_ecn(fd, &dt_pci.ecn, qc, len); dt_pci_ser(head, &dt_pci); diff --git a/src/ipcpd/unicast/pol-ca-ops.h b/src/ipcpd/unicast/pol-ca-ops.h index 1e7c48b9..13e39673 100644 --- a/src/ipcpd/unicast/pol-ca-ops.h +++ b/src/ipcpd/unicast/pol-ca-ops.h @@ -45,6 +45,7 @@ struct pol_ca_ops { int (* calc_ecn)(int fd, uint8_t * ecn, + qoscube_t qc, size_t len); /* Optional, can be NULL */ diff --git a/src/ipcpd/unicast/pol/ca-mb-ecn.c b/src/ipcpd/unicast/pol/ca-mb-ecn.c index 9560e211..75adba11 100644 --- a/src/ipcpd/unicast/pol/ca-mb-ecn.c +++ b/src/ipcpd/unicast/pol/ca-mb-ecn.c @@ -220,11 +220,13 @@ void mb_ecn_ctx_update_ece(void * _ctx, int mb_ecn_calc_ecn(int fd, uint8_t * ecn, + qoscube_t qc, size_t len) { size_t q; (void) len; + (void) qc; q = ipcp_flow_queued(fd); diff --git a/src/ipcpd/unicast/pol/ca-mb-ecn.h b/src/ipcpd/unicast/pol/ca-mb-ecn.h index 30dba4a2..e22c7381 100644 --- a/src/ipcpd/unicast/pol/ca-mb-ecn.h +++ b/src/ipcpd/unicast/pol/ca-mb-ecn.h @@ -44,6 +44,7 @@ void mb_ecn_wnd_wait(ca_wnd_t wnd); int mb_ecn_calc_ecn(int fd, uint8_t * ecn, + qoscube_t qc, size_t len); ssize_t mb_ecn_print_stats(void * ctx, diff --git a/src/ipcpd/unicast/pol/ca-nop.c b/src/ipcpd/unicast/pol/ca-nop.c index ce210cfb..a75174c6 100644 --- a/src/ipcpd/unicast/pol/ca-nop.c +++ b/src/ipcpd/unicast/pol/ca-nop.c @@ -86,11 +86,13 @@ void nop_ctx_update_ece(void * ctx, int nop_calc_ecn(int fd, uint8_t * ecn, + qoscube_t qc, size_t len) { (void) fd; (void) len; (void) ecn; + (void) qc; return 0; } diff --git a/src/ipcpd/unicast/pol/ca-nop.h b/src/ipcpd/unicast/pol/ca-nop.h index 859b52dc..cda9f0b1 100644 --- a/src/ipcpd/unicast/pol/ca-nop.h +++ b/src/ipcpd/unicast/pol/ca-nop.h @@ -44,6 +44,7 @@ void nop_wnd_wait(ca_wnd_t wnd); int nop_calc_ecn(int fd, uint8_t * ecn, + qoscube_t qc, size_t len); extern struct pol_ca_ops nop_ca_ops; -- cgit v1.2.3