From patchwork Thu Sep 24 12:11:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Rybchenko X-Patchwork-Id: 78691 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F3C44A04B1; Thu, 24 Sep 2020 14:15:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0BCC31DE6A; Thu, 24 Sep 2020 14:13:21 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id D4D101DE0C for ; Thu, 24 Sep 2020 14:12:55 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.7.65.64]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id A1EF0600C3 for ; Thu, 24 Sep 2020 12:12:55 +0000 (UTC) Received: from us4-mdac16-14.ut7.mdlocal (unknown [10.7.65.238]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id A1204200A4 for ; Thu, 24 Sep 2020 12:12:55 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.7.65.175]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 2B64122004D for ; Thu, 24 Sep 2020 12:12:55 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id D6EF6700070 for ; Thu, 24 Sep 2020 12:12:54 +0000 (UTC) Received: from ukex01.SolarFlarecom.com (10.17.10.4) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 24 Sep 2020 13:12:46 +0100 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 24 Sep 2020 13:12:46 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id 08OCCkwm025930 for ; Thu, 24 Sep 2020 13:12:46 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 9DA611613AB for ; Thu, 24 Sep 2020 13:12:46 +0100 (BST) From: Andrew Rybchenko To: Date: Thu, 24 Sep 2020 13:11:53 +0100 Message-ID: <1600949555-28043-19-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1600949555-28043-1-git-send-email-arybchenko@solarflare.com> References: <1600764594-14752-1-git-send-email-arybchenko@solarflare.com> <1600949555-28043-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25674.003 X-TM-AS-Result: No-3.096400-8.000000-10 X-TMASE-MatchedRID: lQPLoPzCze+pgGo75YSM1vQAclqqmRB8B4Id7CiQcz+d+HCgvauVHmlz JgrTfsrk2XHJ0L4jOIQs/31GzKkTsQihmwiXCMoGT7O/YHJhINBLXPA26IG0hN9RlPzeVuQQ0/6 Rc2rmS5nMKGeIfeUBXiqrPYi9XdxOwUGgKARXgvII5rLLSVe5tDH+T3YvtHy2Mhn6P25qDUYnOW hZYy8qHQ/lXHZipk3pdbTStsy7fOk9MbU686G+bSt4VwAzFx+tLPSJu5jov2aMUViaYYbK3Lv6v rbswMDMnYPv5A2HZ5wvLS7YPMTpw4gPQuqHpFiE8UIP9c6qlJtrYyH4xhW2/5soi2XrUn/Jxclq bZU3Xcd4N1jhRVQFLSdET58jp62Sfor9AcXU1xwApmNFfOh5DkVKfbWjOnm7fX06U5xETjtrXKB aPhNRsReDyT8g1pyxAOEiPxF4jRAI4T29I1FCAtlqviuwt+1+qha7fcVIKfrqvk9CHHb0NQbT7e VkE2ZC2rhEGiFuOiuny9fy0ieryw== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--3.096400-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25674.003 X-MDID: 1600949575-KZE2WDtunUW0 Subject: [dpdk-dev] [PATCH v3 18/60] common/sfc_efx/base: add interrupts module for Riverhead 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" Riverhead supports interrupt aggregation rings. Right now there are no plans to support it in libefx, but it is better to have own set of callbacks to easier handle EF10 and Riverhead differences in the future. Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/common/sfc_efx/base/efx_intr.c | 20 +++++ drivers/common/sfc_efx/base/meson.build | 1 + drivers/common/sfc_efx/base/rhead_impl.h | 55 ++++++++++++ drivers/common/sfc_efx/base/rhead_intr.c | 104 +++++++++++++++++++++++ 4 files changed, 180 insertions(+) create mode 100644 drivers/common/sfc_efx/base/rhead_intr.c diff --git a/drivers/common/sfc_efx/base/efx_intr.c b/drivers/common/sfc_efx/base/efx_intr.c index 7e3cc3c6a0..1dfa19df2e 100644 --- a/drivers/common/sfc_efx/base/efx_intr.c +++ b/drivers/common/sfc_efx/base/efx_intr.c @@ -89,6 +89,20 @@ static const efx_intr_ops_t __efx_intr_ef10_ops = { }; #endif /* EFX_OPTS_EF10() */ +#if EFSYS_OPT_RIVERHEAD +static const efx_intr_ops_t __efx_intr_rhead_ops = { + rhead_intr_init, /* eio_init */ + rhead_intr_enable, /* eio_enable */ + rhead_intr_disable, /* eio_disable */ + rhead_intr_disable_unlocked, /* eio_disable_unlocked */ + rhead_intr_trigger, /* eio_trigger */ + rhead_intr_status_line, /* eio_status_line */ + rhead_intr_status_message, /* eio_status_message */ + rhead_intr_fatal, /* eio_fatal */ + rhead_intr_fini, /* eio_fini */ +}; +#endif /* EFSYS_OPT_RIVERHEAD */ + __checkReturn efx_rc_t efx_intr_init( __in efx_nic_t *enp, @@ -138,6 +152,12 @@ efx_intr_init( break; #endif /* EFSYS_OPT_MEDFORD2 */ +#if EFSYS_OPT_RIVERHEAD + case EFX_FAMILY_RIVERHEAD: + eiop = &__efx_intr_rhead_ops; + break; +#endif /* EFSYS_OPT_RIVERHEAD */ + default: EFSYS_ASSERT(B_FALSE); rc = ENOTSUP; diff --git a/drivers/common/sfc_efx/base/meson.build b/drivers/common/sfc_efx/base/meson.build index 6ca5b57023..ea2517ba26 100644 --- a/drivers/common/sfc_efx/base/meson.build +++ b/drivers/common/sfc_efx/base/meson.build @@ -52,6 +52,7 @@ sources = [ 'hunt_nic.c', 'medford_nic.c', 'medford2_nic.c', + 'rhead_intr.c', 'rhead_nic.c', ] diff --git a/drivers/common/sfc_efx/base/rhead_impl.h b/drivers/common/sfc_efx/base/rhead_impl.h index e25a871cb3..b95302a13f 100644 --- a/drivers/common/sfc_efx/base/rhead_impl.h +++ b/drivers/common/sfc_efx/base/rhead_impl.h @@ -98,6 +98,61 @@ rhead_nic_unprobe( __in efx_nic_t *enp); +/* INTR */ + +LIBEFX_INTERNAL +extern __checkReturn efx_rc_t +rhead_intr_init( + __in efx_nic_t *enp, + __in efx_intr_type_t type, + __in efsys_mem_t *esmp); + +LIBEFX_INTERNAL +extern void +rhead_intr_enable( + __in efx_nic_t *enp); + +LIBEFX_INTERNAL +extern void +rhead_intr_disable( + __in efx_nic_t *enp); + +LIBEFX_INTERNAL +extern void +rhead_intr_disable_unlocked( + __in efx_nic_t *enp); + +LIBEFX_INTERNAL +extern __checkReturn efx_rc_t +rhead_intr_trigger( + __in efx_nic_t *enp, + __in unsigned int level); + +LIBEFX_INTERNAL +extern void +rhead_intr_status_line( + __in efx_nic_t *enp, + __out boolean_t *fatalp, + __out uint32_t *qmaskp); + +LIBEFX_INTERNAL +extern void +rhead_intr_status_message( + __in efx_nic_t *enp, + __in unsigned int message, + __out boolean_t *fatalp); + +LIBEFX_INTERNAL +extern void +rhead_intr_fatal( + __in efx_nic_t *enp); + +LIBEFX_INTERNAL +extern void +rhead_intr_fini( + __in efx_nic_t *enp); + + #ifdef __cplusplus } #endif diff --git a/drivers/common/sfc_efx/base/rhead_intr.c b/drivers/common/sfc_efx/base/rhead_intr.c new file mode 100644 index 0000000000..08c770529f --- /dev/null +++ b/drivers/common/sfc_efx/base/rhead_intr.c @@ -0,0 +1,104 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2019-2020 Xilinx, Inc. + * Copyright(c) 2018-2019 Solarflare Communications Inc. + */ + +#include "efx.h" +#include "efx_impl.h" + + +#if EFSYS_OPT_RIVERHEAD + + __checkReturn efx_rc_t +rhead_intr_init( + __in efx_nic_t *enp, + __in efx_intr_type_t type, + __in efsys_mem_t *esmp) +{ + _NOTE(ARGUNUSED(enp, type, esmp)) + + return (0); +} + + + void +rhead_intr_enable( + __in efx_nic_t *enp) +{ + _NOTE(ARGUNUSED(enp)) +} + + + void +rhead_intr_disable( + __in efx_nic_t *enp) +{ + _NOTE(ARGUNUSED(enp)) +} + + + void +rhead_intr_disable_unlocked( + __in efx_nic_t *enp) +{ + _NOTE(ARGUNUSED(enp)) +} + + __checkReturn efx_rc_t +rhead_intr_trigger( + __in efx_nic_t *enp, + __in unsigned int level) +{ + _NOTE(ARGUNUSED(enp, level)) + + return (ENOTSUP); +} + + void +rhead_intr_status_line( + __in efx_nic_t *enp, + __out boolean_t *fatalp, + __out uint32_t *qmaskp) +{ + _NOTE(ARGUNUSED(enp, qmaskp)) + + /* + * Riverhead does not support line interrupts, + * so this function should never be called. + */ + + /* Fatal errors are reported via events */ + *fatalp = B_FALSE; +} + + void +rhead_intr_status_message( + __in efx_nic_t *enp, + __in unsigned int message, + __out boolean_t *fatalp) +{ + EFSYS_ASSERT(enp->en_family == EFX_FAMILY_RIVERHEAD); + + _NOTE(ARGUNUSED(enp, message)) + + /* Fatal errors are reported via events */ + *fatalp = B_FALSE; +} + + void +rhead_intr_fatal( + __in efx_nic_t *enp) +{ + /* Fatal errors are reported via events */ + _NOTE(ARGUNUSED(enp)) +} + + void +rhead_intr_fini( + __in efx_nic_t *enp) +{ + _NOTE(ARGUNUSED(enp)) +} + +#endif /* EFSYS_OPT_RIVERHEAD */