From: Kalesh AP Date: Thu, 16 Jan 2020 13:04:47 +0000 (+0530) Subject: net/bnxt: fix probe in FreeBSD X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d9fc6a0d07559cfa718efe971a51620c23ba211e;p=dpdk.git net/bnxt: fix probe in FreeBSD 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") Cc: stable@dpdk.org Signed-off-by: Kalesh AP Reviewed-by: Somnath Kotur Reviewed-by: Ajit Khaparde Reviewed-by: Santoshkumar Karanappa Rastapur --- diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 21ca059b8a..3487b917ed 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -117,6 +117,14 @@ #define BNXT_NUM_ASYNC_CPR(bp) 1 #endif +/* In FreeBSD OS, nic_uio driver does not support interrupts */ +#ifdef RTE_EXEC_ENV_FREEBSD +#ifdef BNXT_NUM_ASYNC_CPR +#undef BNXT_NUM_ASYNC_CPR +#endif +#define BNXT_NUM_ASYNC_CPR(bp) 0 +#endif + #define BNXT_MISC_VEC_ID RTE_INTR_VEC_ZERO_OFFSET #define BNXT_RX_VEC_START RTE_INTR_VEC_RXTX_OFFSET diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index 7b5df9ac12..879ea580fe 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -439,8 +439,11 @@ skip_cosq_cfg: /* enable uio/vfio intr/eventfd mapping */ rc = rte_intr_enable(intr_handle); +#ifndef RTE_EXEC_ENV_FREEBSD + /* In FreeBSD OS, nic_uio driver does not support interrupts */ if (rc) goto err_free; +#endif 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 846325ea96..40e1b0c980 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; } +#ifdef RTE_EXEC_ENV_FREEBSD + /** + * In FreeBSD OS, nic_uio does not support interrupts and + * interrupt register callback will fail. + */ + rc = 0; +#endif + return rc; }