public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: satishkh@cisco.com
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org,  linux-kernel@vger.kernel.org,
	20260401-enic-sriov-v2-prep-v4-0-d5834b2ef1b9@cisco.com
Subject: Re: [PATCH net-next v2 01/10] enic: verify firmware supports V2 SR-IOV at probe time
Date: Wed, 8 Apr 2026 09:04:20 -0700	[thread overview]
Message-ID: <adZ8LrpNZbQgy3NO@gmail.com> (raw)
In-Reply-To: <20260408-enic-sriov-v2-admin-channel-v2-v2-1-d05dd3623fd3@cisco.com>

On Wed, Apr 08, 2026 at 08:08:11AM -0700, Satish Kharat via B4 Relay wrote:
> From: Satish Kharat <satishkh@cisco.com>
> 
> During PF probe, query the firmware get-supported-feature interface
> to verify that the running firmware supports V2 SR-IOV. Firmware
> version 5.3(4.72) and later report VIC_FEATURE_SRIOV via
> CMD_GET_SUPP_FEATURE_VER. If the firmware does not support the
> feature, set vf_type to ENIC_VF_TYPE_NONE and log a warning so the
> admin knows a firmware upgrade is needed.
> 
> The VIC_FEATURE_SRIOV enum value (4) matches the firmware ABI. A
> placeholder entry (VIC_FEATURE_PTP at position 3) is added to keep
> the enum in sync with firmware's feature numbering.
> 
> Signed-off-by: Satish Kharat <satishkh@cisco.com>
> ---
>  drivers/net/ethernet/cisco/enic/enic_main.c   | 18 ++++++++++++++++++
>  drivers/net/ethernet/cisco/enic/vnic_devcmd.h |  2 ++
>  2 files changed, 20 insertions(+)
> 
> diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
> index e7125b818087..3a4afd6da41f 100644
> --- a/drivers/net/ethernet/cisco/enic/enic_main.c
> +++ b/drivers/net/ethernet/cisco/enic/enic_main.c
> @@ -2641,8 +2641,10 @@ static void enic_iounmap(struct enic *enic)
>  static void enic_sriov_detect_vf_type(struct enic *enic)
>  {
>  	struct pci_dev *pdev = enic->pdev;
> +	u64 supported_versions, a1 = 0;
>  	int pos;
>  	u16 vf_dev_id;
> +	int err;
>  
>  	if (enic_is_sriov_vf(enic) || enic_is_dynamic(enic))
>  		return;
> @@ -2669,6 +2671,22 @@ static void enic_sriov_detect_vf_type(struct enic *enic)
>  		enic->vf_type = ENIC_VF_TYPE_NONE;
>  		break;
>  	}
> +
> +	if (enic->vf_type == ENIC_VF_TYPE_V2) {

Maybe invert the if case here?

	if (enic->vf_type != ENIC_VF_TYPE_V2)
		return

And then shift the rest to the left

This might be easier to read, and the code looks better, in general.

  reply	other threads:[~2026-04-08 16:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08 15:08 [PATCH net-next v2 00/10] enic: SR-IOV V2 admin channel and MBOX protocol Satish Kharat via B4 Relay
2026-04-08 15:08 ` [PATCH net-next v2 01/10] enic: verify firmware supports V2 SR-IOV at probe time Satish Kharat via B4 Relay
2026-04-08 16:04   ` Breno Leitao [this message]
2026-04-08 15:08 ` [PATCH net-next v2 02/10] enic: add admin channel open and close for SR-IOV Satish Kharat via B4 Relay
2026-04-08 15:08 ` [PATCH net-next v2 03/10] enic: add admin RQ buffer management Satish Kharat via B4 Relay
2026-04-08 15:08 ` [PATCH net-next v2 04/10] enic: add admin CQ service with MSI-X interrupt and NAPI polling Satish Kharat via B4 Relay
2026-04-08 15:08 ` [PATCH net-next v2 05/10] enic: define MBOX message types and header structures Satish Kharat via B4 Relay
2026-04-08 15:08 ` [PATCH net-next v2 06/10] enic: add MBOX core send and receive for admin channel Satish Kharat via B4 Relay
2026-04-08 15:08 ` [PATCH net-next v2 07/10] enic: add MBOX PF handlers for VF register and capability Satish Kharat via B4 Relay
2026-04-08 15:08 ` [PATCH net-next v2 08/10] enic: add MBOX VF handlers for capability, register and link state Satish Kharat via B4 Relay
2026-04-08 15:08 ` [PATCH net-next v2 09/10] enic: wire V2 SR-IOV enable with admin channel and MBOX Satish Kharat via B4 Relay
2026-04-08 15:08 ` [PATCH net-next v2 10/10] enic: add V2 VF probe with admin channel and PF registration Satish Kharat via B4 Relay

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=adZ8LrpNZbQgy3NO@gmail.com \
    --to=leitao@debian.org \
    --cc=20260401-enic-sriov-v2-prep-v4-0-d5834b2ef1b9@cisco.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=satishkh@cisco.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