From: netdev-bot+sashiko@kernel.org
To: j@jannau.net
Cc: sukhdeeps@marvell.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v3 1/3] net: atlantic: AQC113: Ensure L2 filter count is valid
Date: Sat, 28 Nov 2026 15:39:07 +0000 [thread overview]
Message-ID: <179588034739.3135.6933254779227340437@kernel.org> (raw)
In-Reply-To: <20261127-net-atlantic-aq113-apple-l2-filter-slots-v3-1-b5efbc124dcc@jannau.net>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] In hw_atl2_utils_get_filter_caps()
(drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c,…
--
net: atlantic: AQC113: Ensure L2 filter count is valid
This commit checks the firmware-provided l2_filter_count in
hw_atl2_utils_get_filter_caps(). If the value is outside [1, HW_ATL2_MAC_MAX],
the count is recomputed from the already validated l2_filters_base_index.
> diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c
> index dc9b2ef4640b1..9ad5bbb11bdf8 100644
> --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c
> +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2_utils_fw.c
> @@ -629,6 +629,8 @@ int hw_atl2_utils_get_filter_caps(struct aq_hw_s *self)
> if (priv->l2_filters_base_index >= HW_ATL2_MAC_MAX)
> priv->l2_filters_base_index = HW_ATL2_MAC_UC;
> priv->l2_filter_count = filter_caps.l2_filter_count;
> + if (priv->l2_filter_count < 1 || priv->l2_filter_count > HW_ATL2_MAC_MAX)
> + priv->l2_filter_count = HW_ATL2_MAC_MAX - priv->l2_filters_base_index;
[Severity: Medium]
Should the upper bound here be HW_ATL2_MAC_MAX - l2_filters_base_index
instead of HW_ATL2_MAC_MAX?
The fallback treats the count as the number of slots from the base to the
end of the 38-entry table. The accept condition does not apply that bound,
so a count that does not fit after the base still gets through.
For example, base = 30 passes the base check (it is below 38), and
count = 38 passes the new check.
Later patches in this series use l2_filter_count as the bound for
multicast programming:
hw_atl2_get_multicast_address_max():
return min_t(unsigned int, priv->l2_filter_count - 1,
AQ_HW_MULTICAST_ADDRESS_MAX);
hw_atl2_hw_multicast_list_set():
if (count > (priv->l2_filter_count - 1)) {
With base = 30 and count = 38, this advertises 32 multicast slots. The
loop then writes slots base_location + i, which is 31..62.
The register addresses are linear in the slot index:
#define HW_ATL_RPFL2UC_DAFLSW_ADR(filter) (0x00005110 + (filter) * 0x8)
Slots 38..62 would land on MMIO 0x5240..0x5304, which is past the L2
unicast filter block. Can this misprogram unrelated RPF registers?
In the final series, hw_atl2_hw_packet_filter_set() clamps with
min(HW_ATL2_MAC_MAX - base_location, l2_filter_count - 1). The multicast
paths above use the raw l2_filter_count without that clamp.
Something like this would give every consumer the same window:
if (count < 1 || count > HW_ATL2_MAC_MAX - base)
The Apple firmware reports base = 9 and count = 29, which is consistent. So
this only applies to firmware that reports a mismatched base/count pair.
> priv->etype_filter_base_index = filter_caps.ethertype_filter_base_index;
> priv->etype_filter_count = filter_caps.ethertype_filter_count;
> priv->etype_filter_tag_top =
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261127-net-atlantic-aq113-apple-l2-filter-slots-v3-0-b5efbc124dcc%40jannau.net
next prev parent reply other threads:[~2026-11-28 15:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 14:54 [PATCH v3 0/3] net: atlantic: AQC113: Fix regression on Apple silicon systems Janne Grunau
2026-11-27 14:54 ` [PATCH v3 1/3] net: atlantic: AQC113: Ensure L2 filter count is valid Janne Grunau
2026-11-28 15:39 ` netdev-bot+sashiko [this message]
2026-11-27 14:54 ` [PATCH v3 2/3] net: atlantic: AQC113: Limit multicast filters to available slots Janne Grunau
2026-11-28 15:39 ` netdev-bot+sashiko
2026-11-27 14:54 ` [PATCH v3 3/3] net: atlantic: AQC113: Fix hw_atl2_hw_packet_filter_set for L2 filter base index > 0 Janne Grunau
2026-11-28 15:39 ` netdev-bot+sashiko
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=179588034739.3135.6933254779227340437@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=j@jannau.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=sukhdeeps@marvell.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