From d0d35aa278da490408f33ee90e30d556e22bc647 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Thu, 18 Jun 2020 13:28:53 +0200 Subject: [PATCH] platform: support creation of prio qdisc Support the creation of parameterless 'prio' qdiscs. The kernel needs a TCA_OPTIONS attribute initialized with default values. We currently don't support modifying the qdisc parameters. --- src/platform/nm-linux-platform.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index a0edd13c9e..40451df820 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -4757,6 +4757,10 @@ _nl_msg_new_qdisc (int nlmsg_type, NLA_PUT_U32 (msg, TCA_TBF_BURST, qdisc->tbf.burst); nla_nest_end (msg, tc_options); + } else if (nm_streq (qdisc->kind, "prio")) { + struct tc_prio_qopt opt = {3, { 1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 } }; + + NLA_PUT (msg, TCA_OPTIONS, sizeof (opt), &opt); } else { if (!(tc_options = nla_nest_start (msg, TCA_OPTIONS))) goto nla_put_failure;