Skip to contentSkip to conversation

ice: Fix incorrect LLDP filter assumptions

PATCH In review Dave Ertman 4 participants 6 messages Aug 11 – Oct 21

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ice: Fix incorrect LLDP filter assumptions

In commit 4d5a1c4e6d49 ("ice: do not add LLDP-specific filter if not necessary"), it was assumed that llpd_fltr_ctrl was a unique application of a filter instance and the other command in the flow was generic. This is an incorrect assumption, they are both meant to add a filter to handle LLDP packets and only varied in the actual AQ call made. The newer AQ call was created to handle a special case in some NVM images where a LLDP filter was already existent and the old AQ command would generate an error if a new filter was attempted to be added. The newer AQ command would detect this case and instead would add the current target to the existing filter rule.

Fix the flow so that the newer command is always used if available and only fall back to the older command when that is the only solution.

Also remove the obsolete state flag from the PF struct.

Fixes 4d5a1c4e6d49 ("ice: do not add LLDP-specific filter if not necessary")
---
 drivers/net/ethernet/intel/ice/ice.h     |  1 -
 drivers/net/ethernet/intel/ice/ice_lib.c | 18 +++++-------------
 2 files changed, 5 insertions(+), 14 deletions(-)
drivers/net/ethernet/intel/ice/ice.h +0 -1
index fc91b6665f90..7eaa3d1e78a5 100644
@@ -522,7 +522,6 @@ enum ice_pf_flags {
 	ICE_FLAG_MTU_CHANGED,
 	ICE_FLAG_GNSS,			/* GNSS successfully initialized */
 	ICE_FLAG_DPLL,			/* SyncE/PTP dplls initialized */
-	ICE_FLAG_LLDP_AQ_FLTR,
 	ICE_PF_FLAGS_NBITS		/* must be last */
 };
 
drivers/net/ethernet/intel/ice/ice_lib.c +5 -13
index 8cdc4fda89e9..2fe91ff8119f 100644
@@ -2090,24 +2090,16 @@ void ice_vsi_cfg_sw_lldp(struct ice_vsi *vsi, bool tx, bool create)
 		status = eth_fltr(vsi, ETH_P_LLDP, ICE_FLTR_TX,
 				  ICE_DROP_PACKET);
 	} else {
-		if (!test_bit(ICE_FLAG_LLDP_AQ_FLTR, pf->flags)) {
+		status = ice_lldp_fltr_add_remove(&pf->hw, vsi, create);
+		if (status == -EOPNOTSUPP) {
+			/* If fltr_ctrl not supported, use legacy
+			 * add/remove command
+			 */
 			status = eth_fltr(vsi, ETH_P_LLDP, ICE_FLTR_RX,
 					  ICE_FWD_TO_VSI);
-			if (!status || !create)
-				goto report;
-
-			dev_info(dev,
-				 "Failed to add generic LLDP Rx filter on VSI %i error: %d, falling back to specialized AQ control\n",
-				 vsi->vsi_num, status);
 		}
-
-		status = ice_lldp_fltr_add_remove(&pf->hw, vsi, create);
-		if (!status)
-			set_bit(ICE_FLAG_LLDP_AQ_FLTR, pf->flags);
-
 	}
 
-report:
 	if (status)
 		dev_warn(dev, "Failed to %s %s LLDP rule on VSI %i error: %d\n",
 			 create ? "add" : "remove", tx ? "Tx" : "Rx",
Signature · 1 line
2.55.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 88 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Dave Ertman
Sent: Tuesday, August 11, 2026 8:11 PM
To: [email protected]
Cc: [email protected]; Kitszel, Przemyslaw <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-net v2] ice: Fix incorrect LLDP filter assumptions

In commit 4d5a1c4e6d49 ("ice: do not add LLDP-specific filter if not necessary"), it was assumed that llpd_fltr_ctrl was a unique application of a filter instance and the other command in the flow was generic.
This is an incorrect assumption, they are both meant to add a filter to handle LLDP packets and only varied in the actual AQ call made. The newer AQ call was created to handle a special case in some NVM images where a LLDP filter was already existent and the old AQ command would generate an error if a new filter was attempted to be added. The newer AQ command would detect this case and instead would add the current target to the existing filter rule.

Fix the flow so that the newer command is always used if available and only fall back to the older command when that is the only solution.

Also remove the obsolete state flag from the PF struct.

Fixes 4d5a1c4e6d49 ("ice: do not add LLDP-specific filter if not

necessary")

---
 drivers/net/ethernet/intel/ice/ice.h     |  1 -
 drivers/net/ethernet/intel/ice/ice_lib.c | 18 +++++-------------
 2 files changed, 5 insertions(+), 14 deletions(-)
drivers/net/ethernet/intel/ice/ice.h +0 -0
index fc91b6665f90..7eaa3d1e78a5 100644
@@ -522,7 +522,6 @@ enum ice_pf_flags {
 	ICE_FLAG_MTU_CHANGED,
 	ICE_FLAG_GNSS,			/* GNSS successfully

initialized */
ICE_FLAG_DPLL, /* SyncE/PTP dplls
initialized */

drivers/net/ethernet/intel/ice/ice.h +0 -1
-	ICE_FLAG_LLDP_AQ_FLTR,
 	ICE_PF_FLAGS_NBITS		/* must be last */
 };
drivers/net/ethernet/intel/ice/ice_lib.c +5 -13
index 8cdc4fda89e9..2fe91ff8119f 100644
@@ -2090,24 +2090,16 @@ void ice_vsi_cfg_sw_lldp(struct ice_vsi *vsi,
 bool tx, bool create)
 		status = eth_fltr(vsi, ETH_P_LLDP, ICE_FLTR_TX,
 				  ICE_DROP_PACKET);
 	} else {
-		if (!test_bit(ICE_FLAG_LLDP_AQ_FLTR, pf->flags)) {
+		status = ice_lldp_fltr_add_remove(&pf->hw, vsi, create);
+		if (status == -EOPNOTSUPP) {
+			/* If fltr_ctrl not supported, use legacy
+			 * add/remove command
+			 */
 			status = eth_fltr(vsi, ETH_P_LLDP, ICE_FLTR_RX,
 					  ICE_FWD_TO_VSI);
-			if (!status || !create)
-				goto report;
-
-			dev_info(dev,
-				 "Failed to add generic LLDP Rx filter on
 VSI %i error: %d, falling back to specialized AQ control\n",
-				 vsi->vsi_num, status);
 		}
-
-		status = ice_lldp_fltr_add_remove(&pf->hw, vsi, create);
-		if (!status)
-			set_bit(ICE_FLAG_LLDP_AQ_FLTR, pf->flags);
-
 	}
 
-report:
 	if (status)
Quoted 5 lines

dev_warn(dev, "Failed to %s %s LLDP rule on VSI %i
error: %d\n",
create ? "add" : "remove", tx ? "Tx" : "Rx",
--
2.55.0

reviewer Reviewed-by on v2 1/1
#2 lore raw
In reply to Dave Ertman
Quoted 11 lines · Dave Ertman

In commit 4d5a1c4e6d49 ("ice: do not add LLDP-specific filter if not necessary"), it was assumed that llpd_fltr_ctrl was a unique application of a filter instance and the other command in the flow was generic. This is an incorrect assumption, they are both meant to add a filter to handle LLDP packets and only varied in the actual AQ call made. The newer AQ call was created to handle a special case in some NVM images where a LLDP filter was already existent and the old AQ command would generate an error if a new filter was attempted to be added. The newer AQ command would detect this case and instead would add the current target to the existing filter rule.

Quoted 8 lines

Fix the flow so that the newer command is always used if available and only fall back to the older command when that is the only solution.

Also remove the obsolete state flag from the PF struct.

Fixes 4d5a1c4e6d49 ("ice: do not add LLDP-specific filter if not necessary")
reviewer Reviewed-by on v2 1/1
#3 lore raw
In reply to Dave Ertman
Quoted 11 lines · Dave Ertman

In commit 4d5a1c4e6d49 ("ice: do not add LLDP-specific filter if not necessary"), it was assumed that llpd_fltr_ctrl was a unique application of a filter instance and the other command in the flow was generic. This is an incorrect assumption, they are both meant to add a filter to handle LLDP packets and only varied in the actual AQ call made. The newer AQ call was created to handle a special case in some NVM images where a LLDP filter was already existent and the old AQ command would generate an error if a new filter was attempted to be added. The newer AQ command would detect this case and instead would add the current target to the existing filter rule.

Quoted 8 lines

Fix the flow so that the newer command is always used if available and only fall back to the older command when that is the only solution.

Also remove the obsolete state flag from the PF struct.

Fixes 4d5a1c4e6d49 ("ice: do not add LLDP-specific filter if not necessary")
reviewer
#4 lore raw
Quoted 15 lines · Simon Horman
Quoted 14 lines · Dave Ertman

In commit 4d5a1c4e6d49 ("ice: do not add LLDP-specific filter if not necessary"), it was assumed that llpd_fltr_ctrl was a unique application of a filter instance and the other command in the flow was generic. This is an incorrect assumption, they are both meant to add a filter to handle LLDP packets and only varied in the actual AQ call made. The newer AQ call was created to handle a special case in some NVM images where a LLDP filter was already existent and the old AQ command would generate an error if a new filter was attempted to be added. The newer AQ command would detect this case and instead would add the current target to the existing filter rule.

Fix the flow so that the newer command is always used if available and only fall back to the older command when that is the only solution.

Quoted 7 lines
Quoted 5 lines

Also remove the obsolete state flag from the PF struct.

Fixes 4d5a1c4e6d49 ("ice: do not add LLDP-specific filter if not necessary")

Sorry for the duplicate, I forgot that I'd already sent this yesterday.

Tested-by on v2 1/1
#5 lore raw
In reply to Dave Ertman
Quoted 14 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Dave Ertman
Sent: Tuesday, August 11, 2026 11:41 PM
To: [email protected]
Cc: [email protected]; Kitszel, Przemyslaw <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-net v2] ice: Fix incorrect LLDP filter assumptions

In commit 4d5a1c4e6d49 ("ice: do not add LLDP-specific filter if not necessary"), it was assumed that llpd_fltr_ctrl was a unique application of a filter instance and the other command in the flow was generic.
This is an incorrect assumption, they are both meant to add a filter to handle LLDP packets and only varied in the actual AQ call made. The newer AQ call was created to handle a special case in some NVM images where a LLDP filter was already existent and the old AQ command would generate an error if a new filter was attempted to be added. The newer AQ command would detect this case and instead would add the current target to the existing filter rule.

Fix the flow so that the newer command is always used if available and only fall back to the older command when that is the only solution.

Also remove the obsolete state flag from the PF struct.

Quoted 8 lines
Fixes 4d5a1c4e6d49 ("ice: do not add LLDP-specific filter if not necessary")
---
 drivers/net/ethernet/intel/ice/ice.h     |  1 -
 drivers/net/ethernet/intel/ice/ice_lib.c | 18 +++++-------------
 2 files changed, 5 insertions(+), 14 deletions(-)