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 2FDE8A04FD; Tue, 14 Jan 2020 06:16:52 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B0CEA1C2DA; Tue, 14 Jan 2020 06:16:38 +0100 (CET) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id CB9BD1C2AF for ; Tue, 14 Jan 2020 06:16:32 +0100 (CET) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.242.48]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 3395630C54A; Mon, 13 Jan 2020 21:10:21 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 3395630C54A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1578978621; bh=P1Nd9yDJ7VpUCtFtvD8byX0SN1kmslrxXjA5PA8kNp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d951pYAGl2RT/i3Sv2WbQgcR8kRZ+21GZ21F6dfSxrlpg6WgMGNLEA2nCNmTi925V z+xB59DbrHfcLAY3CA1ejh01zcTr/JPDmXnWOh8sYRi5z3x+vvgzz9YjY5C+NJl4ok +pAv80Qvo+i28bbNfjjJyMf5OBRqOcdLT0QlJ+IA= Received: from localhost.localdomain (unknown [10.230.30.124]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id 4C23214008E; Mon, 13 Jan 2020 21:16:31 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Kalesh AP , Somnath Kotur , Santoshkumar Karanappa Rastapur Date: Mon, 13 Jan 2020 21:14:27 -0800 Message-Id: <20200114051435.46093-3-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122.2) In-Reply-To: <20200114051435.46093-1-ajit.khaparde@broadcom.com> References: <20200113050118.28719-1-kalesh-anakkur.purayil@broadcom.com> <20200114051435.46093-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 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 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 21ca059b8..3487b917e 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 7b5df9ac1..879ea580f 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 846325ea9..40e1b0c98 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.21.0 (Apple Git-122.2)