Re: [PATCH net-next 2/4] eth: mpnic: add promiscuous and all-multicast filters

From: Daniel Zahka

Date: Wed Nov 18 2026 - 05:04:31 EST


On Wed Nov 18, 2026 at 4:12 AM EST, netdev-bot+sashiko wrote:
> Thank you for your contribution! Sashiko AI review found more severe
> issue(s) in other patches of this series. This mail is only an FYI, in case
> you want to address the nit picks below when you respin.
>
> Low priority / nit picks for your consideration:
>
> - [Low] On every ndo_stop, mpnic_clear_rx_mode()
> (drivers/net/ethernet/meta/mpnic/mpnic_netdev.c, called from…
>
> --
>
> eth: mpnic: add promiscuous and all-multicast filters
>
> This commit implements IFF_PROMISC and IFF_ALLMULTI using the last DMAC
> TCAM entry, which matches either every address or only the multicast bit.
> It also changes the default action on TCAM misses from pass to drop.
>
>> diff --git a/drivers/net/ethernet/meta/mpnic/mpnic_netdev.c b/drivers/net/ethernet/meta/mpnic/mpnic_netdev.c
>> index 16611813db555..43547a7d6e5c7 100644
>> --- a/drivers/net/ethernet/meta/mpnic/mpnic_netdev.c
>> +++ b/drivers/net/ethernet/meta/mpnic/mpnic_netdev.c
>
> [ ... ]
>
>> @@ -54,6 +64,7 @@ static void mpnic_clear_rx_mode(struct mpnic_dev *mpd)
>>
>> mac_addr[MPNIC_TCAM_MACDA_BROADCAST_IDX].state = MPNIC_TCAM_S_DELETE;
>> mac_addr[MPNIC_TCAM_MACDA_HOST_ADDR_IDX].state = MPNIC_TCAM_S_DELETE;
>> + mac_addr[MPNIC_TCAM_MACDA_PROMISC_IDX].state = MPNIC_TCAM_S_DELETE;
>
> [Severity: Low]
> Should this check for MPNIC_TCAM_S_VALID before moving the promisc entry
> to delete?
>
> The broadcast and host address entries are always valid while the
> interface is up. The promisc entry is usually MPNIC_TCAM_S_DISABLED,
> though. That is its state whenever IFF_PROMISC and IFF_ALLMULTI are both
> clear and the mc list is empty, and also after mpnic_promisc_sync() has
> already removed it.
>
> The state comment in mpnic_rpc.h only lists valid as a source of delete:
>
> * Valid 1 -> Delete 3
> * Delete 3 -> Disabled 0
>
> The other place this patch adds that deletes the same entry follows
> that rule:
>
> mpnic_promisc_sync() {
> ...
> } else if (mac_addr->state == MPNIC_TCAM_S_VALID) {
> mac_addr->state = MPNIC_TCAM_S_DELETE;
> }
> }
>
> With ip link set dev X up and no promisc/allmulti flags set, followed by
> ip link set dev X down, the path is mpnic_stop()->mpnic_clear_rx_mode()
> ->mpnic_write_macda(). This takes a disabled entry straight to delete,
> and then issues an UNLOAD_TRIG for entry 1023 even though it was never
> loaded.
>
> The extra unload looks harmless, because mpnic_rxb_init() already
> unloads every entry at init. The remaining problem is that the code no
> longer matches the documented state ordering, and the two delete sites
> behave differently.
>
> This is still the case at the end of the series. The later commit "eth:
> mpnic: sync unicast and multicast address lists" updates the same
> comment to add "Delete 3 -> Add 2". It does not add a disabled to delete
> transition, and it does not add a state check here.
>
> Could this either check the state, the way mpnic_promisc_sync() does, or
> document disabled to delete as an allowed transition?
>

A check is not necessary. If I respin a v2, I'll adjust the comment, but
I think overall this isn't an issue.

>>
>> mpnic_write_macda(mpd);
>> }
>
> [ ... ]