From: "Baek Kyu, Kim" <pocj8ur4in@gmail.com>
To: Nikolay Aleksandrov <razor@blackwall.org>
Cc: Ido Schimmel <idosch@nvidia.com>,
bridge@lists.linux.dev, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, "Baek Kyu,
Kim" <pocj8ur4in@gmail.com>
Subject: [PATCH net v2 1/2] bridge: cfm: Store the new CC configuration before enabling peers
Date: Thu, 29 Oct 2026 01:47:29 +0900 [thread overview]
Message-ID: <20261028164730.253238-2-pocj8ur4in@gmail.com> (raw)
In-Reply-To: <20261028164730.253238-1-pocj8ur4in@gmail.com>
br_cfm_cc_config_set() enables existing peers before storing the new
CC configuration. The receive timer therefore starts with the previous
expected interval, delaying CCM loss detection when enabling CC with a
shorter interval. For example, disabling CC at 1s and re-enabling it at
100ms schedules the first check after 250ms instead of 25ms, before
rounding to jiffies.
Save the disabled-to-enabled transition and store the new configuration
before enabling peers. Keep cancellation on disable before replacing
the configuration.
Fixes: dc32cbb3dbd7 ("bridge: cfm: Kernel space implementation of CFM. CCM frame RX added.")
Signed-off-by: Baek Kyu, Kim <pocj8ur4in@gmail.com>
---
On the combined v2 kernel under ARM64 QEMU/KVM, all 8 CC interval and
transition checks passed with bridge/veth and netlink configuration.
net/bridge/br_cfm.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/net/bridge/br_cfm.c b/net/bridge/br_cfm.c
index 9dcc97d63a6f..28b40dbf4073 100644
--- a/net/bridge/br_cfm.c
+++ b/net/bridge/br_cfm.c
@@ -634,6 +634,7 @@ int br_cfm_cc_config_set(struct net_bridge *br,
{
struct br_cfm_peer_mep *peer_mep;
struct br_cfm_mep *mep;
+ bool enable;
ASSERT_RTNL();
@@ -648,17 +649,20 @@ int br_cfm_cc_config_set(struct net_bridge *br,
if (memcmp(config, &mep->cc_config, sizeof(*config)) == 0)
return 0;
- if (config->enable && !mep->cc_config.enable)
- /* CC is enabled */
- hlist_for_each_entry(peer_mep, &mep->peer_mep_list, head)
- cc_peer_enable(peer_mep);
-
if (!config->enable && mep->cc_config.enable)
/* CC is disabled */
hlist_for_each_entry(peer_mep, &mep->peer_mep_list, head)
cc_peer_disable(peer_mep);
+ enable = config->enable && !mep->cc_config.enable;
+
mep->cc_config = *config;
+
+ if (enable)
+ /* CC is enabled */
+ hlist_for_each_entry(peer_mep, &mep->peer_mep_list, head)
+ cc_peer_enable(peer_mep);
+
mep->ccm_rx_snumber = 0;
mep->ccm_tx_snumber = 1;
--
2.55.0
next prev parent reply other threads:[~2026-10-28 16:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 16:47 [PATCH net v2 0/2] bridge: cfm: correct CC receive monitoring transitions Baek Kyu, Kim
2026-10-28 16:47 ` Baek Kyu, Kim [this message]
2026-10-28 16:47 ` [PATCH net v2 2/2] bridge: cfm: ignore CCM while CC is disabled Baek Kyu, Kim
2026-10-28 16:51 ` [PATCH net v2 0/2] bridge: cfm: correct CC receive monitoring transitions netdev-bot+sinfo
2026-10-28 17:11 ` Baek Kyu, Kim
2026-10-29 8:52 ` Nikolay Aleksandrov
2026-10-29 9:29 ` Baek Kyu, Kim
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=20261028164730.253238-2-pocj8ur4in@gmail.com \
--to=pocj8ur4in@gmail.com \
--cc=bridge@lists.linux.dev \
--cc=idosch@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=razor@blackwall.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