summaryrefslogtreecommitdiffstats
path: root/src/network/tc/sfb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/tc/sfb.c')
-rw-r--r--src/network/tc/sfb.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/network/tc/sfb.c b/src/network/tc/sfb.c
index a4ca4884b1..88b3ce55bd 100644
--- a/src/network/tc/sfb.c
+++ b/src/network/tc/sfb.c
@@ -13,7 +13,15 @@
static int stochastic_fair_blue_fill_message(Link *link, QDisc *qdisc, sd_netlink_message *req) {
StochasticFairBlue *sfb;
- struct tc_sfb_qopt opt = {
+ int r;
+
+ assert(link);
+ assert(qdisc);
+ assert(req);
+
+ assert_se(sfb = SFB(qdisc));
+
+ const struct tc_sfb_qopt opt = {
.rehash_interval = 600*1000,
.warmup_time = 60*1000,
.penalty_rate = 10,
@@ -22,28 +30,20 @@ static int stochastic_fair_blue_fill_message(Link *link, QDisc *qdisc, sd_netlin
.decrement = (SFB_MAX_PROB + 10000) / 20000,
.max = 25,
.bin_size = 20,
+ .limit = sfb->packet_limit,
};
- int r;
-
- assert(link);
- assert(qdisc);
- assert(req);
-
- sfb = SFB(qdisc);
-
- opt.limit = sfb->packet_limit;
r = sd_netlink_message_open_container_union(req, TCA_OPTIONS, "sfb");
if (r < 0)
- return log_link_error_errno(link, r, "Could not open container TCA_OPTIONS: %m");
+ return r;
- r = sd_netlink_message_append_data(req, TCA_SFB_PARMS, &opt, sizeof(struct tc_sfb_qopt));
+ r = sd_netlink_message_append_data(req, TCA_SFB_PARMS, &opt, sizeof(opt));
if (r < 0)
- return log_link_error_errno(link, r, "Could not append TCA_SFB_PARMS attribute: %m");
+ return r;
r = sd_netlink_message_close_container(req);
if (r < 0)
- return log_link_error_errno(link, r, "Could not close container TCA_OPTIONS: %m");
+ return r;
return 0;
}