summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2020-12-19 15:46:39 +0100
committerSander Vrijders <sander@ouroboros.rocks>2020-12-20 13:36:44 +0100
commitba6025c9ee7049fbc8ac91b5a1c91a853c4faccb (patch)
tree007f96653db9f0bc85182f406bdf111c6d98fdd3
parent5a26b4822380f8b8aed83937237fa0217b0a8b41 (diff)
downloadouroboros-ba6025c9ee7049fbc8ac91b5a1c91a853c4faccb.zip
ouroboros-ba6025c9ee7049fbc8ac91b5a1c91a853c4faccb.tar.gz
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 <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
-rw-r--r--src/ipcpd/unicast/ca.c3
-rw-r--r--src/ipcpd/unicast/ca.h2
-rw-r--r--src/ipcpd/unicast/dt.c4
-rw-r--r--src/ipcpd/unicast/pol-ca-ops.h1
-rw-r--r--src/ipcpd/unicast/pol/ca-mb-ecn.c2
-rw-r--r--src/ipcpd/unicast/pol/ca-mb-ecn.h1
-rw-r--r--src/ipcpd/unicast/pol/ca-nop.c2
-rw-r--r--src/ipcpd/unicast/pol/ca-nop.h1
8 files changed, 13 insertions, 3 deletions
diff --git a/src/ipcpd/unicast/ca.c b/src/ipcpd/unicast/ca.c
index 3add2a7..f5bbdc7 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 0604a16..567909c 100644
--- a/src/ipcpd/unicast/ca.h
+++ b/src/ipcpd/unicast/ca.h
@@ -24,6 +24,7 @@
#define OUROBOROS_IPCPD_UNICAST_CA_H
#include <ouroboros/ipcp.h>
+#include <ouroboros/qoscube.h>
#include <stdbool.h>
#include <sys/types.h>
@@ -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 1360371..92c0f27 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 1e7c48b..13e3967 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 9560e21..75adba1 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 30dba4a..e22c738 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 ce210cf..a75174c 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 859b52d..cda9f0b 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;