Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: satishkh@cisco.com
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
Subject: Re: [PATCH net-next v4 4/6] enic: validate V2 VF configuration replies
Date: Tue, 01 Dec 2026 14:04:52 +0000	[thread overview]
Message-ID: <179613389228.3146.12227403577099366046@kernel.org> (raw)
In-Reply-To: <20261130-b4-enic-sriov-v2-vf-receive-control-v4-4-5858d5a9ecb1@cisco.com>

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

  reply	other threads:[~2026-12-01 14:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 13:58 [PATCH net-next v4 0/6] enic: add V2 VF receive control over MBOX Satish Kharat
2026-11-30 13:58 ` [PATCH net-next v4 1/6] net: add netif_rx_mode_schedule_update() Satish Kharat
2026-11-30 13:58 ` [PATCH net-next v4 2/6] enic: serialize V2 VF mailbox requests Satish Kharat
2026-12-01 14:04   ` netdev-bot+sashiko
2026-11-30 13:58 ` [PATCH net-next v4 3/6] enic: recover V2 VF mailbox after request failure Satish Kharat
2026-12-01 14:04   ` netdev-bot+sashiko
2026-11-30 13:58 ` [PATCH net-next v4 4/6] enic: validate V2 VF configuration replies Satish Kharat
2026-12-01 14:04   ` netdev-bot+sashiko [this message]
2026-11-30 13:58 ` [PATCH net-next v4 5/6] enic: manage V2 VF station and administrative MAC Satish Kharat
2026-12-01 14:04   ` netdev-bot+sashiko
2026-11-30 13:58 ` [PATCH net-next v4 6/6] enic: configure V2 VF receive mode over mailbox Satish Kharat
2026-12-01 14:04   ` netdev-bot+sashiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179613389228.3146.12227403577099366046@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=aradhana@cisco.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rfaucett@cisco.com \
    --cc=satishkh@cisco.com \
    --cc=sebaddel@cisco.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox