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 2/3] net: atlantic: AQC113: Limit multicast filters to available slots
Date: Sat, 28 Nov 2026 15:39:08 +0000 [thread overview]
Message-ID: <179588034859.3135.5963966861559896048@kernel.org> (raw)
In-Reply-To: <20261127-net-atlantic-aq113-apple-l2-filter-slots-v3-2-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] The new helper hw_atl2_get_multicast_address_max() returns
`min(priv->l2_filter_count - 1, AQ_HW_MULTICAST_ADDRESS_MAX)`.
--
net: atlantic: AQC113: Limit multicast filters to available slots
This adds a hw_get_multicast_address_max() hw op. With it,
aq_nic_set_multicast_list() can fall back to IFF_PROMISC or IFF_ALLMULTI
based on how many L2 filter slots the firmware really provides. hw_atl2
takes the value from the firmware-reported l2_filter_count, and the bounds
check in hw_atl2_hw_multicast_list_set() now uses l2_filter_count too.
> diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c
> index 25dd7150aaaf2..0b5a5bc420e92 100644
> --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c
> +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c
> @@ -777,7 +777,7 @@ static int hw_atl2_hw_multicast_list_set(struct aq_hw_s *self,
> struct aq_nic_cfg_s *cfg = self->aq_nic_cfg;
> int err = 0;
>
> - if (count > (HW_ATL2_MAC_MAX - HW_ATL2_MAC_MIN)) {
> + if (count > (priv->l2_filter_count - 1)) {
> err = -EBADRQC;
> goto err_exit;
> }
[ ... ]
> @@ -1602,6 +1602,14 @@ static int hw_atl2_hw_vlan_ctrl(struct aq_hw_s *self, bool enable)
> return aq_hw_err_from_flags(self);
> }
>
> +static unsigned int hw_atl2_get_multicast_address_max(struct aq_hw_s *self)
> +{
> + struct hw_atl2_priv *priv = self->priv;
> +
> + return min_t(unsigned int, priv->l2_filter_count - 1,
> + AQ_HW_MULTICAST_ADDRESS_MAX);
> +}
[Severity: Medium]
Should this helper also account for the firmware base index?
hw_atl2_hw_multicast_list_set() writes slots starting at
l2_filters_base_index + 1. Neither this helper nor the new check above
limits the count to the part of the HW_ATL2_MAC_MAX (38) entry bank that
sits above that base.
hw_atl2_utils_get_filter_caps() checks the two firmware values separately:
priv->l2_filters_base_index = filter_caps.l2_filters_base_index;
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;
This means firmware caps such as base=9 and count=38 are accepted. With
those values:
- this helper returns 32
- aq_nic_set_multicast_list() can pass 32 addresses
- the count > 37 check in hw_atl2_hw_multicast_list_set() passes
The loop then writes the DA LSW/MSW, tag and enable registers at
base_location + i, which covers slots 10 to 41. Slots 38 to 41 are past the
L2 unicast filter bank that hw_atl2_hw_init() initialises.
HW_ATL_RPFL2UC_DAFLSW_ADR(f) is 0x5110 + f * 8. So slot 40 maps to 0x5250,
which is HW_ATL_RPFL2MC_ENF_ADR(0), and slot 41 maps to ENF_ADR(2) and
ENF_ADR(3).
Can this overwrite the L2 multicast filter registers? The Apple values
(9 + 29) add up to exactly 38, so this only happens with firmware that
reports base + count > 38.
The later patch in this series, "net: atlantic: AQC113: Fix
hw_atl2_hw_packet_filter_set for L2 filter base index > 0", sizes the same
slot range like this:
min_t(unsigned int, HW_ATL2_MAC_MAX - base_location,
priv->l2_filter_count - 1);
At the end of the series, three places therefore use different slot
counts:
- this helper
- the check in hw_atl2_hw_multicast_list_set()
- the loop in hw_atl2_hw_packet_filter_set()
Could the helper and the check both use the same limit?
min(HW_ATL2_MAC_MAX - (l2_filters_base_index + 1),
l2_filter_count - 1, AQ_HW_MULTICAST_ADDRESS_MAX)
--
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
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 [this message]
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=179588034859.3135.5963966861559896048@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