🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #18192

Re: [PATCH net 4/6] ice: Fix incorrect LLDP filter assumptions

#18192
From: netdev-bot+sashiko
Date: Tue, 17 Nov 2026 23:54
180 lines
15410 bytes
Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 2

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] ice_vsi_cfg_sw_lldp()
  (drivers/net/ethernet/intel/ice/ice_lib.c:2182) now sends the Rx LLDP…
- [Low] The commit message for ice_vsi_cfg_sw_lldp() (ice_lib.c) never
  names a user-visible symptom or failing configuration for a…
- [Low] The patch removes ICE_FLAG_LLDP_AQ_FLTR (ice.h), the only record
  of which mechanism installed the Rx LLDP rule.

--

ice: Fix incorrect LLDP filter assumptions

This patch changes ice_vsi_cfg_sw_lldp() to always try the
LLDP_FILTER_CONTROL AQ command first for the Rx LLDP rule. It falls back
to the ethertype rule only when the AQ command returns -EOPNOTSUPP. The
ICE_FLAG_LLDP_AQ_FLTR PF flag is removed.

> 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.

[Severity: Low]

Is this description accurate? ice_fltr_add_eth() adds an ethertype rule
that is tracked in hw->switch_info. That rule is replayed after a reset
and removed by ice_fltr_remove_all(). The filter added by
ice_lldp_fltr_add_remove() is not tracked by the driver (see the VF reset
question below).

The commit message also does not give a user-visible symptom for a
Fixes: tagged fix. The old flow already fell back to the AQ command when
adding the ethertype rule failed. That seems to cover the case of an NVM
with an existing LLDP filter, which is the case described here.

The defect that is visible in the baseline is not mentioned.
ICE_FLAG_LLDP_AQ_FLTR was a sticky PF-wide flag. A fallback on one VSI
could switch the remove path of every other VSI to AQ and leak their
ethertype rules. Should the commit message describe this?

Two behaviour changes are also left out:

- AQ failures other than -EOPNOTSUPP (for example -EIO from
  ice_sq_send_cmd()) no longer retry with the ethertype rule.
- The dev_info() fallback message is removed. Commit eef33aa44935 ("ice:
  fix adding AQ LLDP filter for VF") kept that message on purpose because
  it "proved to be useful".

Using the AQ path for VF VSIs is only correct because eef33aa44935
removed the vsi->type != ICE_VSI_PF check from
ice_lldp_fltr_add_remove(). Would it help to mention that dependency?

> diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
> index 432da05c48c08..dded9f7c173e9 100644
> --- a/drivers/net/ethernet/intel/ice/ice.h
> +++ b/drivers/net/ethernet/intel/ice/ice.h
> @@ -525,7 +525,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,

[Severity: Low]

Without this flag, the add and remove paths in ice_vsi_cfg_sw_lldp() each
choose AQ or ethertype from the current ice_fw_supports_lldp_fltr_ctrl()
result. They no longer depend on how the rule was actually installed. Can
the two paths disagree after a FW update?

ice_rebuild() calls ice_init_all_ctrlq() again, which re-reads the FW API
version. ice_vsi_rebuild_by_type() then replays tracked filters through
ice_replay_vsi().

Consider FW moving from below API 1.7.1 to 1.7.1 or later (devlink flash
plus EMPR). The ethertype ETH_P_LLDP FWD_TO_VSI rule added before the
update is replayed into HW. A later remove sends an AQ DELETE instead.
That remove can come from ice_cfg_sw_rx_lldp(pf, false) when
fw-lldp-agent is re-enabled through ethtool, or from ice_vsi_release():

ice_vsi_cfg_sw_lldp(vsi, false, false)
    ice_lldp_fltr_add_remove(&pf->hw, vsi, false)   /* AQ DELETE */

Would that leave the replayed ethertype rule in HW, so LLDP keeps being
forwarded to the PF VSI? The opposite direction (a downgrade) probably
only gives a failed ethertype remove and a dev_warn(), because EMPR
clears FW state.

>  	ICE_PF_FLAGS_NBITS		/* must be last */
>  };
>  
> diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
> index 977cd8dd6e31b..2836f7d8a4753 100644
> --- a/drivers/net/ethernet/intel/ice/ice_lib.c
> +++ b/drivers/net/ethernet/intel/ice/ice_lib.c
> @@ -2179,24 +2179,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) {

[Severity: Medium]

With this change, PF and VF VSIs get the Rx LLDP rule from the AQ filter
whenever FW supports LLDP_FILTER_CONTROL, not from the tracked ethertype
rule. Since the driver does not track the AQ filter, is it still removed
when a VF is reset?

Consider a trusted VF with the FW LLDP agent disabled. The VF adds the
LLDP multicast MAC:

ice_vc_add_mac_addr()
    ice_vf_update_mac_lldp_num()
        ice_vsi_cfg_sw_lldp(vsi, false, true)
            ice_lldp_fltr_add_remove(..., true)   /* AQ ADD for vsi_num */

Then the VF is reset through VIRTCHNL_OP_RESET_VF, VFLR or a host config
change:

ice_reset_vf()
    ice_vf_pre_vsi_rebuild()
        ice_vf_clear_counters()
            vf->num_mac_lldp = 0;
    ice_vf_reconfig_vsi()
        vsi->flags = ICE_VSI_FLAG_NO_INIT;
        ice_vsi_decfg(vsi);
        ice_fltr_remove_all(vsi);

ICE_VSI_FLAG_NO_INIT keeps the HW VSI and its vsi_num.
ice_fltr_remove_all() only removes tracked MAC, VLAN, promisc, default and
ethertype rules. Nothing on this path sends
ICE_AQC_LLDP_FILTER_ACTION_DELETE.

The driver code shows that no DELETE is sent. That FW keeps forwarding
LLDP to the VSI is an inference: switch rules survive a VF reset, which
is why ice_vf_reconfig_vsi() calls ice_fltr_remove_all() at all.

After the reset, ice_set_vf_trust() removes the rule only if the counter
is non-zero:

	if (!trusted &&
	    (vf->num_mac_lldp > 0 ||
	     test_bit(ICE_VF_STATE_UC_PROMISC, vf->vf_states) ||
	     test_bit(ICE_VF_STATE_MC_PROMISC, vf->vf_states))) {

Could a VF whose trust was revoked keep receiving port LLDP frames this
way? ice_vc_can_add_mac() is meant to block exactly that for untrusted
VFs.

ice_vsi_release() also skips the Rx LLDP delete for a VF VSI when
ice_vf_is_lldp_ena() returns false. Can the FW filter then outlive the
VSI and still refer to a released VSI number?

If the VF adds the LLDP MAC again after the reset, a second AQ ADD would
go out for a VSI that is already in the filter.

In the baseline the ethertype rule was the default path. It is tracked,
so ice_fltr_remove_all() removed it during the reset and HW matched the
zeroed counter.

> +			/* If fltr_ctrl not supported, use legacy
> +			 * add/remove command
> +			 */
>  			status = eth_fltr(vsi, ETH_P_LLDP, ICE_FLTR_RX,
>  					  ICE_FWD_TO_VSI);

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261113231225.1864810-1-anthony.l.nguyen%40intel.com
Technical Details
Message-ID: <179495967458.3136.6619318461381806067@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365727-linux-kernel-netdev=dewy.ru
References: <20261113231225.1864810-5-anthony.l.nguyen@intel.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365727-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 4/6] ice: Fix incorrect LLDP filter assumptions
Date: Tue, 17 Nov 2026 23:54:34 +0000
Organization: Usenet Network
Message-ID: <179495967458.3136.6619318461381806067@kernel.org>
References: <20261113231225.1864810-5-anthony.l.nguyen@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2458227"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:5FLRlBZ7MUevQFLYfkhTBL4eI1c= sha256:uEkgNsYxL3UH+gAdecActvxp8czZ2LxmWXIgZjg9tV4=
	sha1:7weuHQTtqlLHTw/3HygJteku088= sha256:ZlRji5ogSOGYkxIFh2CDJ6h68L/lWolgOT2jaRd1JK4=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 51FB311510D; Wed, 18 Nov 2026 02:55:01 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id IDF-NsYThh4h;
	Wed, 18 Nov 2026 02:54:57 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-365727-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 154B1115105; Wed, 18 Nov 2026 02:54:47 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id A7D4843F95; Tue, 17 Nov 2026 23:54:39 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794959677;
	b=nTDr6/L7/zI1guQ3XPCKHWjMp4Q3zTRU6L3KEgzu6p4xM2Zz97nn9H2O6MlhBQ/BHc/E
	 fblFSOaTTM4KKj6MnVa5007NrkEuguhsNB+VMFvMiRsXPq5DBa9cetakK6DCs1Fud32QG
	 JHbc76tasvEXbJ25Y+eMmTK40lXnCmHPbqMH7QDzBIj5wRbj/nsdNVIiA9r3lTVvxSHiX
	 QMrgxk/x2hhACa2MwNOq0wq/5orxwG1Z724Bzt3BwT8Y736Wk9x6aqgTS82X9RomFDTZY
	 pPzbBwSyW4hU9UJX1Ebx+LB8ygdRcXQZyIWZ5rTSNhOSr+yiY5ST/dPS3mwQI9AiBEw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794959677;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=pP2Sf6/RgKiFX/tZtgXs/3GSaj0GvFn07e0+OAhDV9o=;
	b=iuspGqhxkQts2+mOr1RTYYJKFZOaLp9nA19rDhAbBrQo63bjAlC3vrN48EM3KdK9GrzZ
	 Val/6Z/ndgcfE6APLJd/cjtLMYQFXRQOjwFf/XYmA1RyCAhWNu1knmIMb4n16tKwbQOAk
	 CI+074GXybpyvblV/PkmodB6NSm6GM5NNzdzPVxqI+9Rpn1R58Tmb631O3mTAapRh0M9D
	 KQ4V6gsTRzZD8z+wPB4c7ZK9oJXAmiuAbfg8+1sW4k5yoAYwrxl1DP2kMHFbDZhV9eOQG
	 ndrU02M5ladIktvuIm/AXjyhXQ1XNxSTOyNwcxn9IDQBkbrCoqd7whQSL95MGx7azsA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QSIX3f8f;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 6EC03606A32A;
	Tue, 17 Nov 2026 23:54:37 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QSIX3f8f
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794959676;
	b=K1S40L/XfVdu0ovhyCRnxd5HJHhM+5Q5QqtswjmlgaNrj2CKr4XEHo3U84KntcJZXfVK
	 0SkHZuQ+IGe1i9YqFmJ/BiZhnvF0z8FZIu9UolR/pVbWoZAz36hj3YnL9+2/uqO05SoL+
	 vvxNd+JiqbAu8z+o0JtMRm/SuhoHbCsvcHT1yfkY3WqBizLQx0MVxL65BZJl7JFgL5wTh
	 E/18giijNSoey+jPU+LNVr2TtCaAqL2UhwaWZVr7XhSZIFkSX94XcuNd5dGqsS2+58Pkl
	 175T0a18f3cR5G29Drkzlfb8dTymGP9ZEuOJMITVxmuqHWHNIO4OWV8uOC/3d9iJBOQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794959676;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=pP2Sf6/RgKiFX/tZtgXs/3GSaj0GvFn07e0+OAhDV9o=;
	b=IOaynTLfdWuhR9X5D+4hRh4VsoIlQj9F5Wb4mNDFvnsID1ZQGLKJaJ3tnG58IxQPGHLy
	 OS6SSXi8W68EHb/YgckPri/T9GNBl35V4ALSEx1pOxRdkWg5HW/KIZF4+8CpOQeuvzKzU
	 uqCwvA/w7+K7ALx+ptOkxugxRhy/RQ3kWXEA+4t10DvrEQ02dnUZpNIZPmX9HTa0q+vdW
	 FzpnRRR576VeSnlGm1V76B15xqVpLyPlc6+THXd3yeTgnAiS3wurcO6cmJlxMDE1ArrtN
	 QBHd+Gy9kWwzwrYbAwVV5h/8VHxakJ2NyZuvVGoadrUWYIF/qEolkpkqTM2ykIFqXpQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QSIX3f8f;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F3F3606A31C
	for <netdev@vger.kernel.org>; Tue, 17 Nov 2026 23:54:36 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 134AB1F000C9;
	Tue, 17 Nov 2026 23:54:35 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794959676;
	bh=pP2Sf6/RgKiFX/tZtgXs/3GSaj0GvFn07e0+OAhDV9o=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=QSIX3f8fDRl0PvqiKjnNLHdg+dJSE5A7aZc8PJhSU/Y0UdM0wgrOaieGoYexiCXmq
	 gLFcyUjA2NahW+LOEd51j3BVcPgrsGbGLz2kpEU1S63xN+6F7goEk7XAiQUwZzALvs
	 aYuLLeH0BFSY1ml1Q8lxRPXQ8HhgeKOOLc6oUFeOLxK7H7lawrp9czIiVnoTUnNV2T
	 p0dU/njyT2SynvUZQIvvHX0J+T5S1Yh14hZ05oImp6aWgW4ui/qzKXrw+JNIPX+l9E
	 9zbX9Kc93u9muW7rkN8ad0B0CO0s6H6O5ytqd9XoblaqaNRHDZVW9SbARm9b93loJS
	 yPrpzY4uZ/+gw==
X-Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
 edumazet@kernel.org, andrew+netdev@lunn.ch, netdev@vger.kernel.org,
 michal.swiatkowski@linux.intel.com, poros@redhat.com,
 david.m.ertman@intel.com, pengpeng@iscas.ac.cn, przemyslaw.kitszel@intel.com,
 vinicius.gomes@intel.com, sridhar.samudrala@intel.com,
 aleksandr.loktionov@intel.com, horms@kernel.org, alexander.nowlin@intel.com
X-In-Reply-To: <20261113231225.1864810-5-anthony.l.nguyen@intel.com>
X-sashiko-severity: Medium
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list