git: 6f12a32d1e8b - stable/15 - bnxt: Fix build / load error for bnxt(4) in kernels without PCI_IOV
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 30 Sep 2026 10:41:32 UTC
The branch stable/15 has been updated by ssaxena:
URL: https://cgit.FreeBSD.org/src/commit/?id=6f12a32d1e8b76f9455730695a20cef47d8d7b52
commit 6f12a32d1e8b76f9455730695a20cef47d8d7b52
Author: Andrew Gallatin <gallatin@FreeBSD.org>
AuthorDate: 2026-05-29 12:52:44 +0000
Commit: Sumit Saxena <ssaxena@FreeBSD.org>
CommitDate: 2026-09-30 10:39:31 +0000
bnxt: Fix build / load error for bnxt(4) in kernels without PCI_IOV
This change removes the hard-forcing of PCI_IOV and adds shims to
allow the driver to compile and work when the kernel is missing
PCI_IOV support.
Fixes: 7c450d1127c7
Reviewed by: sumit.saxena_broadcom.com
Differential Revision: https://reviews.freebsd.org/D57300
Sponsored by: Netflix
(cherry picked from commit 3118f1b99f23431235c202d9aadbe3d183bcc259)
---
sys/dev/bnxt/bnxt_en/bnxt_sriov.c | 39 +++++++++++++++++++++++++++++++++++++++
sys/dev/bnxt/bnxt_en/bnxt_sriov.h | 4 ----
sys/dev/bnxt/bnxt_en/if_bnxt.c | 2 --
3 files changed, 39 insertions(+), 6 deletions(-)
diff --git a/sys/dev/bnxt/bnxt_en/bnxt_sriov.c b/sys/dev/bnxt/bnxt_en/bnxt_sriov.c
index 270c18165fb7..071feffbadfd 100644
--- a/sys/dev/bnxt/bnxt_en/bnxt_sriov.c
+++ b/sys/dev/bnxt/bnxt_en/bnxt_sriov.c
@@ -7,6 +7,8 @@
#include "bnxt_hwrm.h"
#include "bnxt_sriov.h"
+#ifdef PCI_IOV
+
static int
bnxt_set_vf_admin_mac(struct bnxt_softc *softc, struct bnxt_vf_info *vf,
const uint8_t *mac)
@@ -973,6 +975,43 @@ void bnxt_sriov_attach(struct bnxt_softc *softc)
device_printf(dev, "Failed to initialize SR-IOV (error=%d)\n", rc);
}
+#else
+
+void
+bnxt_sriov_attach(struct bnxt_softc *softc __unused)
+{
+}
+
+int
+bnxt_cfg_hw_sriov(struct bnxt_softc *softc __unused,
+ uint16_t *num_vfs __unused, bool reset __unused)
+{
+ return (0);
+}
+
+int
+bnxt_approve_mac(struct bnxt_softc *sc __unused)
+{
+ return (0);
+}
+
+void
+bnxt_hwrm_exec_fwd_req(struct bnxt_softc *softc __unused)
+{
+}
+
+bool
+bnxt_promisc_ok(struct bnxt_softc *softc __unused)
+{
+ return (true);
+}
+
+void
+bnxt_update_vf_mac(struct bnxt_softc *sc __unused)
+{
+}
+#endif
+
void bnxt_reenable_sriov(struct bnxt_softc *bp)
{
if (BNXT_PF(bp)) {
diff --git a/sys/dev/bnxt/bnxt_en/bnxt_sriov.h b/sys/dev/bnxt/bnxt_en/bnxt_sriov.h
index 176f54af0aa8..24ea11f29b83 100644
--- a/sys/dev/bnxt/bnxt_en/bnxt_sriov.h
+++ b/sys/dev/bnxt/bnxt_en/bnxt_sriov.h
@@ -8,10 +8,6 @@
#include "opt_global.h"
#include "bnxt.h"
-#ifndef PCI_IOV
-#define PCI_IOV 1
-#endif
-
/* macro definations */
#define BNXT_MAX_VFS 4
diff --git a/sys/dev/bnxt/bnxt_en/if_bnxt.c b/sys/dev/bnxt/bnxt_en/if_bnxt.c
index e43f1a3db63e..08c77ac73fa1 100644
--- a/sys/dev/bnxt/bnxt_en/if_bnxt.c
+++ b/sys/dev/bnxt/bnxt_en/if_bnxt.c
@@ -2887,11 +2887,9 @@ bnxt_attach_post(if_ctx_t ctx)
bnxt_dcb_init(softc);
bnxt_rdma_aux_device_init(softc);
-#if PCI_IOV
/* SR-IOV attach */
if (BNXT_PF(softc) && BNXT_CHIP_P5_PLUS(softc))
bnxt_sriov_attach(softc);
-#endif
failed:
return rc;