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 4E940A04E7; Mon, 2 Nov 2020 00:30:46 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6521337AF; Mon, 2 Nov 2020 00:28:46 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 3BC8D1E2B for ; Mon, 2 Nov 2020 00:28:37 +0100 (CET) IronPort-SDR: ulPuwiIGG61+/GnKxpSFVXJPf2bauzT+miTFTx45G0rkcCYRUFhnm8vV3y2sIB+sV7/IoYPGox 0+SHWUfkILFA== X-IronPort-AV: E=McAfee;i="6000,8403,9792"; a="148099226" X-IronPort-AV: E=Sophos;i="5.77,443,1596524400"; d="scan'208";a="148099226" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2020 15:28:36 -0800 IronPort-SDR: Vm+Ppk3A3f8nOts1YKy/WqZhybxPDSB4KPaLCwIbskw726tUXJa5u1VWkHhiGkeeuCUZ2ejlfX y7Rb60rLXXhw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,443,1596524400"; d="scan'208";a="305521515" Received: from txasoft-yocto.an.intel.com ([10.123.72.192]) by fmsmga007.fm.intel.com with ESMTP; 01 Nov 2020 15:28:36 -0800 From: Timothy McDaniel To: Cc: dev@dpdk.org, erik.g.carrillo@intel.com, gage.eads@intel.com, harry.van.haaren@intel.com, jerinj@marvell.com, thomas@monjalon.net Date: Sun, 1 Nov 2020 17:29:59 -0600 Message-Id: <1604273415-13912-8-git-send-email-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1604273415-13912-1-git-send-email-timothy.mcdaniel@intel.com> References: <20200612212434.6852-2-timothy.mcdaniel@intel.com> <1604273415-13912-1-git-send-email-timothy.mcdaniel@intel.com> Subject: [dpdk-dev] [PATCH v16 07/23] event/dlb: add flexible interface 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" This commit introduces the flexible interface. This interface allows the core code to operate in PF mode (direct hardware access) or bifurcated mode (hardware configured via kernel driver). This driver currently only supports PF modei, but bifurcated mode will be added in a future patch-set. Note that the flexible interface is not used for data path operations, and thus there are no performance concerns related to the use of function pointers. Signed-off-by: Timothy McDaniel Reviewed-by: Gage Eads --- drivers/event/dlb/dlb.c | 1 + drivers/event/dlb/dlb_iface.c | 27 +++++++++++++++++++++++++++ drivers/event/dlb/dlb_iface.h | 27 +++++++++++++++++++++++++++ drivers/event/dlb/meson.build | 1 + drivers/event/dlb/pf/dlb_pf.c | 1 + 5 files changed, 57 insertions(+) create mode 100644 drivers/event/dlb/dlb_iface.c create mode 100644 drivers/event/dlb/dlb_iface.h diff --git a/drivers/event/dlb/dlb.c b/drivers/event/dlb/dlb.c index 1659f93..8008a50 100644 --- a/drivers/event/dlb/dlb.c +++ b/drivers/event/dlb/dlb.c @@ -33,6 +33,7 @@ #include #include "dlb_priv.h" +#include "dlb_iface.h" #include "dlb_inline_fns.h" /* diff --git a/drivers/event/dlb/dlb_iface.c b/drivers/event/dlb/dlb_iface.c new file mode 100644 index 0000000..dd72120 --- /dev/null +++ b/drivers/event/dlb/dlb_iface.c @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2016-2020 Intel Corporation + */ + +#include + +#include "dlb_priv.h" + +/* DLB PMD Internal interface function pointers. + * If VDEV (bifurcated PMD), these will resolve to functions that issue ioctls + * serviced by DLB kernel module. + * If PCI (PF PMD), these will be implemented locally in user mode. + */ + +void (*dlb_iface_low_level_io_init)(struct dlb_eventdev *dlb); + +int (*dlb_iface_open)(struct dlb_hw_dev *handle, const char *name); + +int (*dlb_iface_get_device_version)(struct dlb_hw_dev *handle, + uint8_t *revision); + +int (*dlb_iface_get_num_resources)(struct dlb_hw_dev *handle, + struct dlb_get_num_resources_args *rsrcs); + +int (*dlb_iface_get_cq_poll_mode)(struct dlb_hw_dev *handle, + enum dlb_cq_poll_modes *mode); + diff --git a/drivers/event/dlb/dlb_iface.h b/drivers/event/dlb/dlb_iface.h new file mode 100644 index 0000000..416d1b3 --- /dev/null +++ b/drivers/event/dlb/dlb_iface.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2016-2020 Intel Corporation + */ + +#ifndef _DLB_IFACE_H +#define _DLB_IFACE_H + +/* DLB PMD Internal interface function pointers. + * If VDEV (bifurcated PMD), these will resolve to functions that issue ioctls + * serviced by DLB kernel module. + * If PCI (PF PMD), these will be implemented locally in user mode. + */ + +extern void (*dlb_iface_low_level_io_init)(struct dlb_eventdev *dlb); + +extern int (*dlb_iface_open)(struct dlb_hw_dev *handle, const char *name); + +extern int (*dlb_iface_get_device_version)(struct dlb_hw_dev *handle, + uint8_t *revision); + +extern int (*dlb_iface_get_num_resources)(struct dlb_hw_dev *handle, + struct dlb_get_num_resources_args *rsrcs); + +extern int (*dlb_iface_get_cq_poll_mode)(struct dlb_hw_dev *handle, + enum dlb_cq_poll_modes *mode); + +#endif /* _DLB_IFACE_H */ diff --git a/drivers/event/dlb/meson.build b/drivers/event/dlb/meson.build index 61c0182..0e66cdc 100644 --- a/drivers/event/dlb/meson.build +++ b/drivers/event/dlb/meson.build @@ -8,6 +8,7 @@ if not is_linux or not dpdk_conf.has('RTE_ARCH_X86_64') endif sources = files('dlb.c', + 'dlb_iface.c', 'pf/dlb_main.c', 'pf/dlb_pf.c' ) diff --git a/drivers/event/dlb/pf/dlb_pf.c b/drivers/event/dlb/pf/dlb_pf.c index 3f836f3..05fd76c 100644 --- a/drivers/event/dlb/pf/dlb_pf.c +++ b/drivers/event/dlb/pf/dlb_pf.c @@ -27,6 +27,7 @@ #include #include "../dlb_priv.h" +#include "../dlb_iface.h" #include "../dlb_inline_fns.h" #include "dlb_main.h" #include "base/dlb_hw_types.h" -- 2.6.4