Re: [PATCH net-next v4 6/12] net: atlantic: fix AQC113 HW init: ART, L2 filter slot, MAC address

From: Jakub Kicinski

Date: Thu Jun 04 2026 - 22:39:57 EST


This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
net: atlantic: fix AQC113 HW init: ART, L2 filter slot, MAC address

This patch updates hw_atl2 init to use firmware-reported ART and L2
filter base indices for AQC113, adds hw_atl2_hw_mac_addr_set() that
programs the MAC into the firmware-assigned L2 filter slot, and wires
.hw_get_regs into hw_atl2_ops.

> 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 0ce9caae8799..27a62fffbc29 100644
> --- a/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c
> +++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c

[ ... ]

> @@ -484,6 +508,7 @@ static int hw_atl2_act_rslvr_table_set(struct aq_hw_s *self, u8 location,
> static int hw_atl2_hw_init_rx_path(struct aq_hw_s *self)
> {
> struct aq_nic_cfg_s *cfg = self->aq_nic_cfg;
> + struct hw_atl2_priv *priv = self->priv;
> int i;
>
> /* Rx TC/RSS number config */
> @@ -499,7 +524,9 @@ static int hw_atl2_hw_init_rx_path(struct aq_hw_s *self)
>
> /* Multicast filters */
> for (i = HW_ATL2_MAC_MAX; i--;) {
> - hw_atl_rpfl2_uc_flr_en_set(self, (i == 0U) ? 1U : 0U, i);
> + hw_atl_rpfl2_uc_flr_en_set(self,
> + (i == priv->l2_filters_base_index) ?
> + 1U : 0U, i);
> hw_atl_rpfl2unicast_flr_act_set(self, 1U, i);
> }

[High]

Can the multicast list handler now collide with the UC MAC slot?

After this patch, the host MAC is programmed at slot
priv->l2_filters_base_index (firmware-supplied, clamped by the new check
in hw_atl2_utils_get_filter_caps() to the range [0, HW_ATL2_MAC_MAX-1]
i.e. [0, 37]). However, hw_atl2_hw_multicast_list_set() still iterates
multicast entries into slots HW_ATL2_MAC_MIN + i (i.e. starting at slot
1):

for (cfg->mc_list_count = 0U;
cfg->mc_list_count < count;
++cfg->mc_list_count) {
u32 i = cfg->mc_list_count;
...
hw_atl_rpfl2_uc_flr_en_set(self, 0U, HW_ATL2_MAC_MIN + i);
hw_atl_rpfl2unicast_dest_addresslsw_set(self, l,
HW_ATL2_MAC_MIN + i);
hw_atl_rpfl2unicast_dest_addressmsw_set(self, h,
HW_ATL2_MAC_MIN + i);
hw_atl2_rpfl2_uc_flr_tag_set(self, 1, HW_ATL2_MAC_MIN + i);
hw_atl_rpfl2_uc_flr_en_set(self, (cfg->is_mc_list_enabled),
HW_ATL2_MAC_MIN + i);
}

If the firmware reports any value N in [1, 37] for
l2_filters_base_index (which is the case the patch is intended to
support, since for N=0 the change vs. the old hardcoded HW_ATL2_MAC_UC=0
is a no-op) and the multicast list contains at least N entries, the
iteration with i = N - 1 writes to slot HW_ATL2_MAC_MIN + (N - 1) = N,
which is the UC MAC filter slot.

Wouldn't routine ndo_set_rx_mode invocations (for example IGMP/MLD
group joins or link state changes) then silently overwrite the host
MAC's UC filter with a multicast address, causing the NIC to stop
accepting unicast frames for the host?

Should hw_atl2_hw_multicast_list_set() also be updated to skip or
offset around priv->l2_filters_base_index, in the same way
hw_atl2_hw_init_rx_path() and hw_atl2_hw_mac_addr_set() were?