From: sashiko-bot@kernel.org
To: wei.fang@oss.nxp.com
Cc: imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH net-next 1/9] net: enetc: add interfaces to manage FDB entries
Date: Sat, 30 May 2026 00:49:59 +0000 [thread overview]
Message-ID: <20260530004959.E45D91F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260527100217.794987-2-wei.fang@oss.nxp.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] ntmp_fdbt_update_activity_element() fails to filter for dynamic FDB entries, causing it to incorrectly match and update the activity elements of all entries (including static ones).
--
commit 871b9a0ec7e03bf7ca6a2b118e3fd29a9b0a249e
Author: Wei Fang <wei.fang@nxp.com>
Subject: net: enetc: add interfaces to manage FDB entries
This commit adds four interfaces to manage entries in the FDB table. It
includes functions for deleting entries by key element, updating activity
elements of dynamic entries, deleting aging entries, and deleting port
dynamic entries.
> diff --git a/drivers/net/ethernet/freescale/enetc/ntmp.c b/drivers/net/ethernet/freescale/enetc/ntmp.c
> --- a/drivers/net/ethernet/freescale/enetc/ntmp.c
> +++ b/drivers/net/ethernet/freescale/enetc/ntmp.c
[ ... ]
> +/**
> + * ntmp_fdbt_update_activity_element - update the aging time of all the
> + * dynamic entries in the FDB table.
[ ... ]
> +int ntmp_fdbt_update_activity_element(struct ntmp_user *user)
> +{
> + struct fdbt_req_ua *req;
> + struct netc_swcbd swcbd;
> + struct netc_cbdr *cbdr;
> + union netc_cbd cbd;
> + u32 len;
> + int err;
> +
> + swcbd.size = sizeof(*req);
> + err = ntmp_alloc_data_mem(user->dev, &swcbd, (void **)&req);
> + if (err)
> + return err;
> +
> + /* Request data */
> + ntmp_fill_crd(&req->crd, user->tbl.fdbt_ver, 0, FDBT_UA_ACTEU);
> + req->ak.search.resume_eid = cpu_to_le32(NTMP_NULL_ENTRY_ID);
> +
[Severity: Medium]
Does this function accidentally update static FDB entries as well as dynamic
ones?
The function's description states it should update the aging time of all the
dynamic entries. However, since ntmp_alloc_data_mem() uses
dma_alloc_coherent(), the request structure is zero-initialized.
Because the search key configuration match fields (req->ak.search.cfge_mc
and req->ak.search.cfge.cfg) are left as 0, this appears to instruct the
hardware to match all FDB entries rather than restricting the operation to
dynamic entries.
For comparison, ntmp_fdbt_delete_aging_entries() explicitly sets these
fields to enforce the dynamic entry filter:
ntmp_fdbt_delete_aging_entries() {
...
req->ak.search.cfge.cfg = cpu_to_le32(cfg);
req->ak.search.cfge_mc = FDBT_CFGE_MC_DYNAMIC;
...
}
Could similar filter initialization be missing here?
> + /* Request header */
> + len = NTMP_LEN(swcbd.size, NTMP_STATUS_RESP_LEN);
> + /* For activity update, the access method must be search */
> + ntmp_fill_request_hdr(&cbd, swcbd.dma, len, NTMP_FDBT_ID,
> + NTMP_CMD_UPDATE, NTMP_AM_SEARCH);
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260527100217.794987-1-wei.fang@oss.nxp.com?part=1
next prev parent 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 [this message]
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
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=20260530004959.E45D91F00893@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.