[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZJKSDdC+YNlvCXVv@shredder>
Date: Wed, 21 Jun 2023 09:00:45 +0300
From: Ido Schimmel <idosch@...sch.org>
To: Zahari Doychev <zahari.doychev@...ux.com>
Cc: netdev@...r.kernel.org, dsahern@...il.com, stephen@...workplumber.org,
hmehrtens@...linear.com, aleksander.lobakin@...el.com,
simon.horman@...igine.com, Zahari Doychev <zdoychev@...linear.com>
Subject: Re: [PATCH iproute2-next v2] f_flower: add cfm support
On Tue, Jun 20, 2023 at 10:10:36PM +0200, Zahari Doychev wrote:
> From: Zahari Doychev <zdoychev@...linear.com>
>
> Add support for matching on CFM Maintenance Domain level and opcode.
[...]
>
> Signed-off-by: Zahari Doychev <zdoychev@...linear.com>
Reviewed-by: Ido Schimmel <idosch@...dia.com>
Few comments I missed earlier
> ---
> include/uapi/linux/pkt_cls.h | 9 ++++
iproute2 maintainers sync UAPI files using a script and I believe the
preference is for submitters to not touch these files or update them in
a separate patch that the maintainers can easily discard.
> lib/ll_proto.c | 1 +
> man/man8/tc-flower.8 | 29 ++++++++++-
> tc/f_flower.c | 98 +++++++++++++++++++++++++++++++++++-
> 4 files changed, 135 insertions(+), 2 deletions(-)
[...]
> +static void flower_print_cfm(struct rtattr *attr)
> +{
> + struct rtattr *tb[TCA_FLOWER_KEY_CFM_OPT_MAX + 1];
> + struct rtattr *v;
> + SPRINT_BUF(out);
> + size_t sz = 0;
> +
> + if (!attr || !(attr->rta_type & NLA_F_NESTED))
> + return;
> +
> + parse_rtattr(tb, TCA_FLOWER_KEY_CFM_OPT_MAX, RTA_DATA(attr),
> + RTA_PAYLOAD(attr));
> +
> + print_nl();
> + print_string(PRINT_FP, NULL, " cfm", NULL);
> + open_json_object("cfm");
> +
> + v = tb[TCA_FLOWER_KEY_CFM_MD_LEVEL];
> + if (v) {
> + sz += sprintf(out, " mdl %u", rta_getattr_u8(v));
> + print_hhu(PRINT_JSON, "mdl", NULL, rta_getattr_u8(v));
> +
Unnecessary blank line
> + }
> +
> + v = tb[TCA_FLOWER_KEY_CFM_OPCODE];
> + if (v) {
> + sprintf(out + sz, " op %u", rta_getattr_u8(v));
> + print_hhu(PRINT_JSON, "op", NULL, rta_getattr_u8(v));
> +
Likewise
> + }
> +
> + close_json_object();
> + print_string(PRINT_FP, "cfm", "%s", out);
> +}
Powered by blists - more mailing lists