From: sashiko-bot@kernel.org
To: wei.fang@oss.nxp.com
Cc: imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH v2 net-next 5/7] net: dsa: netc: enable ingress port filtering lookup by default
Date: Sun, 09 Aug 2026 03:19:04 +0000 [thread overview]
Message-ID: <20260809031905.520531F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260808032146.2335723-7-wei.fang@oss.nxp.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The DSA `port_set_host_flood` callback executes sleepable operations in atomic context.
--
--- Patch [5]: [PATCH v2 net-next 5/7] net: dsa: netc: enable ingress port filtering lookup by default ---
commit eec39f0d058c5db3118dad52f6e11e6878ffa678
Author: Wei Fang <wei.fang@nxp.com>
net: dsa: netc: enable ingress port filtering lookup by default
This commit enables the ingress port filtering lookup by default for netc.
It simplifies the code logic by removing the need to track and toggle the
lookup state when adding or removing host flood rules.
> diff --git a/drivers/net/dsa/netc/netc_main.c b/drivers/net/dsa/netc/netc_main.c
> index d326a00104e1d..9cb9e618661e5 100644
> --- a/drivers/net/dsa/netc/netc_main.c
> +++ b/drivers/net/dsa/netc/netc_main.c
[ ... ]
> @@ -1753,8 +1757,6 @@ static int netc_port_add_host_flood_rule(struct netc_port *np,
> np->uc = uc;
> np->mc = mc;
> np->ipft_hf_eid = host_flood->entry_id;
> - /* Enable ingress port filter table lookup */
> - netc_port_wr(np, NETC_PIPFCR, PIPFCR_EN);
>
> free_host_flood:
> kfree(host_flood);
[Severity: High]
This isn't a bug introduced by this patch, but does
netc_port_add_host_flood_rule() execute sleepable operations in atomic context?
When userspace changes interface flags (e.g., ip link set dev ethX promisc on),
the network core calls ndo_change_rx_flags while holding netif_addr_lock_bh(),
which disables bottom halves and establishes an atomic context.
The DSA core delegates this to the port_set_host_flood callback, which calls
netc_port_set_host_flood() -> netc_port_add_host_flood_rule() synchronously.
Looking at the code, do these functions execute sleepable operations?
- Allocating memory using GFP_KERNEL (via kzalloc_obj() in
netc_port_add_host_flood_rule())
- Acquiring a sleeping lock (via mutex_lock() in ntmp_select_and_lock_cbdr())
- Yielding to the scheduler (via read_poll_timeout() with sleep=true in
netc_xmit_ntmp_cmd())
Could this lead to a "scheduling while atomic" panic if
CONFIG_DEBUG_ATOMIC_SLEEP is enabled? Should this hardware configuration
be deferred to a workqueue?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260808032146.2335723-1-wei.fang@oss.nxp.com?part=5
next prev parent reply other threads:[~2026-08-09 3:19 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-08 3:21 [PATCH v2 net-next 0/7] net: dsa: netc: add PTP support for NETC switch wei.fang
2026-08-08 3:21 ` [PATCH] net: dsa: netc: add PTP one-step timestamping support wei.fang
2026-08-08 3:26 ` Wei Fang
2026-08-08 3:21 ` [PATCH v2 net-next 1/7] ptp: netc: use ioread64_lo_hi/iowrite64_lo_hi for 64-bit register access wei.fang
2026-08-09 3:19 ` sashiko-bot
2026-08-08 3:21 ` [PATCH v2 net-next 2/7] ptp: netc: remove unnecessary pcie_flr() call in probe wei.fang
2026-08-09 3:19 ` sashiko-bot
2026-08-08 3:21 ` [PATCH v2 net-next 3/7] ptp: netc: export netc_timer_get_current_time() for cross-driver use wei.fang
2026-08-09 3:19 ` sashiko-bot
2026-08-10 1:30 ` Wei Fang (OSS)
2026-08-08 3:21 ` [PATCH v2 net-next 4/7] net: dsa: netc: use entry ID instead of pointer to track host flood rule wei.fang
2026-08-08 3:21 ` [PATCH v2 net-next 5/7] net: dsa: netc: enable ingress port filtering lookup by default wei.fang
2026-08-09 3:19 ` sashiko-bot [this message]
2026-08-10 2:40 ` Wei Fang (OSS)
2026-08-08 3:21 ` [PATCH v2 net-next 6/7] net: dsa: netc: add PTP two-step timestamping support wei.fang
2026-08-09 3:19 ` sashiko-bot
2026-08-10 3:33 ` Wei Fang (OSS)
2026-08-08 3:21 ` [PATCH v2 net-next 7/7] net: dsa: netc: add PTP one-step " wei.fang
2026-08-09 3:19 ` sashiko-bot
2026-08-10 7:31 ` Wei Fang (OSS)
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=20260809031905.520531F00A3D@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