๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25318

Re: [PATCH net-next v4 4/6] enic: validate V2 VF configuration replies

#25318
From: netdev-bot+sashiko
Date: Tue, 01 Dec 2026 14:04
103 lines
11678 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The warning in enic_mbox_vf_capability_check()
  (drivers/net/ethernet/cisco/enic/enic_mbox.c) still says 'MBOX: PFโ€ฆ

--

enic: validate V2 VF configuration replies

This patch adds VF-side V2 mailbox operations for MAC filters and
packet-filter settings, plus the administrative-MAC protocol definitions.
It validates reply framing, echoed operations, result counts and applied
filter flags. Malformed replies and registration loss now force a VF
reconnect, and the patch adds a per-request mbox_reply_status that the
existing capability, register and unregister callers now check.

> diff --git a/drivers/net/ethernet/cisco/enic/enic_mbox.c b/drivers/net/ethernet/cisco/enic/enic_mbox.c
> index 3579d2980a246..5afb45033772b 100644
> --- a/drivers/net/ethernet/cisco/enic/enic_mbox.c
> +++ b/drivers/net/ethernet/cisco/enic/enic_mbox.c

[ ... ]

> @@ -572,23 +649,21 @@ static void enic_mbox_vf_handle_reply(struct enic *enic, u8 reply_type,
>  				      void *payload, u64 msg_num)
>  {
>  	struct enic_mbox_generic_reply *reply = payload;
> +	enum enic_mbox_vf_reply_recovery recovery;
>  	u16 ret_major = le16_to_cpu(reply->ret_major);
> -	u64 expected_msg_num;
> -	u8 expected_type;
> +	u8 expected;
> +	int status;
>  
> -	spin_lock_bh(&enic->mbox_state_lock);
> -	expected_type = enic->mbox_expected_reply;
> -	expected_msg_num = enic->mbox_expected_msg_num;
> -	if (expected_type != reply_type || expected_msg_num != msg_num) {
> -		spin_unlock_bh(&enic->mbox_state_lock);
> +	status = enic_mbox_vf_classify_reply(false, ret_major, &recovery);

[ ... ]

> -	if (!ret_major) {
> +	if (!status) {
>  		switch (reply_type) {
>  		case ENIC_MBOX_VF_CAPABILITY_REPLY: {
>  			struct enic_mbox_vf_capability_reply_msg *cap = payload;

[ ... ]

> @@ -829,12 +1104,15 @@ int enic_mbox_vf_capability_check(struct enic *enic)
>  
>  	err = enic_mbox_wait_reply(enic, 3000);
>  	version = READ_ONCE(enic->pf_cap_version);
> +	status = READ_ONCE(enic->mbox_reply_status);
>  	enic_mbox_vf_request_finish(enic);
>  	if (err) {
>  		netdev_warn(enic->netdev,
>  			    "MBOX: no capability reply from PF\n");
>  		return err;
>  	}
> +	if (status)
> +		return status;
>  
>  	if (version < ENIC_MBOX_CAP_VERSION_1) {
>  		netdev_warn(enic->netdev,

[Severity: Low]
Is the warning text that follows this check still accurate?

It currently reads:

	netdev_warn(enic->netdev,
		    "MBOX: PF rejected capability request or reported unsupported version %u\n",
		    version);

Before this patch, a PF rejection (nonzero ret_major) left pf_cap_version
at 0. That case reached this warning and returned -EOPNOTSUPP.

Now enic_mbox_vf_handle_reply() passes ret_major through
enic_mbox_vf_classify_reply(). It stores the result in mbox_reply_status
and skips the pf_cap_version write. The new "if (status) return status;"
then returns -EIO, -ENODEV or -EOPNOTSUPP before the version check, and
nothing is printed at this site.

This means the warning only fires when the PF accepted the request but
reported a version below ENIC_MBOX_CAP_VERSION_1. The "PF rejected
capability request" part can no longer happen. Rejections are still
logged by the "PF rejected reply type %u" warning in
enic_mbox_vf_handle_reply().

Should this message be reduced to just the unsupported version case? As
far as I can tell, the same wording is still there at the end of the
series.

-- 
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: <179613389228.3146.12227403577099366046@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.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-375141-linux-kernel-netdev=dewy.ru
References: <20261130-b4-enic-sriov-v2-vf-receive-control-v4-4-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!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375141-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v4 4/6] enic: validate V2 VF configuration replies
Date: Tue, 01 Dec 2026 14:04:52 +0000
Organization: Usenet Network
Message-ID: <179613389228.3146.12227403577099366046@kernel.org>
References: <20261130-b4-enic-sriov-v2-vf-receive-control-v4-4-5858d5a9ecb1@cisco.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1729726"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:ei5Bg6MUFMPz+YMtCMGx85VSLZU= sha256:DAaHyvhUckFobKs89+y8KEj9YO7zzB2QUxi70zZdSjg=
	sha1:XjI4Eq8qGLX28qpFvWnqcpmB7zY= sha256:XRfN3YI6cLkHsgqH9dgqM6jH46dakqp/UsyVo97rmkM=
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 C00A31173D5; Tue,  1 Dec 2026 17:05:20 +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 U0daGjTBGYKQ;
	Tue,  1 Dec 2026 17:05:17 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-375141-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 17970117373; Tue,  1 Dec 2026 17:05:09 +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 25FF62B96C; Tue,  1 Dec 2026 14:04:57 +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=1796133894;
	b=x7xonP9g0dEuLQ9dqNPcgvig0Ii+SqlpehL0ojD/FDhcd4K2twIAaJtdFFsUHvC9wQ5O
	 SefjNke73QUp5/q4wrM8KeQBXg3TZMOi3mDYj+GqkzDUG1338P4I0xfCdC7mmz9GI5Csf
	 iTh1dbBcHLn/NCIEVWpmkpXXEe3ibBf4MhL2PgTHbLUqOAQd4mTi4tkw0k83WU0/IsZ+A
	 nf97/GjZfFzootkvsyUZnnXbBztS1RSaGfGst0yfsTLaj0PzngRpvyGidikrz7kL1CCa+
	 Ibmp6B1OVeexqtGNdmuSVvQnBcN0N1+/sdSFE6n3xUGTfADpa+mfv7+pIgh61gZY5Ag==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796133894;
	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=mJde8k9PddSfZJvLuBrTkuMeXuvtI0NP3EAtfOhgZOk=;
	b=RDJ5qBn6tcCamWXz7qVKdQpJyTIT58lPQUX9N7grOTWqvqHNohRfna9F1c37xmBCy8Kw
	 bRT9/NtFbyWgIqoxRuSTGNfZAFx4ih7LQsXYtmR+2MtewwYnSAgvlpocLgS8IftrxDIbp
	 HSzynWGTRsJrIzLWQBqcTlz+nnkDeuBwrTzpHSoswoHpy2QCUJg4k7CPI7p+g2EpGsEHJ
	 AdYxtUdQaJdShFSUXtGAK7miPz/mkIt/GIROPOU+vn9HR9NilrK/zqQ7l/hhzI4ZtFOwZ
	 s5qrYhr104OALv8XPyk/AfMfGXGlNRZltKbtnCU7SaNp3Z1tC9bPnVCdmOSYQKbjhVQ==
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=CRQEA5XE;
	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 D3008606A329;
	Tue,  1 Dec 2026 14:04:54 +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=CRQEA5XE
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=1796133894;
	b=fvWye4fBNo1qUAyiCYlzuNWnBqYDSvQSj3LcDGGQXK7DZcWh2jNk/veJBInc4qpoQAIG
	 dRs4I5p+rAabWFXUsAqKjUlbLeRWpzXKMi9HapzbOEdkVwc112wkD3Pm7hkByI6dVlkqr
	 RB6ciByRfcV0xBgT4Um+9vOQKf2YKfLod55/DEWlV1ItR//Fmmixn1/ixHUku7x0PV+Bt
	 DMkv2Qw7MHWFkQ4IWvsmhyKYTjp+N4dHZUG9BnXDLNRxVLljRQgbBZJfnKD3YhTsaSDbk
	 TDHCCkhkSWsen91My01on7YmOrFFR1xvd5118+NcVV8wn7wrsZXqjUSU2vF+s4cGmfQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796133894;
	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=mJde8k9PddSfZJvLuBrTkuMeXuvtI0NP3EAtfOhgZOk=;
	b=IHXxpMkRu/MY+dWb9P5iEwYooRPp2Ukr+A94fvQPwbGvGxyFcgWp2oAZJXyOEz3Xai51
	 HiN2aRoEz6LLdewxn8XLHmkLCuT6CrWUivXOC3358aCrWV5WpN1vc4ZNvrA8QFOoWTOd/
	 xu9khI+RiKkc+gVWLqOASBpfceYGY18nKEzrsY33LSWFH/6l1cg4MTM/vK3oH1PAvrFA8
	 swv9TU6f4TG7kGsfwYUyEKHsnJ9haLUg7HSIH0nuxlRH1cZTbLyD7zK5j9Gur2mHPh7gx
	 NTaA2xw8t0gIs04vQk8wQ0lftw3pGblUHNf0QoA1Uz/FikIuK9it9bslR6MidcSPz+Q==
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=CRQEA5XE;
	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 00DD8606A686;
	Tue,  1 Dec 2026 14:04:53 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE33F1F00898;
	Tue,  1 Dec 2026 14:04:52 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796133893;
	bh=mJde8k9PddSfZJvLuBrTkuMeXuvtI0NP3EAtfOhgZOk=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=CRQEA5XEWaQHFXC8l9Yqc70xkQFbovyAU9H2jy9r6x6NiTYSTciXtPQFeJuP3Q/Ua
	 d2Aterd6TcIv2acqRnD23giRTjwHqq1y2ONwDA1QwHzBvCZKVbV31WhQvq9S8jAEdc
	 RUJklYg+tpvYGY2g7Pb6rgBGKeZRBfZ8HXuqo6oKiKYgkiMm5hGNexbYFtF7lCfWdw
	 gAS7bMYsplYLK91l0G0VFYg7NAAnHgFe6G2V2sDMJhu3F3UVtd8ll76JS9Py6M8iK3
	 yr80z31ns5QJDfgv9/S2jkjxnIw491hGb534w49N+mu26vzN6aN6Y8k930nUgU6kP4
	 XpukL5V5nXjbQ==
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-4-5858d5a9ecb1@cisco.com>
X-sashiko-severity: Low
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