diff mbox series

[V2,02/10] net/bnxt: fix probe failure in FreeBSD

Message ID 20200113050118.28719-3-kalesh-anakkur.purayil@broadcom.com (mailing list archive)
State Superseded, archived
Delegated to: Ajit Khaparde
Headers show
Series bnxt patchset with bug fixes | expand


Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Kalesh A P Jan. 13, 2020, 5:01 a.m. UTC
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

In FreeBSD environment, nic_uio driver does not support interrupts
and rte_intr_callback_register() will fail to register interrupts
which in turn causes bnxt driver probe failure.

Fixed driver to ignore interrupt callback failures in FreeBSD.
Also fixed to not use a dedicated completion ring for async events
from FW and process these events on RXQ0 in FreeBSD.

Fixes: 6de4c538b393 ("net/bnxt: fix error handling in port start")
Fixes: 43f78b380f89 ("net/bnxt: retry IRQ callback deregistration")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
 drivers/net/bnxt/bnxt.h        | 8 ++++++++
 drivers/net/bnxt/bnxt_ethdev.c | 3 +++
 drivers/net/bnxt/bnxt_irq.c    | 8 ++++++++
 3 files changed, 19 insertions(+)
diff mbox series


diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 21ca059..3487b91 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -117,6 +117,14 @@ 
 #define BNXT_NUM_ASYNC_CPR(bp) 1
+/* In FreeBSD OS, nic_uio driver does not support interrupts */
+#define BNXT_NUM_ASYNC_CPR(bp)	0
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 7b5df9a..879ea58 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -439,8 +439,11 @@  static int bnxt_init_chip(struct bnxt *bp)
 	/* enable uio/vfio intr/eventfd mapping */
 	rc = rte_intr_enable(intr_handle);
+	/* In FreeBSD OS, nic_uio driver does not support interrupts */
 	if (rc)
 		goto err_free;
 	rc = bnxt_get_hwrm_link_config(bp, &new);
 	if (rc) {
diff --git a/drivers/net/bnxt/bnxt_irq.c b/drivers/net/bnxt/bnxt_irq.c
index 846325e..40e1b0c 100644
--- a/drivers/net/bnxt/bnxt_irq.c
+++ b/drivers/net/bnxt/bnxt_irq.c
@@ -181,5 +181,13 @@  int bnxt_request_int(struct bnxt *bp)
 			irq->requested = 1;
+	/**
+	 * In FreeBSD OS, nic_uio does not support interrupts and
+	 * interrupt register callback will fail.
+	 */
+	rc = 0;
 	return rc;