Re: [PATCH net v7 4/4] ice: use a VLAN agnostic multicast promisc rule pair for PF VSIs

From: Ivan Vecera

Date: Thu Dec 03 2026 - 05:57:51 EST


On 12/2/26 08:16, Petr Oros wrote:
An allmulticast or promiscuous PF VSI with VLANs is subscribed to
multicast with an ICE_SW_LKUP_PROMISC_VLAN rule pair for every VID, and
each rule takes an entry of the switch lookup table (FLU), which has 32K
entries for all PFs of the device. A port of a vlan_filtering bridge is
allmulticast, so a wide trunk (vid 2-4094) over several such ports
overruns the table. Firmware then rejects Add Switch Rules with ENOSPC,
the trunk of the last port is only partly installed, and the default VSI
(DFLT) Rx rule fails to install when a port turns promiscuous:

ice 0000:5c:00.1: Failed to set VSI 14 as the default forwarding
VSI, error -5
ice 0000:5c:00.1 ens1f1: Error -5 setting default VSI 14 Rx rule

Subscribe PF VSIs with the VLAN agnostic pair (ICE_SW_LKUP_PROMISC, vid
0) only. Drop the per-VID handling from ice_vlan_rx_add_vid() and
ice_vlan_rx_kill_vid(), and stop clearing the multicast rules in
ice_eswitch_resync_uplink(), whose queued sync now reconciles them. The
pair matches multicast on every VLAN. VLAN pruning still limits what it
delivers to the VLANs of the VSI, and with pruning off, as for the DFLT
holder, it delivers on every VLAN. The subscription now follows
IFF_PROMISC and IFF_ALLMULTI in one place, so clearing allmulti no
longer unsubscribes a promiscuous VSI unless another VSI holds the DFLT
rule, and a failed DFLT install does not remove it. As before this
patch, nothing retries a failed promisc step on its own. The service
task skips a VSI that has only ICE_VSI_PROMISC_CHANGED set, so the retry
comes with the next filter sync that an rx mode change or the end of a
switchdev session starts. ice_set_promisc() adds the Rx and the Tx rule
one at a time, so a rule left by an earlier failure does not keep the
other one from being added.

A trusted VF that holds the DFLT rule no longer gets through it the
multicast on VLANs the PF is not a member of, because the promisc recipe
has a higher priority than the default one. It keeps what its own
multicast promisc rules match.

The overrun was observed on a machine in real use, and the allmulti
problem was found by the Sashiko review of v4. The overrun reproduces on
an E810-C (FW 8.1.1, ICE COMMS package 1.3.55.0) without kernel changes:

for p in $P0 $P2 $P3; do
ip link add br-$p type bridge vlan_filtering 1
ip link set br-$p up
ip link set $p master br-$p
bridge vlan add vid 2-4094 dev $p
done
ip link set br-$P0 promisc on

With the per-VID pairs a trunked port took 12292 FLU entries, the third
bridge vlan add failed part way and the promisc on logged the errors
above. With this patch a trunked port takes 4104 entries, all three
trunks fit with 20387 of the 32768 entries free, and the DFLT rule
installs. The FLU numbers come from a test-only debugfs file that issues
Get Resource Allocation (AQ 0x0204). Also tested with multicast to
joined and unjoined groups on member and non-member VLANs, with promisc
and allmulti changed in every order, with VLANs added and removed while
allmulticast, with a trusted promiscuous VF, and with the DFLT install
made to fail by a test-only change. Also tested with a trusted VF in
allmulticast over its VLANs while the PF was allmulticast, which still
receives all of its multicast. No kernel selftests cover this.

Fixes: 1273f89578f2 ("ice: Fix broken IFF_ALLMULTI handling")
Fixes: 43fbca02c2dd ("ice: fix lost multicast packets in promisc mode")
Reviewed-by: Ivan Vecera <ivecera@xxxxxxxxxx>
Signed-off-by: Petr Oros <poros@xxxxxxxxxx>
---
v6:
- No code changes. The message says that nothing retries a failed
promisc step on its own and what starts the retry (Sashiko review of
v5).

v6: https://lore.kernel.org/all/20261130132107.1177185-5-poros@xxxxxxxxxx/
v5: https://lore.kernel.org/all/20261127085714.1207361-5-poros@xxxxxxxxxx/
v4: https://lore.kernel.org/all/20260708125755.706263-2-poros@xxxxxxxxxx/
v3: https://lore.kernel.org/all/20260701133601.2118382-2-poros@xxxxxxxxxx/
v2: https://lore.kernel.org/all/20260622113428.2565255-2-poros@xxxxxxxxxx/
v1: https://lore.kernel.org/all/89efbea9831175e6f57e9fe8557f7a0e48e050b7.1781786935.git.poros@xxxxxxxxxx/
Reviewed-by: Ivan Vecera <ivecera@xxxxxxxxxx>