From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 93569A04F0; Mon, 13 Jan 2020 05:19:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A55B11D583; Mon, 13 Jan 2020 05:19:08 +0100 (CET) Received: from relay.smtp.broadcom.com (relay.smtp.broadcom.com [192.19.232.149]) by dpdk.org (Postfix) with ESMTP id E90EA1D54A for ; Mon, 13 Jan 2020 05:19:05 +0100 (CET) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 3BF8F1BDD0B; Sun, 12 Jan 2020 20:19:03 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 3BF8F1BDD0B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1578889144; bh=ZwADPPyD0rPgik47DbN6xMS3IaGjTsCF6M+9jeIoKiU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nOYjLGioZI6I5XiyCC89fZMysq2ZXz8LnYUkXfJ69dMfk3ld8WzZGD0TW4zJbMKg0 luBky0szisM6ImuFhLxuyvhIOhlKDbJ26TZgCd4ACcsvUMmURcD2ul31f7BAd5sOTF kPfmZkEBSx1u8pghvqyKRc831GqpNHpe6UX2mcx0= From: Kalesh A P To: dev@dpdk.org, ajit.khaparde@broadcom.com Cc: ferruh.yigit@intel.com Date: Mon, 13 Jan 2020 10:06:01 +0530 Message-Id: <20200113043609.27363-3-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20200113043609.27363-1-kalesh-anakkur.purayil@broadcom.com> References: <20200113043609.27363-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [PATCH 02/10] net/bnxt: fix probe failure in FreeBSD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kalesh AP 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 Reviewed-by: Somnath Kotur Reviewed-by: Ajit Kumar Khaparde Reviewed-by: Santoshkumar Karanappa Rastapur --- 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 --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 #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 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); +#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 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; } +#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; } -- 2.10.1