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

From: Sukhdeep Soni [C]

Date: Wed Jun 10 2026 - 07:04:29 EST


On 4 Jun 2026, Jakub Kicinski wrote:

> 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?

The collision you describe will be handled in v5. hw_atl2_hw_multicast_list_set()
introduces base_location = priv->l2_filters_base_index + 1 and replaces all
HW_ATL2_MAC_MIN + i slot references with base_location + i, placing multicast entries
immediately after the UC MAC slot. So if firmware reports l2_filters_base_index = N,
the UC MAC occupies slot N and multicast entries start at slot N+1 - no collision is possible.