On 11/27/26 09:57, 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 before the retry. 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. No kernel selftests cover this. Fixes: 1273f89578f2 ("ice: Fix broken IFF_ALLMULTI handling") Fixes: 43fbca02c2dd ("ice: fix lost multicast packets in promisc mode") Signed-off-by: Petr Oros<[email protected]> --- v5: - Reworked after the Sashiko review of the v4 pull. PF VSIs now always use the VLAN agnostic multicast pair, and the per-VID multicast rules and their handling in ice_vlan_rx_add_vid() and ice_vlan_rx_kill_vid() are gone. - The multicast subscription is reconciled from IFF_PROMISC and IFF_ALLMULTI in one place, so clearing allmulti keeps the subscription of a promiscuous VSI unless another VSI holds the DFLT rule. - ice_set_promisc() adds the Rx and the Tx rule separately. - New title, was "ice: skip per-VLAN promisc rules when default VSI Rx rule is set". - Added the Fixes tag for 43fbca02c2dd. - Dropped the Reviewed-by and Tested-by tags because of the rework. v4:https://lore.kernel.org/all/[email protected]/ v3:https://lore.kernel.org/all/[email protected]/ v2:https://lore.kernel.org/all/[email protected]/v1:https://lore.kernel.org/ all/89efbea9831175e6f57e9fe8557f7a0e48e050b7.1781786935.git.po...@redhat.com/
Reviewed-by: Ivan Vecera <[email protected]>
