Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: wei.fang@oss.nxp.com
Cc: Frank.Li@kernel.org, imx@lists.linux.dev
Subject: Re: [PATCH net-next 9/9] net: dsa: netc: implement dynamic FDB entry aging
Date: Sat, 30 May 2026 00:50:06 +0000	[thread overview]
Message-ID: <20260530005009.7EB691F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260527100217.794987-10-wei.fang@oss.nxp.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Setting aging time to 0 incorrectly results in aggressive 1-second aging instead of disabling aging.
- [Medium] Changes to the aging time do not take effect immediately due to failure to reschedule the pending delayed work.
--

commit d6713501ccd21f4b93ade1b9678b912b0922c0ca
Author: Wei Fang <wei.fang@nxp.com>

net: dsa: netc: implement dynamic FDB entry aging

The NETC switch does not age out dynamic FDB entries automatically. This
commit adds a delayed work to periodically remove unrefreshed entries,
along with DSA operations to configure aging time and flush per-port
entries on demand.

> diff --git a/drivers/net/dsa/netc/netc_main.c b/drivers/net/dsa/netc/netc_main.c
> index 1fe3b43e04598..cffa479e19b3f 100644
> --- a/drivers/net/dsa/netc/netc_main.c
> +++ b/drivers/net/dsa/netc/netc_main.c

[ ... ]

> @@ -1977,6 +2026,34 @@ static void netc_port_bridge_leave(struct dsa_switch *ds, int port,
>  	netc_port_del_vlan_entry(np, vlan_unaware_pvid);
>  }
>  
> +static int netc_set_ageing_time(struct dsa_switch *ds, unsigned int msecs)
> +{
> +	struct netc_switch *priv = ds->priv;
> +	u32 secs = msecs / 1000;
> +	u32 act_cnt, interval;
> +
> +	if (!secs)
> +		secs = 1;

[Severity: High]
In the bridge subsystem, an aging time of 0 explicitly means that dynamic
FDB entries should never age out. Because the driver does not configure
ds->ageing_time_min, the DSA layer allows an msecs value of 0 to reach
netc_set_ageing_time().

Does forcing secs to 1 here break the ability to disable aging? 

Instead of disabling the software aging work, it configures the work to run
every 1 second. Can this cause immediate MAC address eviction when the
expected behavior is for aging to be disabled?

> +
> +	for (interval = 1; interval <= secs; interval++) {
> +		act_cnt = secs / interval;
> +		if (act_cnt <= FDBT_ACT_CNT)
> +			break;
> +	}
> +
> +	WRITE_ONCE(priv->fdbt_acteu_interval, (unsigned long)interval * HZ);
> +	WRITE_ONCE(priv->fdbt_ageing_act_cnt, act_cnt);

[Severity: Medium]
When netc_set_ageing_time() updates priv->fdbt_acteu_interval, it only uses
WRITE_ONCE() without updating the currently scheduled fdbt_clean work.

If the previous aging interval was set to a large value and is then reduced,
will the system wait for the remainder of the old duration before waking up
and applying the new aging parameters? Should this call mod_delayed_work()
to apply the changes immediately?

> +
> +	return 0;
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260527100217.794987-1-wei.fang@oss.nxp.com?part=9

  reply	other threads:[~2026-05-30  0:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-27 10:02 [PATCH net-next 0/9] net: dsa: netc: add bridge mode support wei.fang
2026-05-27 10:02 ` [PATCH net-next 1/9] net: enetc: add interfaces to manage FDB entries wei.fang
2026-05-30  0:49   ` sashiko-bot
2026-05-27 10:02 ` [PATCH net-next 2/9] net: enetc: add "Update" and "Delete" operations to VLAN filter table wei.fang
2026-05-27 10:02 ` [PATCH net-next 3/9] net: enetc: add interfaces to manage egress treatment table wei.fang
2026-05-27 10:02 ` [PATCH net-next 4/9] net: enetc: add "Update" operation to the egress count table wei.fang
2026-05-27 10:02 ` [PATCH net-next 5/9] net: dsa: netc: initialize the group bitmap of ETT and ECT wei.fang
2026-05-27 10:02 ` [PATCH net-next 6/9] net: enetc: add helpers to set/clear table bitmap wei.fang
2026-05-27 10:02 ` [PATCH net-next 7/9] net: dsa: netc: add VLAN filter table and egress treatment management wei.fang
2026-05-30  0:50   ` sashiko-bot
2026-05-27 10:02 ` [PATCH net-next 8/9] net: dsa: netc: add bridge mode support wei.fang
2026-05-30  0:50   ` sashiko-bot
2026-05-27 10:02 ` [PATCH net-next 9/9] net: dsa: netc: implement dynamic FDB entry aging wei.fang
2026-05-30  0:50   ` sashiko-bot [this message]
2026-05-29  1:53 ` [PATCH net-next 0/9] net: dsa: netc: add bridge mode support Wei Fang

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=20260530005009.7EB691F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wei.fang@oss.nxp.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