Netdev List
 help / color / mirror / Atom feed
From: Abdul Wasey <w453y.me@gmail.com>
To: netdev@vger.kernel.org
Cc: dsahern@kernel.org, stephen@networkplumber.org,
	idosch@nvidia.com, razor@blackwall.org,
	horatiu.vultur@microchip.com, bridge@lists.linux.dev
Subject: [PATCH iproute2-next 0/2] bridge: add cfm command
Date: Sun,  4 Oct 2026 04:13:05 +0000	[thread overview]
Message-ID: <20261004041307.2683990-1-w453y.me@gmail.com> (raw)

The bridge has had 802.1ag CFM support since 5.11, but iproute2 never
got a command for it. The only userspace for it today is Microchip's out
of tree cfm tool. This series adds "bridge cfm".

Patch 1 imports cfm_bridge.h, which has the domain, direction and
interval enums the CFM attributes use. Patch 2 adds the command and a
man page section.

I tested it on a 7.0 kernel with two bridges joined by a veth pair and
a MEP on each end. CCMs go out at every interval, each side sees the
other as a peer, the TLV values and the RDI bit get through, and
ccm_defect gets set when one side stops sending. I also checked show
config and show status, text and JSON, with more than one MEP and peer
on a bridge.

While testing I found that the kernel sends CCMs from a workqueue, so
with HZ=1000 the 3.3ms interval actually comes out at about 5ms and 1s
at about 1024ms. The man page says the real interval can be longer than
its name.

One thing I wasn't sure about: the MAID is given as a hex string, the
same bytes the kernel stores. The Microchip tool builds it from an MD
name and an MA name. I can add that, but it seemed better as a separate
patch.

Separately, I'm sending a net-next patch so that CFM config changes
send a notification. Right now only status changes do. The two don't
depend on each other.

Abdul Wasey (2):
  uapi: import cfm_bridge.h
  bridge: add cfm command

 bridge/Makefile                 |    2 +-
 bridge/br_common.h              |    1 +
 bridge/bridge.c                 |    3 +-
 bridge/cfm.c                    | 1058 +++++++++++++++++++++++++++++++
 include/uapi/linux/cfm_bridge.h |   64 ++
 man/man8/bridge.8               |  196 +++++-
 6 files changed, 1321 insertions(+), 3 deletions(-)
 create mode 100644 bridge/cfm.c
 create mode 100644 include/uapi/linux/cfm_bridge.h

-- 
2.53.0


             reply	other threads:[~2026-10-04  4:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-04  4:13 Abdul Wasey [this message]
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-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=20261004041307.2683990-1-w453y.me@gmail.com \
    --to=w453y.me@gmail.com \
    --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=stephen@networkplumber.org \
    /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