🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25319

Re: [PATCH net-next v4 6/6] enic: configure V2 VF receive mode over mailbox

#25319
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 14:04
231 lines
16451 bytes
Thank you for your contribution! Sashiko AI review found 4 potential
issue(s) to consider.

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

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] enic_vf_sync_mac_filters() treats every SKIPPED DELETE result
  as lost state.
- [Medium] An ADD the PF rejects permanently is never recorded.
- [Medium] A PF result of ENIC_MAC_ADDR_FLAG_OVERFLOW (PF exact-filter
  table full) for a secondary-address ADD is handled the same way as a…
- [Low] The commit message says the patch will "Report policy denials
  during open and runtime updates", but default builds report nothing.

--

enic: configure V2 VF receive mode over mailbox

This commit adds an asynchronous receive-mode callback for V2 VFs. The
callback programs unicast/multicast exact filters and packet-filter modes
through the PF mailbox. It orders broad-mode transitions around exact-filter
updates, tracks per-address results, and schedules a receive-mode replay
after an internal reopen.

> diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
> index a2186f65c74a8..4a9b4bf9e16b8 100644
> --- a/drivers/net/ethernet/cisco/enic/enic_main.c
> +++ b/drivers/net/ethernet/cisco/enic/enic_main.c

[ ... ]

> @@ -1653,17 +1655,419 @@ static int enic_set_mac_address(struct net_device *netdev, void *p)

[ ... ]

> +static void enic_vf_report_pkt_filter_denial(struct net_device *netdev,
> +					     u16 requested, u16 applied)
> +{
> +	if ((requested & CMD_PFILTER_PROMISCUOUS) &&
> +	    !(applied & CMD_PFILTER_PROMISCUOUS))
> +		netdev_dbg(netdev, "PF policy denied promiscuous receive mode\n");
> +	if ((requested & CMD_PFILTER_ALL_MULTICAST) &&
> +	    !(applied & CMD_PFILTER_ALL_MULTICAST))
> +		netdev_dbg(netdev,
> +			   "PF policy denied all-multicast receive mode\n");
> +}

[Severity: Low]
The commit message says:

  "Report policy denials during open and runtime updates."

Does netdev_dbg() meet that? Without DEBUG or CONFIG_DYNAMIC_DEBUG it
compiles to if (0), and with dynamic debug it is off by default. A PF
refusal of CMD_PFILTER_PROMISCUOUS or CMD_PFILTER_ALL_MULTICAST would leave
no trace on the VF.

Per-address ADD denials are not reported at any level either.
enic_vf_sync_mac_filters() folds NOT_PERMITTED, INVALID and OVERFLOW into
-EACCES, and enic_set_vf_rx_mode() turns that into success:

	err = enic_vf_sync_mac_filters(enic, uc, mc);
	if (err == -EACCES) {
		...
		err = 0;
	}

So "ip link set ... promisc on" or a multicast join appears to succeed, and
the netdev shows PROMISC/ALLMULTI, while the PF has not applied it.

Would a netdev_info() or netdev_warn() (possibly rate limited) fit the
commit message better?

[ ... ]

> +static int enic_vf_sync_mac_filters(struct enic *enic,
> +				    struct netdev_hw_addr_list *uc,
> +				    struct netdev_hw_addr_list *mc)
> +{

[ ... ]

> +	for (i = 0; i < num_ops; i++) {
> +		u16 flags = le16_to_cpu(macs[i].flags);
> +		bool add = flags & ENIC_MAC_ADDR_FLAG_ADD;
> +
> +		if (flags & ENIC_MAC_ADDR_FLAG_SKIPPED) {
> +			if (add)
> +				retryable_add = true;
> +			else
> +				reconnect = true;
> +			continue;
> +		}

[Severity: Medium]
Can a pure policy denial trigger a full VF reset here?

Every SKIPPED DELETE sets reconnect. Below, that leads to
enic_mbox_vf_require_reconnect(), which kicks vf_mbox_recovery_work and ends
in enic_hang_reset(enic, true): full datapath stop, re-registration and
reopen.

The station path in this series documents a PF reply where every DELETE is
SKIPPED because an ADD in the same request was rejected. From
enic_vf_station_addr_replace():

	/* A policy-rejected ADD can be reported with all preceding DELETEs
	 * skipped. No operation changed state in that coherent result tuple.
	 */

The "enic: manage V2 VF station and administrative MAC" commit message
also says "If the PF skips every station DELETE and rejects the ADD as not
permitted...".

A receive-mode batch puts the stale DELETEs first and the ADDs after them.
Suppose installed address X is removed while PF-denied address Y is
pending. The batch is [DELETE X, ADD Y], and the PF could answer
DELETE X = SKIPPED and ADD Y = NOT_PERMITTED. Nothing changed on the PF,
but the VF still goes through a hang reset.

Y is never recorded (its sync_cnt stays 0), so it is collected again in
every later batch. Would any later address removal while Y is still listed
repeat the reset? Unprivileged sockets can join and leave multicast groups,
so if the PF denies an MC ADD this could be triggered over and over.

This depends on the out-of-tree PF using the same reply shape for
secondary-address batches as for station operations. Should the
{all DELETEs SKIPPED, ADD permanently rejected} result be treated as "no
state change", as enic_vf_station_addr_replace() does?

> +		if (flags & ENIC_MAC_ADDR_FLAG_PERMANENT_MASK) {
> +			if (add)
> +				permanent_add = true;
> +			else
> +				reconnect = true;
> +			continue;
> +		}

[Severity: Medium]
Is ENIC_MAC_ADDR_FLAG_OVERFLOW meant to be handled like a policy denial
here?

ENIC_MAC_ADDR_FLAG_PERMANENT_MASK in enic_mbox.h groups OVERFLOW with
NOT_PERMITTED and INVALID:

#define ENIC_MAC_ADDR_FLAG_PERMANENT_MASK \
	(ENIC_MAC_ADDR_FLAG_OVERFLOW | ENIC_MAC_ADDR_FLAG_NOT_PERMITTED | \
	 ENIC_MAC_ADDR_FLAG_INVALID)

So when the PF reports its exact-filter table as full for an ADD, the code
sets permanent_add and returns -EACCES, and enic_set_vf_rx_mode() turns
that into success.

The packet-filter flags come only from the driver's own counts:
enic_vf_uc_needs_promisc() triggers above 31 UC entries, and
enic_rx_mode_to_pkt_filter() above 32 MC entries. No PROMISCUOUS or
ALL_MULTICAST fallback is requested for a PF-reported overflow.

If the PF's real capacity or occupancy is smaller than the driver's model,
frames for that address are silently dropped. Examples are an IPv6
solicited-node multicast or a macvlan unicast. The same ADD is then resent
and ignored on every later rx-mode event.

The commit message says:

  "leaving overflow entries unsynchronized for later convergence"

That appears to cover only driver-side overflow, where broad coverage is
requested. Should a PF-reported OVERFLOW also request broad coverage for
that address class?

[ ... ]

> +	if (reconnect) {
> +		enic_mbox_vf_require_reconnect(enic);
> +		err = -EIO;
> +	} else if (err != -EIO) {
> +		/* Do not let a retryable or permanently-denied ADD overwrite an
> +		 * installed-filter counter inconsistency (-EIO) detected above.
> +		 */
> +		if (retryable_add)
> +			err = -EAGAIN;
> +		else if (permanent_add)
> +			err = -EACCES;
> +	}

[Severity: Medium]
Does this precedence let a stable ADD denial use up the core retry budget?

A permanently denied ADD is never recorded, so its sync_cnt stays 0 and
enic_vf_collect_mac_ops() collects it again on every run:

		if (add) {
			if (ha->sync_cnt || *projected_count >= max_filters)
				continue;

The PF may report the other operations in that request as SKIPPED, the
shape handled in enic_vf_station_addr_replace(). Then both permanent_add
and retryable_add are set, and the function returns -EAGAIN rather than
-EACCES.

enic_set_vf_rx_mode() converts only -EACCES to 0. It returns -EAGAIN before
the trailing packet-filter step, and the core retries via
netif_rx_mode_schedule_retry(). Each retry resends the same batch and gets
the same result until the limit is hit:

	if (dev->rx_mode_retry_count >= NETIF_RX_MODE_RETRY_MAX) {
		netdev_err(dev, "rx_mode retry limit reached, giving up\n");

The valid addresses that were SKIPPED in that batch are never installed.
The same thing repeats on every later address-list event while the denied
MAC stays listed. That seems to contradict the commit message:

  "stable ADD policy denials do not consume the retry budget"

The ADD-only replay after a reconnect (see the SKIPPED DELETE question
above) would land in this same loop.

As with the previous question, this depends on PF reply behaviour that is
only inferred from the station path.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-b4-enic-sriov-v2-vf-receive-control-v4-0-5858d5a9ecb1%40cisco.com
Technical Details
Message-ID: <179613389534.3146.15589957948502759447@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder2.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375143-linux-kernel-netdev=dewy.ru
References: <20261130-b4-enic-sriov-v2-vf-receive-control-v4-6-5858d5a9ecb1@cisco.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder2.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375143-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v4 6/6] enic: configure V2 VF receive mode over mailbox
Date: Tue, 01 Dec 2026 14:04:55 +0000
Organization: Usenet Network
Message-ID: <179613389534.3146.15589957948502759447@kernel.org>
References: <20261130-b4-enic-sriov-v2-vf-receive-control-v4-6-5858d5a9ecb1@cisco.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="1729780"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:iATQCFBN8P+3Xrauqbw8LW6m720= sha256:4n52xsBQJHaiuUyLKCJM0039rDLQCMXtMmuRUBefwMk= sha1:dAfUzvKS5QOY4+BOh6MKFGes7Iw= sha256:aaEvBWrbG49mTCtbtb5n91y2YgmBAGLlSbLv8RpHlVc=
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 F18931173D6; Tue,  1 Dec 2026 17:05:24 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 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, URIBL_BLOCKED=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 G3SmP-P0Ty_b; Tue,  1 Dec 2026 17:05:21 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-375143-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id F3B921173D1; Tue,  1 Dec 2026 17:05:12 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 8E4C028AF7; Tue,  1 Dec 2026 14:04:59 +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=1796133897; b=C6zpOCwlUU6NobHxK3HdzJ4dUraLFEtZhJes8UGY3xHKOu3E+tee2LW86qEUOXs8WHez W2TxfiDS5RJmDSsh+rNjT4WikNCRVcT6RRnl5+XsXB1c6t6c4Lwh73BNnC8mT7VImPndm xPaxlq+LemIudHoSi4ZIJMeF9TW7Un536CiEBMp2b+MSExLDf9uj8CxBGQnrFI1GyoY4m 3iexshdVoloewthy0AdATD9bsoyKR/qFeKz5In2kUfjkNvcfXyoTldKYf8/FxD9c2tk3j q+7IrL/GUk9SIFcj3vz0oyLM372UfroayS3/d7s4Mgs+XmuFWBlzvZmzMDcrCkKdCkQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796133897; 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=SAl9TC/fxiVAwCXFeyNeD55HAMvn7pA7VlGS9DCmQUo=; b=KEsdbSr/zuBDf8hbF2VnyDJO38B8OrfzhNvmvyA6xOTFCmSwD5FBhXX1i7qc3RUYju5c RoS01TEI089dVBsrvi631Y+XGSwZE7xkSc6WaHLp57hauwH5SL8Fsjjs6PIq14Cxo+rrE eKc3GHigyPdtFop/N7gyfOiUWfpd22lOhgQP/O5KUJok+x1yMkNzkSm7CZ2jBXtuezvEL Rk8emR5irTy7NcurDbjv5zp+0AkfTyhim3cHrexEpxP6Bhsq4B8Qfm6cPfBj5pgm9UoYZ ATEaydOSBbF1AwSfc7HGUxsnDlercjqE3k4e0HhToCC2PG5ZIJreqqfgzGMOszqfJbg==
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=hYLWR2E5; 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 999F9606A322; Tue,  1 Dec 2026 14:04:57 +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=hYLWR2E5
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=1796133896; b=m3DSUr7Jva3344GZtBBNgd7s34AIRFPGIUS8COIIUM17CwvlWX6yEcX1lb/b4chzCPF7 6ZNFuUaYWkfvUDBX6Tn0GOrJT4EGrES6iewVXrZq+G0oY2QxCa0HlQvcHeI0iPegPPFuQ CHi5RPniBbtsvNHGpZEdg3TeLl3kmNfKEVnucxvgCTm1auRpi4YisdUFeCig/qt4fmnfT DkfjNEEOSJxM/FrCwFvAsvUX7fZChSYCOLpr1gI8yEJhvUi0j5OlJc1r43gzeupiYN8pC qjSygIl36ClKtovB3Hh7Qgia+rIE6OIwCnTpih0n6BmmBq2asTjMdxTtQq25oIwcOfQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796133896; 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=SAl9TC/fxiVAwCXFeyNeD55HAMvn7pA7VlGS9DCmQUo=; b=KOW5NHUqgG3Y2lrIh7q7rkrGRDHENh9TQ/RIDFcvxHryKC0ePlrbSpupByxdw9eKDZX7 itg+S1sU3GTQYRKv9naHcwpaGCMIi8eHwdpYuSghH83JvKNY/2KsMEG3nBlS31PmIKiEz we1kOxBPjLjMCPI4KYwtHsGAezzH4PTHGxoso7nvRuQoT1z9EoUzsaN9Ki1lusRg0k2Qz gj0lpFyDnaDI/6J9Bx/QSGRq3VBZXwD2Spo9u9reCHKmDPvrOFe1zgoHJJj98JLnCJtbG 5xFh9gPm1AtlfblKk/94grJbUsLAyqqQPnGlRp1c+tBfWeIbaSsWJoZp2M6KCJ3Lc/g==
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=hYLWR2E5; 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 BA24B606A33D; Tue,  1 Dec 2026 14:04:56 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBCE61F00898; Tue,  1 Dec 2026 14:04:55 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796133896; bh=SAl9TC/fxiVAwCXFeyNeD55HAMvn7pA7VlGS9DCmQUo=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=hYLWR2E5M7N9Y8a3SA+PLw3hKJDfLGNCOdgpep8Lo67I4aZhFIQigIu4vEZEwZltp 2UqdKu3laMDTjPkL2iwmdIc/i6SkiTuHX4+1ZHUP5ithgcluUzf+J2T2bMLl1AixfP xXUtyKRkhRAXm6LYJZQcQeEFgbDCPG13MNdHkJeBrEaUr3OxGN1GqhpP3le5dWaefu MnnmPf0kuVEsHTVRmFHuw+jRL0l8SoBMD8bxnNBDhusQOYUEAz2F03vCvumXuhYXbL 4gapUpNXB5nykZWhc9NZI6anvrDOIgj4bBMG3oDAnbFug8CO8WkuOmoggkwM9P7evW ZY9pTrrcWSMMA==
X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, willemb@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, sebaddel@cisco.com, aradhana@cisco.com, rfaucett@cisco.com
X-In-Reply-To: <20261130-b4-enic-sriov-v2-vf-receive-control-v4-6-5858d5a9ecb1@cisco.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