1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00

network: move link_configure_traffic_control()

This commit is contained in:
Yu Watanabe 2020-10-02 17:45:37 +09:00
parent 34d7f2c99e
commit 200543791a
3 changed files with 23 additions and 23 deletions

View File

@ -2240,27 +2240,6 @@ static int link_drop_config(Link *link) {
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) {
SRIOV *sr_iov;
int r;

View File

@ -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(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) {
assert(tc);

View File

@ -28,5 +28,5 @@ typedef struct TrafficControl {
#define TC(tc) (&(tc)->meta)
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);