Re: [PATCH net-next v8 01/10] enic: verify firmware supports V2 SR-IOV at probe time
From: Satish Kharat
Date: Tue Jun 09 2026 - 14:30:55 EST
/"Can we get here with SR-IOV enabled? Then we want to disable it on failure."/
No — enic_sriov_detect_vf_type() runs during early probe, before any SR-IOV enablement path executes.
The auto-enable path (for pre-configured VFs at boot) runs later in enic_probe() and already skips V2:
if (enic->num_vfs && enic->vf_type != ENIC_VF_TYPE_V2) { err = pci_enable_sriov(pdev, enic->num_vfs);
The user-triggered path (sriov_configure) also checks vf_type and returns -EOPNOTSUPP when it is
ENIC_VF_TYPE_NONE.
So at the point where this function downgrades vf_type to ENIC_VF_TYPE_NONE, SR-IOV has not been enabled
and there is nothing to disable
On 6/9/26 10:30, Breno Leitao wrote:
On Tue, Jun 09, 2026 at 09:32:27AM -0700, Satish Kharat wrote:
During PF probe, query the firmware get-supported-feature interfaceCan we get here with SR-IOV enabled? Then we want to disable it on
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.
VIC_FEATURE_SRIOV is assigned the explicit value 4 to match the
firmware ABI. Slot 3 (firmware's VIC_FEATURE_PTP) is reserved with
a comment rather than a placeholder enum entry, since PTP is not
used by the upstream driver.
Suggested-by: Breno Leitao <leitao@xxxxxxxxxx>
Signed-off-by: Satish Kharat <satishkh@xxxxxxxxx>
---
drivers/net/ethernet/cisco/enic/enic_main.c | 21 ++++++++++++++++++++-
drivers/net/ethernet/cisco/enic/vnic_devcmd.h | 2 ++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index e7125b818087..53d68272d06a 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;
- int pos;
+ u64 supported_versions, a1 = 0;
u16 vf_dev_id;
+ int pos;
+ int err;
if (enic_is_sriov_vf(enic) || enic_is_dynamic(enic))
return;
@@ -2669,6 +2671,23 @@ 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)
failure.