From: Stephen Hemminger <stephen@networkplumber.org>
To: Abdul Wasey <w453y.me@gmail.com>
Cc: netdev@vger.kernel.org, dsahern@kernel.org, idosch@nvidia.com,
razor@blackwall.org, horatiu.vultur@microchip.com,
bridge@lists.linux.dev
Subject: Re: [PATCH iproute2-next 2/2] bridge: add cfm command
Date: Sat, 10 Oct 2026 09:27:49 -0700 [thread overview]
Message-ID: <20261010092749.6bfd087e@phoenix.local> (raw)
In-Reply-To: <20261004041307.2683990-3-w453y.me@gmail.com>
On Sun, 4 Oct 2026 04:13:07 +0000
Abdul Wasey <w453y.me@gmail.com> wrote:
> +static int cfm_parse_interval(const char *str)
> +{
> + if (!strcmp(str, "none"))
> + return BR_CFM_CCM_INTERVAL_NONE;
> + if (!strcmp(str, "3ms3") || !strcmp(str, "3.3ms"))
> + return BR_CFM_CCM_INTERVAL_3_3_MS;
> + if (!strcmp(str, "10ms"))
> + return BR_CFM_CCM_INTERVAL_10_MS;
> + if (!strcmp(str, "100ms"))
> + return BR_CFM_CCM_INTERVAL_100_MS;
> + if (!strcmp(str, "1s"))
> + return BR_CFM_CCM_INTERVAL_1_SEC;
> + if (!strcmp(str, "10s"))
> + return BR_CFM_CCM_INTERVAL_10_SEC;
> + if (!strcmp(str, "1m"))
> + return BR_CFM_CCM_INTERVAL_1_MIN;
> + if (!strcmp(str, "10m"))
> + return BR_CFM_CCM_INTERVAL_10_MIN;
> + return -1;
> +}
> +
> +static const char *cfm_interval_str(__u32 interval)
> +{
> + switch (interval) {
> + case BR_CFM_CCM_INTERVAL_NONE:
> + return "none";
> + case BR_CFM_CCM_INTERVAL_3_3_MS:
> + return "3ms3";
> + case BR_CFM_CCM_INTERVAL_10_MS:
> + return "10ms";
> + case BR_CFM_CCM_INTERVAL_100_MS:
> + return "100ms";
> + case BR_CFM_CCM_INTERVAL_1_SEC:
> + return "1s";
> + case BR_CFM_CCM_INTERVAL_10_SEC:
> + return "10s";
> + case BR_CFM_CCM_INTERVAL_1_MIN:
> + return "1m";
> + case BR_CFM_CCM_INTERVAL_10_MIN:
> + return "10m";
> + default:
> + return "unknown";
> + }
> +}
Iproute2 already has helpers get_time and print_time.
next prev parent reply other threads:[~2026-10-10 16:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-04 4:13 [PATCH iproute2-next 0/2] bridge: add cfm command Abdul Wasey
2026-10-04 4:13 ` [PATCH iproute2-next 1/2] uapi: import cfm_bridge.h Abdul Wasey
2026-10-04 4:13 ` [PATCH iproute2-next 2/2] bridge: add cfm command Abdul Wasey
2026-10-10 16:27 ` Stephen Hemminger [this message]
2026-10-06 10:42 ` [PATCH iproute2-next 0/2] " Ido Schimmel
2026-10-06 13:44 ` Abdul Wasey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261010092749.6bfd087e@phoenix.local \
--to=stephen@networkplumber.org \
--cc=bridge@lists.linux.dev \
--cc=dsahern@kernel.org \
--cc=horatiu.vultur@microchip.com \
--cc=idosch@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=razor@blackwall.org \
--cc=w453y.me@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox