ice: fix DFLT Rx rule handling for promisc and switchdev
Subsystems (3)
v3 cover ice: fix DFLT Rx rule handling for promisc and switchdev
Two fixes for the uplink default VSI Rx rule (DFLT) on E810 when the netdev is in IFF_PROMISC.
Patch 1 drops the redundant per-VLAN promisc expansion that exhausts the FLU pool on a wide VLAN trunk across several PFs.
Patch 2 keeps the DFLT Rx rule across a switchdev teardown instead of clobbering the promisc state the operator asked for.
Changes since v2:
- Patch 1: dropped the two vid=0 ICE_SW_LKUP_PROMISC <-> ICE_SW_LKUP_PROMISC_VLAN recipe-swap guards; each swap is net-zero and guarding the demote stranded the vid=0 rule when the last VLAN was removed under the DFLT rule.
- Patch 1: drop the now-redundant per-VID multicast promisc rules right after ice_set_dflt_vsi(). A bridge join raises IFF_ALLMULTI and IFF_PROMISC in separate sync passes, so the allmulti pass expands the per-VID rules before the DFLT rule exists; the cleanup keeps them from lingering and exhausting the FLU pool. exit_dflt_promisc() reinstates them on promisc off.
- Patch 1: issue ice_set_promisc(ICE_MCAST_PROMISC_BITS) whenever the netdev is promiscuous, not only when this VSI installs the default VSI rule, so multicast promisc is not lost when the rule is already in use (owned by another VSI, or preserved across a switchdev session).
- Patch 1: hoisted the combined VLAN promisc mask in ice_clear_promisc() into a local for alignment. Dropped Aleksandr's Reviewed-by since the code changed.
- Patch 2: corrected the Fixes tag to 5c07be96d8b3, the commit that made ice_eswitch_setup_env() use the idempotent ice_set_dflt_vsi(); before it a pre-existing promisc DFLT rule made setup fail with -EEXIST so the release path was never reached.
Link to v2:
https://lore.kernel.org/all/[email protected]/
Link to v1:
https://lore.kernel.org/all/[email protected]/
Petr Oros (2):
ice: skip per-VLAN promisc rules when default VSI Rx rule is set
ice: preserve uplink DFLT Rx rule on switchdev release
drivers/net/ethernet/intel/ice/ice_eswitch.c | 18 ++- drivers/net/ethernet/intel/ice/ice_main.c | 111 +++++++++++++++---- 2 files changed, 104 insertions(+), 25 deletions(-)
Signature · 1 line
2.54.0
PATCH v3 1/2 ice: skip per-VLAN promisc rules when default VSI Rx rule is set
When an ice port in a vlan-filtering bridge goes promiscuous (typical for bond slaves), the driver installs a per-VLAN ICE_SW_LKUP_PROMISC_VLAN rule for every VID on top of the broad ICE_SW_LKUP_DFLT VSI Rx rule. Each rule consumes one of the ~32K Flow Lookup Unit (FLU) entries the device shares across PFs, so a wide trunk (vid 2-4094) over several PFs overruns the
pool: firmware rejects further Add Switch Rules with ENOSPC (AQ 0x10) and the DFLT Rx rule itself fails to install:
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
Once a switch context is overrun the retries can also come back as ENOENT (AQ 0x2), which has misled triage toward a perceived recipe binding defect rather than a capacity issue.
The DFLT rule already catches every packet on the port regardless of VLAN tag, so the per-VLAN promisc expansion is redundant while it is installed. Skip it at the two sites that drive it, ice_set_promisc() and ice_vlan_rx_add_vid(), keyed on ice_is_vsi_dflt_vsi() rather than the netdev IFF_PROMISC flag so a failed or LAG-suppressed DFLT install still falls back to the per-VLAN rules.
IFF_ALLMULTI and IFF_PROMISC can reach ice_vsi_sync_fltr() in separate passes (a bridge join sets them through separate calls), so the allmulti pass may expand the per-VID rules before the DFLT rule exists. Drop those now-redundant rules right after ice_set_dflt_vsi() installs the DFLT rule; ice_vsi_exit_dflt_promisc() reinstates them when promisc is cleared.
ice_vsi_sync_fltr() subscribed multicast promiscuity only inside the "default VSI not yet in use" branch, so a promiscuous VSI that finds the default VSI rule already present (owned by another VSI, or preserved across a switchdev session) ended up in unicast promisc with no multicast subscription. Issue ice_set_promisc(ICE_MCAST_PROMISC_BITS) whenever the netdev is promiscuous; it is idempotent and returns 0 if the rule is already present.
---
v3:
- Dropped the two vid=0 ICE_SW_LKUP_PROMISC <-> ICE_SW_LKUP_PROMISC_VLAN recipe-swap guards in ice_vlan_rx_add_vid() and ice_vlan_rx_kill_vid(); each swap is net-zero and guarding the demote stranded the vid=0 rule in ICE_SW_LKUP_PROMISC_VLAN when the last VLAN was removed under the DFLT rule. Reported by review.
- Drop the now-redundant per-VID multicast promisc rules right after ice_set_dflt_vsi(). A bridge join raises IFF_ALLMULTI and IFF_PROMISC in separate sync passes, so the allmulti pass expands the per-VID rules before the DFLT rule exists; the cleanup keeps them from lingering and exhausting the FLU pool. ice_vsi_exit_dflt_promisc() reinstates them on promisc off. Reported by review.
- Issue ice_set_promisc(ICE_MCAST_PROMISC_BITS) whenever the netdev is promiscuous, not only when this VSI installs the default VSI rule, so multicast promisc is not lost when the rule is already in use (owned by another VSI, or preserved across a switchdev session). Reported by review.
- Hoisted the combined VLAN promisc mask in ice_clear_promisc() into a local for alignment. Dropped Aleksandr's Reviewed-by since the code changed.
v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/89efbea9831175e6f57e9fe8557f7a0e48e050b7.1781786935.git.poros@redhat.com/
--- drivers/net/ethernet/intel/ice/ice_main.c | 111 ++++++++++++++++++---- 1 file changed, 90 insertions(+), 21 deletions(-)
drivers/net/ethernet/intel/ice/ice_main.c +90 -21
@@ -274,7 +274,8 @@ static int ice_set_promisc(struct ice_vsi *vsi, u8 promisc_m)if (vsi->type !=ICE_VSI_PF )return 0 ; -if (ice_vsi_has_non_zero_vlans (vsi)) { +/* skip per-VID expansion; the DFLT Rx rule already covers every VID */ +if (ice_vsi_has_non_zero_vlans (vsi) && !ice_is_vsi_dflt_vsi (vsi)) { promisc_m |= (ICE_PROMISC_VLAN_RX |ICE_PROMISC_VLAN_TX ); status =ice_fltr_set_vlan_vsi_promisc (&vsi->back->hw, vsi, promisc_m);
@@ -304,9 +305,20 @@ static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m)return 0 ;if (ice_vsi_has_non_zero_vlans (vsi)) { - promisc_m |= (ICE_PROMISC_VLAN_RX |ICE_PROMISC_VLAN_TX ); +u8 vlan_promisc_m = promisc_m |ICE_PROMISC_VLAN_RX | +ICE_PROMISC_VLAN_TX ; +int vid0_status; + +/* set time used either recipe (per-VID PROMISC_VLAN, or vid=0 +* PROMISC via the ice_set_promisc() else branch), so clear +* both; clearing an absent rule succeeds +*/ status =ice_fltr_clear_vlan_vsi_promisc (&vsi->back->hw, vsi, - promisc_m); + vlan_promisc_m); + vid0_status =ice_fltr_clear_vsi_promisc (&vsi->back->hw, + vsi->idx, promisc_m,0 ); +if (!status) + status = vid0_status; }else { status =ice_fltr_clear_vsi_promisc (&vsi->back->hw, vsi->idx, promisc_m,0 );
@@ -317,6 +329,59 @@ static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m)return status; } +/** +* ice_vsi_exit_dflt_promisc - drop the default VSI Rx rule on promisc off +* @vsi: the VSI leaving promiscuous mode +* +* For an IFF_ALLMULTI VSI with VLANs the per-VID multicast rules are +* reinstated before the default rule is cleared so coverage never lapses; +* the then redundant vid=0 rule is dropped best-effort. The callees log +* their own failures, so error returns are not re-logged here. +* +* Return: 0 on success, negative on error with the default rule left in place. +*/ +static int ice_vsi_exit_dflt_promisc (struct ice_vsi *vsi) +{ +struct ice_vsi_vlan_ops *vlan_ops =ice_get_compat_vsi_vlan_ops (vsi); +struct net_device *netdev = vsi->netdev; +struct ice_hw *hw = &vsi->back->hw; +bool restore_mc; +int err; + + restore_mc = (vsi->current_netdev_flags &IFF_ALLMULTI ) && +ice_vsi_has_non_zero_vlans (vsi); + +if (restore_mc) { + err =ice_fltr_set_vlan_vsi_promisc (hw, vsi, +ICE_MCAST_VLAN_PROMISC_BITS ); +if (err && err != -EEXIST ) +return err; + } + + err =ice_clear_dflt_vsi (vsi); +if (err) +return err; + +if (netdev->features &NETIF_F_HW_VLAN_CTAG_FILTER ) + vlan_ops->ena_rx_filtering (vsi); + +if (restore_mc) +ice_fltr_clear_vsi_promisc (hw, vsi->idx,ICE_MCAST_PROMISC_BITS , +0 ); + +return 0 ; +} + +/* Drop the per-VID multicast promisc rules, redundant once the default +* VSI Rx rule covers every VID. A no-op when the VSI has no VLANs. +*/ +static void ice_vsi_clear_vlan_mc_promisc (struct ice_vsi *vsi) +{ +if (ice_vsi_has_non_zero_vlans (vsi)) +ice_fltr_clear_vlan_vsi_promisc (&vsi->back->hw, vsi, +ICE_MCAST_VLAN_PROMISC_BITS ); +} +/** * ice_vsi_sync_fltr - Update the VSI filter list to the HW * @vsi: ptr to the VSI
@@ -429,30 +494,35 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi) err =0 ; vlan_ops->dis_rx_filtering (vsi); -/* promiscuous mode implies allmulticast so -* that VSIs that are in promiscuous mode are -* subscribed to multicast packets coming to -* the port +/* DFLT now covers every VID; drop the per-VID +* multicast promisc rules a prior IFF_ALLMULTI +* pass may have installed (separate passes on a +* bridge join) so they do not linger and exhaust +* the FLU pool. exit_dflt_promisc() reinstates +* them on promisc off. */ - err =ice_set_promisc (vsi, -ICE_MCAST_PROMISC_BITS ); -if (err) - goto out_promisc; +ice_vsi_clear_vlan_mc_promisc (vsi); } + +/* Promiscuous mode implies allmulticast. Subscribe +* the VSI to all multicast even when the default VSI +* rule is already in use and the block above is +* skipped (it may be owned by another VSI, or +* preserved across a switchdev session); the unicast +* catch-all does not cover the multicast subscription. +*/ + err =ice_set_promisc (vsi,ICE_MCAST_PROMISC_BITS ); +if (err) + goto out_promisc; }else {/* Clear Rx filter to remove traffic from wire */ if (ice_is_vsi_dflt_vsi (vsi)) { - err =ice_clear_dflt_vsi (vsi); + err =ice_vsi_exit_dflt_promisc (vsi);if (err) { -netdev_err (netdev,"Error %d clearing default VSI %i Rx rule\n" , - err, vsi->vsi_num); vsi->current_netdev_flags |=IFF_PROMISC ; goto out_promisc; } -if (vsi->netdev->features & -NETIF_F_HW_VLAN_CTAG_FILTER ) - vlan_ops->ena_rx_filtering (vsi); }/* disable allmulti here, but only if allmulti is not
@@ -3676,10 +3746,9 @@ int ice_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid)while (test_and_set_bit (ICE_CFG_BUSY , vsi->state))usleep_range (1000 ,2000 ); -/* Add multicast promisc rule for the VLAN ID to be added if -* all-multicast is currently enabled. -*/ -if (vsi->current_netdev_flags &IFF_ALLMULTI ) { +/* skip the per-VID rule when the DFLT Rx rule already covers this VID */ +if ((vsi->current_netdev_flags &IFF_ALLMULTI ) && + !ice_is_vsi_dflt_vsi (vsi)) { ret =ice_fltr_set_vsi_promisc (&vsi->back->hw, vsi->idx,ICE_MCAST_VLAN_PROMISC_BITS , vid);
Signature · 1 line
2.54.0
Re: [Intel-wired-lan] [PATCH iwl-net v3 1/2] ice: skip per-VLAN promisc rules when default VSI Rx rule is set
Quoted 82 lines · Petr Oros
When an ice port in a vlan-filtering bridge goes promiscuous (typical for bond slaves), the driver installs a per-VLAN
ICE_SW_LKUP_PROMISC_VLANrule for every VID on top of the broadICE_SW_LKUP_DFLTVSI Rx rule. Each rule consumes one of the ~32K Flow Lookup Unit (FLU) entries the device shares across PFs, so a wide trunk (vid 2-4094) over several PFs overruns the
pool: firmware rejects further Add Switch Rules with ENOSPC (AQ0x10) and the DFLT Rx rule itself fails to install: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 ruleOnce a switch context is overrun the retries can also come back as ENOENT (AQ
0x2), which has misled triage toward a perceived recipe binding defect rather than a capacity issue.The DFLT rule already catches every packet on the port regardless of VLAN tag, so the per-VLAN promisc expansion is redundant while it is installed. Skip it at the two sites that drive it,
ice_set_promisc()andice_vlan_rx_add_vid(), keyed onice_is_vsi_dflt_vsi()rather than the netdevIFF_PROMISCflag so a failed or LAG-suppressed DFLT install still falls back to the per-VLAN rules.
IFF_ALLMULTIandIFF_PROMISCcan reachice_vsi_sync_fltr()in separate passes (a bridge join sets them through separate calls), so the allmulti pass may expand the per-VID rules before the DFLT rule exists. Drop those now-redundant rules right afterice_set_dflt_vsi()installs the DFLT rule;ice_vsi_exit_dflt_promisc()reinstates them when promisc is cleared.
ice_vsi_sync_fltr()subscribed multicast promiscuity only inside the "default VSI not yet in use" branch, so a promiscuous VSI that finds the default VSI rule already present (owned by another VSI, or preserved across a switchdev session) ended up in unicast promisc with no multicast subscription. Issueice_set_promisc(ICE_MCAST_PROMISC_BITS)whenever the netdev is promiscuous; it is idempotent and returns 0 if the rule is already present.Fixes 1273f89578f2 ("ice: Fix broken IFF_ALLMULTI handling")Signed-off-by Petr Oros <[email protected]>---
v3:
- Dropped the two vid=0ICE_SW_LKUP_PROMISC<->ICE_SW_LKUP_PROMISC_VLANrecipe-swap guards inice_vlan_rx_add_vid()andice_vlan_rx_kill_vid(); each swap is net-zero and guarding the demote stranded the vid=0 rule inICE_SW_LKUP_PROMISC_VLANwhen the last VLAN was removed under the DFLT rule. Reported by review.
- Drop the now-redundant per-VID multicast promisc rules right afterice_set_dflt_vsi(). A bridge join raisesIFF_ALLMULTIandIFF_PROMISCin separate sync passes, so the allmulti pass expands the per-VID rules before the DFLT rule exists; the cleanup keeps them from lingering and exhausting the FLU pool.ice_vsi_exit_dflt_promisc()reinstates them on promisc off. Reported by review.
- Issueice_set_promisc(ICE_MCAST_PROMISC_BITS)whenever the netdev is promiscuous, not only when this VSI installs the default VSI rule, so multicast promisc is not lost when the rule is already in use (owned by another VSI, or preserved across a switchdev session). Reported by review.
- Hoisted the combined VLAN promisc mask inice_clear_promisc()into a local for alignment. Dropped Aleksandr's Reviewed-by since the code changed.v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/89efbea9831175e6f57e9fe8557f7a0e48e050b7.1781786935.git.poros@redhat.com/--- drivers/net/ethernet/intel/ice/ice_main.c | 111 ++++++++++++++++++---- 1 file changed, 90 insertions(+), 21 deletions(-)drivers/net/ethernet/intel/ice/ice_main.c +2
-1@@ -274,7 +274,8 @@ static int ice_set_promisc(struct ice_vsi *vsi, u8 promisc_m)if (vsi->type !=ICE_VSI_PF )return 0 ; -if (ice_vsi_has_non_zero_vlans (vsi)) { +/* skip per-VID expansion; the DFLT Rx rule already covers every VID */ +if (ice_vsi_has_non_zero_vlans (vsi) && !ice_is_vsi_dflt_vsi (vsi)) { promisc_m |= (ICE_PROMISC_VLAN_RX |ICE_PROMISC_VLAN_TX ); status =ice_fltr_set_vlan_vsi_promisc (&vsi->back->hw, vsi, promisc_m);
drivers/net/ethernet/intel/ice/ice_main.c static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m) · line 312
Quoted 9 lines
drivers/net/ethernet/intel/ice/ice_main.c +5
-1@@ -304,9 +305,20 @@ static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m)return 0 ;if (ice_vsi_has_non_zero_vlans (vsi)) { - promisc_m |= (ICE_PROMISC_VLAN_RX |ICE_PROMISC_VLAN_TX ); +u8 vlan_promisc_m = promisc_m |ICE_PROMISC_VLAN_RX | +ICE_PROMISC_VLAN_TX ; +int vid0_status; + +/* set time used either recipe (per-VID PROMISC_VLAN, or vid=0
I find this sentence hard to understand - did you mean "ice_set_promisc() used either recipe..."?
drivers/net/ethernet/intel/ice/ice_main.c static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m) · line 314
Quoted 2 lines
drivers/net/ethernet/intel/ice/ice_main.c +2
-0+* PROMISC via the ice_set_promisc() else branch), so clear +* both; clearing an absent rule succeeds
What do you mean by this? Both will return -EEXIST if rule is absent. There can also be other errors.
Quoted 54 lines
drivers/net/ethernet/intel/ice/ice_main.c +45
-1+*/ status =ice_fltr_clear_vlan_vsi_promisc (&vsi->back->hw, vsi, - promisc_m); + vlan_promisc_m); + vid0_status =ice_fltr_clear_vsi_promisc (&vsi->back->hw, + vsi->idx, promisc_m,0 ); +if (status ==0 ) + status = vid0_status; }else { status =ice_fltr_clear_vsi_promisc (&vsi->back->hw, vsi->idx, promisc_m,0 );@@ -317,6 +329,59 @@ static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m)return status; } +/** +* ice_vsi_exit_dflt_promisc - drop the default VSI Rx rule on promisc off +* @vsi: the VSI leaving promiscuous mode +* +* For an IFF_ALLMULTI VSI with VLANs the per-VID multicast rules are +* reinstated before the default rule is cleared so coverage never lapses; +* the then redundant vid=0 rule is dropped best-effort. The callees log +* their own failures, so error returns are not re-logged here. +* +* Return: 0 on success, negative on error with the default rule left in place. +*/ +static int ice_vsi_exit_dflt_promisc (struct ice_vsi *vsi) +{ +struct ice_vsi_vlan_ops *vlan_ops =ice_get_compat_vsi_vlan_ops (vsi); +struct net_device *netdev = vsi->netdev; +struct ice_hw *hw = &vsi->back->hw; +bool restore_mc; +int err; + + restore_mc = (vsi->current_netdev_flags &IFF_ALLMULTI ) && +ice_vsi_has_non_zero_vlans (vsi); + +if (restore_mc) { + err =ice_fltr_set_vlan_vsi_promisc (hw, vsi, +ICE_MCAST_VLAN_PROMISC_BITS ); +if (err && err != -EEXIST ) +return err; + } + + err =ice_clear_dflt_vsi (vsi); +if (err) +return err; + +if (netdev->features &NETIF_F_HW_VLAN_CTAG_FILTER ) + vlan_ops->ena_rx_filtering (vsi); + +if (restore_mc) +ice_fltr_clear_vsi_promisc (hw, vsi->idx,ICE_MCAST_PROMISC_BITS , +0 );
drivers/net/ethernet/intel/ice/ice_main.c static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m) · line 380
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice_main.c +10
-0+ +return 0 ; +} + +/* Drop the per-VID multicast promisc rules, redundant once the default +* VSI Rx rule covers every VID. A no-op when the VSI has no VLANs. +*/ +static void ice_vsi_clear_vlan_mc_promisc (struct ice_vsi *vsi) +{ +if (ice_vsi_has_non_zero_vlans (vsi))
Nit: could flip condition to decrease indent level.
drivers/net/ethernet/intel/ice/ice_main.c static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m) · line 382
Quoted 2 lines
drivers/net/ethernet/intel/ice/ice_main.c +2
-0+ice_fltr_clear_vlan_vsi_promisc (&vsi->back->hw, vsi, +ICE_MCAST_VLAN_PROMISC_BITS );
Error code ignored, not sure if intentionally.
Quoted 8 lines
drivers/net/ethernet/intel/ice/ice_main.c +2
-0+} +/** * ice_vsi_sync_fltr - Update the VSI filter list to the HW * @vsi: ptr to the VSI @@ -429,30 +494,35 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi) err =0 ; vlan_ops->dis_rx_filtering (vsi);
drivers/net/ethernet/intel/ice/ice_main.c static int ice_vsi_sync_fltr(struct ice_vsi *vsi) · line 501
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice_main.c +5
-4-/* promiscuous mode implies allmulticast so -* that VSIs that are in promiscuous mode are -* subscribed to multicast packets coming to -* the port +/* DFLT now covers every VID; drop the per-VID +* multicast promisc rules a prior IFF_ALLMULTI +* pass may have installed (separate passes on a +* bridge join) so they do not linger and exhaust +* the FLU pool. exit_dflt_promisc() reinstates
Please use the full function name.
Quoted 41 lines
drivers/net/ethernet/intel/ice/ice_main.c +14
-10+* them on promisc off. */ - err =ice_set_promisc (vsi, -ICE_MCAST_PROMISC_BITS ); -if (err) - goto out_promisc; +ice_vsi_clear_vlan_mc_promisc (vsi); } + +/* Promiscuous mode implies allmulticast. Subscribe +* the VSI to all multicast even when the default VSI +* rule is already in use and the block above is +* skipped (it may be owned by another VSI, or +* preserved across a switchdev session); the unicast +* catch-all does not cover the multicast subscription. +*/ + err =ice_set_promisc (vsi,ICE_MCAST_PROMISC_BITS ); +if (err) + goto out_promisc; }else {/* Clear Rx filter to remove traffic from wire */ if (ice_is_vsi_dflt_vsi (vsi)) { - err =ice_clear_dflt_vsi (vsi); + err =ice_vsi_exit_dflt_promisc (vsi);if (err) { -netdev_err (netdev,"Error %d clearing default VSI %i Rx rule\n" , - err, vsi->vsi_num); vsi->current_netdev_flags |=IFF_PROMISC ; goto out_promisc; } -if (vsi->netdev->features & -NETIF_F_HW_VLAN_CTAG_FILTER ) - vlan_ops->ena_rx_filtering (vsi); }/* disable allmulti here, but only if allmulti is not @@ -3676,10 +3746,9 @@ int ice_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid)while (test_and_set_bit (ICE_CFG_BUSY , vsi->state))usleep_range (1000 ,2000 );
drivers/net/ethernet/intel/ice/ice_main.c int ice_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid) · line 3754
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice_main.c +3
-4-/* Add multicast promisc rule for the VLAN ID to be added if -* all-multicast is currently enabled. -*/ -if (vsi->current_netdev_flags &IFF_ALLMULTI ) { +/* skip the per-VID rule when the DFLT Rx rule already covers this VID */ +if ((vsi->current_netdev_flags &IFF_ALLMULTI ) && + !ice_is_vsi_dflt_vsi (vsi)) { ret =ice_fltr_set_vsi_promisc (&vsi->back->hw, vsi->idx,ICE_MCAST_VLAN_PROMISC_BITS , vid);
Thanks,
Marcin
Re: [Intel-wired-lan] [PATCH iwl-net v3 1/2] ice: skip per-VLAN promisc rules when default VSI Rx rule is set
Quoted 167 lines · Marcin Szycik
Quoted 82 lines · Petr Oros
When an ice port in a vlan-filtering bridge goes promiscuous (typical for bond slaves), the driver installs a per-VLAN
ICE_SW_LKUP_PROMISC_VLANrule for every VID on top of the broadICE_SW_LKUP_DFLTVSI Rx rule. Each rule consumes one of the ~32K Flow Lookup Unit (FLU) entries the device shares across PFs, so a wide trunk (vid 2-4094) over several PFs overruns the
pool: firmware rejects further Add Switch Rules with ENOSPC (AQ0x10) and the DFLT Rx rule itself fails to install: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 ruleOnce a switch context is overrun the retries can also come back as ENOENT (AQ
0x2), which has misled triage toward a perceived recipe binding defect rather than a capacity issue.The DFLT rule already catches every packet on the port regardless of VLAN tag, so the per-VLAN promisc expansion is redundant while it is installed. Skip it at the two sites that drive it,
ice_set_promisc()andice_vlan_rx_add_vid(), keyed onice_is_vsi_dflt_vsi()rather than the netdevIFF_PROMISCflag so a failed or LAG-suppressed DFLT install still falls back to the per-VLAN rules.
IFF_ALLMULTIandIFF_PROMISCcan reachice_vsi_sync_fltr()in separate passes (a bridge join sets them through separate calls), so the allmulti pass may expand the per-VID rules before the DFLT rule exists. Drop those now-redundant rules right afterice_set_dflt_vsi()installs the DFLT rule;ice_vsi_exit_dflt_promisc()reinstates them when promisc is cleared.
ice_vsi_sync_fltr()subscribed multicast promiscuity only inside the "default VSI not yet in use" branch, so a promiscuous VSI that finds the default VSI rule already present (owned by another VSI, or preserved across a switchdev session) ended up in unicast promisc with no multicast subscription. Issueice_set_promisc(ICE_MCAST_PROMISC_BITS)whenever the netdev is promiscuous; it is idempotent and returns 0 if the rule is already present.Fixes 1273f89578f2 ("ice: Fix broken IFF_ALLMULTI handling")Signed-off-by Petr Oros <[email protected]>---
v3:
- Dropped the two vid=0ICE_SW_LKUP_PROMISC<->ICE_SW_LKUP_PROMISC_VLANrecipe-swap guards inice_vlan_rx_add_vid()andice_vlan_rx_kill_vid(); each swap is net-zero and guarding the demote stranded the vid=0 rule inICE_SW_LKUP_PROMISC_VLANwhen the last VLAN was removed under the DFLT rule. Reported by review.
- Drop the now-redundant per-VID multicast promisc rules right afterice_set_dflt_vsi(). A bridge join raisesIFF_ALLMULTIandIFF_PROMISCin separate sync passes, so the allmulti pass expands the per-VID rules before the DFLT rule exists; the cleanup keeps them from lingering and exhausting the FLU pool.ice_vsi_exit_dflt_promisc()reinstates them on promisc off. Reported by review.
- Issueice_set_promisc(ICE_MCAST_PROMISC_BITS)whenever the netdev is promiscuous, not only when this VSI installs the default VSI rule, so multicast promisc is not lost when the rule is already in use (owned by another VSI, or preserved across a switchdev session). Reported by review.
- Hoisted the combined VLAN promisc mask inice_clear_promisc()into a local for alignment. Dropped Aleksandr's Reviewed-by since the code changed.v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/89efbea9831175e6f57e9fe8557f7a0e48e050b7.1781786935.git.poros@redhat.com/--- drivers/net/ethernet/intel/ice/ice_main.c | 111 ++++++++++++++++++---- 1 file changed, 90 insertions(+), 21 deletions(-)drivers/net/ethernet/intel/ice/ice_main.c +2
-1@@ -274,7 +274,8 @@ static int ice_set_promisc(struct ice_vsi *vsi, u8 promisc_m)if (vsi->type !=ICE_VSI_PF )return 0 ; -if (ice_vsi_has_non_zero_vlans (vsi)) { +/* skip per-VID expansion; the DFLT Rx rule already covers every VID */ +if (ice_vsi_has_non_zero_vlans (vsi) && !ice_is_vsi_dflt_vsi (vsi)) { promisc_m |= (ICE_PROMISC_VLAN_RX |ICE_PROMISC_VLAN_TX ); status =ice_fltr_set_vlan_vsi_promisc (&vsi->back->hw, vsi, promisc_m);drivers/net/ethernet/intel/ice/ice_main.c static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m) · line 312
Quoted 9 lines
drivers/net/ethernet/intel/ice/ice_main.c +5
-1@@ -304,9 +305,20 @@ static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m)return 0 ;if (ice_vsi_has_non_zero_vlans (vsi)) { - promisc_m |= (ICE_PROMISC_VLAN_RX |ICE_PROMISC_VLAN_TX ); +u8 vlan_promisc_m = promisc_m |ICE_PROMISC_VLAN_RX | +ICE_PROMISC_VLAN_TX ; +int vid0_status; + +/* set time used either recipe (per-VID PROMISC_VLAN, or vid=0 I find this sentence hard to understand - did you mean "
ice_set_promisc()used either recipe..."?drivers/net/ethernet/intel/ice/ice_main.c static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m) · line 314
Quoted 2 lines
drivers/net/ethernet/intel/ice/ice_main.c +2
-0+* PROMISC via the ice_set_promisc() else branch), so clear +* both; clearing an absent rule succeeds What do you mean by this? Both will return
-EEXISTif rule is absent. There can also be other errors.Quoted 54 lines
drivers/net/ethernet/intel/ice/ice_main.c +45
-1+*/ status =ice_fltr_clear_vlan_vsi_promisc (&vsi->back->hw, vsi, - promisc_m); + vlan_promisc_m); + vid0_status =ice_fltr_clear_vsi_promisc (&vsi->back->hw, + vsi->idx, promisc_m,0 ); +if (status ==0 ) + status = vid0_status; }else { status =ice_fltr_clear_vsi_promisc (&vsi->back->hw, vsi->idx, promisc_m,0 );@@ -317,6 +329,59 @@ static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m)return status; } +/** +* ice_vsi_exit_dflt_promisc - drop the default VSI Rx rule on promisc off +* @vsi: the VSI leaving promiscuous mode +* +* For an IFF_ALLMULTI VSI with VLANs the per-VID multicast rules are +* reinstated before the default rule is cleared so coverage never lapses; +* the then redundant vid=0 rule is dropped best-effort. The callees log +* their own failures, so error returns are not re-logged here. +* +* Return: 0 on success, negative on error with the default rule left in place. +*/ +static int ice_vsi_exit_dflt_promisc (struct ice_vsi *vsi) +{ +struct ice_vsi_vlan_ops *vlan_ops =ice_get_compat_vsi_vlan_ops (vsi); +struct net_device *netdev = vsi->netdev; +struct ice_hw *hw = &vsi->back->hw; +bool restore_mc; +int err; + + restore_mc = (vsi->current_netdev_flags &IFF_ALLMULTI ) && +ice_vsi_has_non_zero_vlans (vsi); + +if (restore_mc) { + err =ice_fltr_set_vlan_vsi_promisc (hw, vsi, +ICE_MCAST_VLAN_PROMISC_BITS ); +if (err && err != -EEXIST ) +return err; + } + + err =ice_clear_dflt_vsi (vsi); +if (err) +return err; + +if (netdev->features &NETIF_F_HW_VLAN_CTAG_FILTER ) + vlan_ops->ena_rx_filtering (vsi); + +if (restore_mc) +ice_fltr_clear_vsi_promisc (hw, vsi->idx,ICE_MCAST_PROMISC_BITS , +0 );drivers/net/ethernet/intel/ice/ice_main.c static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m) · line 380
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice_main.c +10
-0+ +return 0 ; +} + +/* Drop the per-VID multicast promisc rules, redundant once the default +* VSI Rx rule covers every VID. A no-op when the VSI has no VLANs. +*/ +static void ice_vsi_clear_vlan_mc_promisc (struct ice_vsi *vsi) +{ +if (ice_vsi_has_non_zero_vlans (vsi))Nit: could flip condition to decrease indent level.
Quoted 3 lines
drivers/net/ethernet/intel/ice/ice_main.c static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m) · line 382
Quoted 2 lines
drivers/net/ethernet/intel/ice/ice_main.c +2
-0+ice_fltr_clear_vlan_vsi_promisc (&vsi->back->hw, vsi, +ICE_MCAST_VLAN_PROMISC_BITS );Error code ignored, not sure if intentionally.
The ignored error code is intentional: it only drops rules made redundant by the default VSI rule, and a leftover is harmless while that rule is installed.
I will address all the comment/style points in v4.
Many thanks,
Petr
Quoted 75 lines
Quoted 9 lines
drivers/net/ethernet/intel/ice/ice_main.c +2
-0+} +/** * ice_vsi_sync_fltr - Update the VSI filter list to the HW * @vsi: ptr to the VSI @@ -429,30 +494,35 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi) err =0 ; vlan_ops->dis_rx_filtering (vsi);drivers/net/ethernet/intel/ice/ice_main.c static int ice_vsi_sync_fltr(struct ice_vsi *vsi) · line 501
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice_main.c +5
-4-/* promiscuous mode implies allmulticast so -* that VSIs that are in promiscuous mode are -* subscribed to multicast packets coming to -* the port +/* DFLT now covers every VID; drop the per-VID +* multicast promisc rules a prior IFF_ALLMULTI +* pass may have installed (separate passes on a +* bridge join) so they do not linger and exhaust +* the FLU pool. exit_dflt_promisc() reinstates Please use the full function name.
Quoted 41 lines
drivers/net/ethernet/intel/ice/ice_main.c +14
-10+* them on promisc off. */ - err =ice_set_promisc (vsi, -ICE_MCAST_PROMISC_BITS ); -if (err) - goto out_promisc; +ice_vsi_clear_vlan_mc_promisc (vsi); } + +/* Promiscuous mode implies allmulticast. Subscribe +* the VSI to all multicast even when the default VSI +* rule is already in use and the block above is +* skipped (it may be owned by another VSI, or +* preserved across a switchdev session); the unicast +* catch-all does not cover the multicast subscription. +*/ + err =ice_set_promisc (vsi,ICE_MCAST_PROMISC_BITS ); +if (err) + goto out_promisc; }else {/* Clear Rx filter to remove traffic from wire */ if (ice_is_vsi_dflt_vsi (vsi)) { - err =ice_clear_dflt_vsi (vsi); + err =ice_vsi_exit_dflt_promisc (vsi);if (err) { -netdev_err (netdev,"Error %d clearing default VSI %i Rx rule\n" , - err, vsi->vsi_num); vsi->current_netdev_flags |=IFF_PROMISC ; goto out_promisc; } -if (vsi->netdev->features & -NETIF_F_HW_VLAN_CTAG_FILTER ) - vlan_ops->ena_rx_filtering (vsi); }/* disable allmulti here, but only if allmulti is not @@ -3676,10 +3746,9 @@ int ice_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid)while (test_and_set_bit (ICE_CFG_BUSY , vsi->state))usleep_range (1000 ,2000 );drivers/net/ethernet/intel/ice/ice_main.c int ice_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid) · line 3754
Quoted 10 lines
drivers/net/ethernet/intel/ice/ice_main.c +3
-4-/* Add multicast promisc rule for the VLAN ID to be added if -* all-multicast is currently enabled. -*/ -if (vsi->current_netdev_flags &IFF_ALLMULTI ) { +/* skip the per-VID rule when the DFLT Rx rule already covers this VID */ +if ((vsi->current_netdev_flags &IFF_ALLMULTI ) && + !ice_is_vsi_dflt_vsi (vsi)) { ret =ice_fltr_set_vsi_promisc (&vsi->back->hw, vsi->idx,ICE_MCAST_VLAN_PROMISC_BITS , vid);Thanks,
Marcin
PATCH v3 2/2 ice: preserve uplink DFLT Rx rule on switchdev release
In reply to Petr OrosWhen the uplink PF is promiscuous, ice_vsi_sync_fltr() installs an ICE_SW_LKUP_DFLT catch-all Rx rule on the uplink VSI. Entering switchdev re-affirms it through the idempotent ice_set_dflt_vsi(), but ice_eswitch_release_env() removed both the Rx and Tx DFLT rules unconditionally on teardown. That clobbered a promisc-owned Rx rule: it disappeared while IFF_PROMISC was still set and the sync path was not retriggered, leaving the uplink without the catch-all the netdev requested.
Skip the Rx DFLT removal when the uplink is promiscuous, both in ice_eswitch_release_env() and the err_def_tx unwind of ice_eswitch_setup_env(); the Tx leg, owned by switchdev, is still removed. Test the live netdev->flags, the same value ena_rx_filtering() -> ice_cfg_vlan_pruning() above already keys on, so the preserved rule and the pruning state stay consistent, including for a promisc change made while switchdev ran (which never reached the gated filter sync).
---
v3:
- Corrected the Fixes tag from 1a1c40df2e80 ("ice: set and release switchdev environment") to 5c07be96d8b3 ("ice: Avoid setting default Rx VSI twice in switchdev setup"), the commit that made ice_eswitch_setup_env() use the idempotent ice_set_dflt_vsi(); before it a pre-existing promisc DFLT rule made setup fail with -EEXIST so the release path was never reached. No code change.
v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/deef5756e534ef06c12d910c5305d3fd205d30a0.1781786935.git.poros@redhat.com/
--- drivers/net/ethernet/intel/ice/ice_eswitch.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/ice/ice_eswitch.c +14 -4
@@ -66,8 +66,10 @@ static int ice_eswitch_setup_env(struct ice_pf *pf)ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, false,ICE_FLTR_TX ); err_def_tx: -ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, false, -ICE_FLTR_RX ); +/* keep the Rx DFLT rule if the uplink is promiscuous (see release_env) */ +if (!(uplink_vsi->netdev->flags &IFF_PROMISC )) +ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, + false,ICE_FLTR_RX ); err_def_rx:ice_vsi_del_vlan_zero (uplink_vsi); err_vlan_zero:
@@ -276,8 +278,16 @@ static void ice_eswitch_release_env(struct ice_pf *pf) vlan_ops->ena_rx_filtering (uplink_vsi);ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, false,ICE_FLTR_TX ); -ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, false, -ICE_FLTR_RX ); + +/* Keep the Rx DFLT rule if the uplink is promiscuous; it must outlive +* the session. Test the live netdev->flags, the same value +* ena_rx_filtering() -> ice_cfg_vlan_pruning() above keys its decision +* on, so the preserved DFLT rule and the pruning state stay consistent. +*/ +if (!(uplink_vsi->netdev->flags &IFF_PROMISC )) +ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, + false,ICE_FLTR_RX ); +ice_fltr_add_mac_and_broadcast (uplink_vsi, uplink_vsi->port_info->mac.perm_addr,ICE_FWD_TO_VSI );
Signature · 1 line
2.54.0
Re: [Intel-wired-lan] [PATCH iwl-net v3 2/2] ice: preserve uplink DFLT Rx rule on switchdev release
Quoted 17 lines · Petr Oros
When the uplink PF is promiscuous,
ice_vsi_sync_fltr()installs anICE_SW_LKUP_DFLTcatch-all Rx rule on the uplink VSI. Entering switchdev re-affirms it through the idempotentice_set_dflt_vsi(), butice_eswitch_release_env()removed both the Rx and Tx DFLT rules unconditionally on teardown. That clobbered a promisc-owned Rx rule: it disappeared whileIFF_PROMISCwas still set and the sync path was not retriggered, leaving the uplink without the catch-all the netdev requested.Skip the Rx DFLT removal when the uplink is promiscuous, both in
ice_eswitch_release_env()and theerr_def_txunwind ofice_eswitch_setup_env(); the Tx leg, owned by switchdev, is still removed. Test the livenetdev->flags, the same valueena_rx_filtering()->ice_cfg_vlan_pruning()above already keys on, so the preserved rule and the pruning state stay consistent, including for a promisc change made while switchdev ran (which never reached the gated filter sync).
Quoted 2 lines
Fixes 5c07be96d8b3 ("ice: Avoid setting default Rx VSI twice in switchdev setup")Signed-off-by Petr Oros <[email protected]>
Quoted 51 lines
---
v3:
- Corrected the Fixes tag from1a1c40df2e80("ice: set and release switchdev environment") to5c07be96d8b3("ice: Avoid setting default Rx VSI twice in switchdev setup"), the commit that madeice_eswitch_setup_env()use the idempotentice_set_dflt_vsi(); before it a pre-existing promisc DFLT rule made setup fail with-EEXISTso the release path was never reached. No code change.v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/deef5756e534ef06c12d910c5305d3fd205d30a0.1781786935.git.poros@redhat.com/--- drivers/net/ethernet/intel/ice/ice_eswitch.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)drivers/net/ethernet/intel/ice/ice_eswitch.c +14
-4@@ -66,8 +66,10 @@ static int ice_eswitch_setup_env(struct ice_pf *pf)ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, false,ICE_FLTR_TX ); err_def_tx: -ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, false, -ICE_FLTR_RX ); +/* keep the Rx DFLT rule if the uplink is promiscuous (see release_env) */ +if (!(uplink_vsi->netdev->flags &IFF_PROMISC )) +ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, + false,ICE_FLTR_RX ); err_def_rx:ice_vsi_del_vlan_zero (uplink_vsi); err_vlan_zero:@@ -276,8 +278,16 @@ static void ice_eswitch_release_env(struct ice_pf *pf) vlan_ops->ena_rx_filtering (uplink_vsi);ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, false,ICE_FLTR_TX ); -ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, false, -ICE_FLTR_RX ); + +/* Keep the Rx DFLT rule if the uplink is promiscuous; it must outlive +* the session. Test the live netdev->flags, the same value +* ena_rx_filtering() -> ice_cfg_vlan_pruning() above keys its decision +* on, so the preserved DFLT rule and the pruning state stay consistent. +*/ +if (!(uplink_vsi->netdev->flags &IFF_PROMISC )) +ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, + false,ICE_FLTR_RX ); +ice_fltr_add_mac_and_broadcast (uplink_vsi, uplink_vsi->port_info->mac.perm_addr,ICE_FWD_TO_VSI );
RE: [Intel-wired-lan] [PATCH iwl-net v3 2/2] ice: preserve uplink DFLT Rx rule on switchdev release
In reply to Petr OrosQuoted 103 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Petr Oros
Sent: Wednesday, July 1, 2026 3:36 PM
To: [email protected]
Cc: Vecera, Ivan <[email protected]>; Alice Michael <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Eric Dumazet <[email protected]>; [email protected]; Martyna Szapar-Mudlaw <martyna.szapar- [email protected]>; Andrew Lunn <[email protected]>; Marcin Szycik <[email protected]>; Nguyen, Anthony L <[email protected]>; Simon Horman <[email protected]>; intel- [email protected]; Keller, Jacob E <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; David S. Miller <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-net v3 2/2] ice: preserve uplink DFLT Rx rule on switchdev releaseWhen the uplink PF is promiscuous,
ice_vsi_sync_fltr()installs anICE_SW_LKUP_DFLTcatch-all Rx rule on the uplink VSI. Entering switchdev re-affirms it through the idempotentice_set_dflt_vsi(), butice_eswitch_release_env()removed both the Rx and Tx DFLT rules unconditionally on teardown. That clobbered a promisc-owned Rx rule:
it disappeared whileIFF_PROMISCwas still set and the sync path was not retriggered, leaving the uplink without the catch-all the netdev requested.Skip the Rx DFLT removal when the uplink is promiscuous, both in
ice_eswitch_release_env()and theerr_def_txunwind ofice_eswitch_setup_env(); the Tx leg, owned by switchdev, is still removed.
Test the livenetdev->flags, the same valueena_rx_filtering()->ice_cfg_vlan_pruning()above already keys on, so the preserved rule and the pruning state stay consistent, including for a promisc change made while switchdev ran (which never reached the gated filter sync).Fixes 5c07be96d8b3 ("ice: Avoid setting default Rx VSI twice inswitchdev setup")
Signed-off-by Petr Oros <[email protected]>---
v3:
- Corrected the Fixes tag from1a1c40df2e80("ice: set and release switchdev environment") to5c07be96d8b3("ice: Avoid setting default Rx VSI twice in switchdev setup"), the commit that madeice_eswitch_setup_env()use the idempotentice_set_dflt_vsi();
before
it a pre-existing promisc DFLT rule made setup fail with-EEXISTso
the
release path was never reached. No code change.v2: https://lore.kernel.org/all/20260622113428.2565255-3-
[email protected]/
v1:
https://lore.kernel.org/all/deef5756e534ef06c12d910c5305d3fd205d30a0.1
[email protected]/--- drivers/net/ethernet/intel/ice/ice_eswitch.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)drivers/net/ethernet/intel/ice/ice_eswitch.c +1
-2@@ -66,8 +66,10 @@ static int ice_eswitch_setup_env(struct ice_pf *pf)ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, false,ICE_FLTR_TX ); err_def_tx: -ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, false, -ICE_FLTR_RX ); +/* keep the Rx DFLT rule if the uplink is promiscuous (see
release_env) */drivers/net/ethernet/intel/ice/ice_eswitch.c +5
-2+if (!(uplink_vsi->netdev->flags &IFF_PROMISC )) +ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, + false,ICE_FLTR_RX ); err_def_rx:ice_vsi_del_vlan_zero (uplink_vsi); err_vlan_zero:@@ -276,8 +278,16 @@ static void ice_eswitch_release_env(struct ice_pf *pf) vlan_ops->ena_rx_filtering (uplink_vsi);ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, false,ICE_FLTR_TX ); -ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, false, -ICE_FLTR_RX ); + +/* Keep the Rx DFLT rule if the uplink is promiscuous; it must outlive
drivers/net/ethernet/intel/ice/ice_eswitch.c +2
-0+* the session. Test the live netdev->flags, the same value +* ena_rx_filtering() -> ice_cfg_vlan_pruning() above keys its decision
drivers/net/ethernet/intel/ice/ice_eswitch.c +1
-0+* on, so the preserved DFLT rule and the pruning state stay consistent.
drivers/net/ethernet/intel/ice/ice_eswitch.c +5
-0+*/ +if (!(uplink_vsi->netdev->flags &IFF_PROMISC )) +ice_cfg_dflt_vsi (uplink_vsi->port_info, uplink_vsi->idx, + false,ICE_FLTR_RX ); + ice_fltr_add_mac_and_broadcast(uplink_vsi, uplink_vsi->port_info-Quoted 1 line
mac.perm_addr,
Quoted 3 lines
ICE_FWD_TO_VSI);
--
2.54.0