network: move link_configure_traffic_control()
This commit is contained in:
parent
34d7f2c99e
commit
200543791a
|
@ -2240,27 +2240,6 @@ static int link_drop_config(Link *link) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int link_configure_traffic_control(Link *link) {
|
|
||||||
TrafficControl *tc;
|
|
||||||
int r;
|
|
||||||
|
|
||||||
link->tc_configured = false;
|
|
||||||
link->tc_messages = 0;
|
|
||||||
|
|
||||||
ORDERED_HASHMAP_FOREACH(tc, link->network->tc_by_section) {
|
|
||||||
r = traffic_control_configure(link, tc);
|
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (link->tc_messages == 0)
|
|
||||||
link->tc_configured = true;
|
|
||||||
else
|
|
||||||
log_link_debug(link, "Configuring traffic control");
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int link_configure_sr_iov(Link *link) {
|
static int link_configure_sr_iov(Link *link) {
|
||||||
SRIOV *sr_iov;
|
SRIOV *sr_iov;
|
||||||
int r;
|
int r;
|
||||||
|
|
|
@ -21,7 +21,7 @@ void traffic_control_free(TrafficControl *tc) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int traffic_control_configure(Link *link, TrafficControl *tc) {
|
static int traffic_control_configure(Link *link, TrafficControl *tc) {
|
||||||
assert(link);
|
assert(link);
|
||||||
assert(tc);
|
assert(tc);
|
||||||
|
|
||||||
|
@ -35,6 +35,27 @@ int traffic_control_configure(Link *link, TrafficControl *tc) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int link_configure_traffic_control(Link *link) {
|
||||||
|
TrafficControl *tc;
|
||||||
|
int r;
|
||||||
|
|
||||||
|
link->tc_configured = false;
|
||||||
|
link->tc_messages = 0;
|
||||||
|
|
||||||
|
ORDERED_HASHMAP_FOREACH(tc, link->network->tc_by_section) {
|
||||||
|
r = traffic_control_configure(link, tc);
|
||||||
|
if (r < 0)
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (link->tc_messages == 0)
|
||||||
|
link->tc_configured = true;
|
||||||
|
else
|
||||||
|
log_link_debug(link, "Configuring traffic control");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int traffic_control_section_verify(TrafficControl *tc, bool *qdisc_has_root, bool *qdisc_has_clsact) {
|
int traffic_control_section_verify(TrafficControl *tc, bool *qdisc_has_root, bool *qdisc_has_clsact) {
|
||||||
assert(tc);
|
assert(tc);
|
||||||
|
|
||||||
|
|
|
@ -28,5 +28,5 @@ typedef struct TrafficControl {
|
||||||
#define TC(tc) (&(tc)->meta)
|
#define TC(tc) (&(tc)->meta)
|
||||||
|
|
||||||
void traffic_control_free(TrafficControl *tc);
|
void traffic_control_free(TrafficControl *tc);
|
||||||
int traffic_control_configure(Link *link, TrafficControl *tc);
|
int link_configure_traffic_control(Link *link);
|
||||||
int traffic_control_section_verify(TrafficControl *tc, bool *qdisc_has_root, bool *qdisc_has_clsact);
|
int traffic_control_section_verify(TrafficControl *tc, bool *qdisc_has_root, bool *qdisc_has_clsact);
|
||||||
|
|
Loading…
Reference in New Issue