network: tc: use request queue to configure traffic control
But no dependency resolution is implemented.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "networkd-routing-policy-rule.h"
|
||||
#include "networkd-queue.h"
|
||||
#include "networkd-setlink.h"
|
||||
#include "tc.h"
|
||||
|
||||
static void request_free_object(RequestType type, void *object) {
|
||||
switch (type) {
|
||||
@@ -58,6 +59,10 @@ static void request_free_object(RequestType type, void *object) {
|
||||
break;
|
||||
case REQUEST_TYPE_SET_LINK:
|
||||
case REQUEST_TYPE_STACKED_NETDEV:
|
||||
break;
|
||||
case REQUEST_TYPE_TRAFFIC_CONTROL:
|
||||
traffic_control_free(object);
|
||||
break;
|
||||
case REQUEST_TYPE_UP_DOWN:
|
||||
break;
|
||||
default:
|
||||
@@ -143,6 +148,9 @@ static void request_hash_func(const Request *req, struct siphash *state) {
|
||||
case REQUEST_TYPE_SET_LINK:
|
||||
trivial_hash_func(req->set_link_operation_ptr, state);
|
||||
break;
|
||||
case REQUEST_TYPE_TRAFFIC_CONTROL:
|
||||
traffic_control_hash_func(req->traffic_control, state);
|
||||
break;
|
||||
case REQUEST_TYPE_UP_DOWN:
|
||||
break;
|
||||
default:
|
||||
@@ -196,6 +204,8 @@ static int request_compare_func(const struct Request *a, const struct Request *b
|
||||
return routing_policy_rule_compare_func(a->rule, b->rule);
|
||||
case REQUEST_TYPE_SET_LINK:
|
||||
return trivial_compare_func(a->set_link_operation_ptr, b->set_link_operation_ptr);
|
||||
case REQUEST_TYPE_TRAFFIC_CONTROL:
|
||||
return traffic_control_compare_func(a->traffic_control, b->traffic_control);
|
||||
case REQUEST_TYPE_UP_DOWN:
|
||||
return 0;
|
||||
default:
|
||||
@@ -241,7 +251,8 @@ int link_queue_request(
|
||||
REQUEST_TYPE_DHCP4_CLIENT,
|
||||
REQUEST_TYPE_DHCP6_CLIENT,
|
||||
REQUEST_TYPE_NDISC,
|
||||
REQUEST_TYPE_RADV) ||
|
||||
REQUEST_TYPE_RADV,
|
||||
REQUEST_TYPE_TRAFFIC_CONTROL) ||
|
||||
netlink_handler);
|
||||
|
||||
req = new(Request, 1);
|
||||
@@ -347,6 +358,9 @@ int manager_process_requests(sd_event_source *s, void *userdata) {
|
||||
case REQUEST_TYPE_STACKED_NETDEV:
|
||||
r = request_process_stacked_netdev(req);
|
||||
break;
|
||||
case REQUEST_TYPE_TRAFFIC_CONTROL:
|
||||
r = request_process_traffic_control(req);
|
||||
break;
|
||||
case REQUEST_TYPE_UP_DOWN:
|
||||
r = request_process_link_up_or_down(req);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user