Netdev List
 help / color / mirror / Atom feed
* [PATCH iproute2-next 0/2] bridge: add cfm command
@ 2026-10-04  4:13 Abdul Wasey
  2026-10-04  4:13 ` [PATCH iproute2-next 1/2] uapi: import cfm_bridge.h Abdul Wasey
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Abdul Wasey @ 2026-10-04  4:13 UTC (permalink / raw)
  To: netdev; +Cc: dsahern, stephen, idosch, razor, horatiu.vultur, bridge

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-10-06 13:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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-06 10:42 ` [PATCH iproute2-next 0/2] " Ido Schimmel
2026-10-06 13:44   ` Abdul Wasey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox