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 79B8DA052B; Thu, 30 Jul 2020 21:55:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 305DA1C0DC; Thu, 30 Jul 2020 21:53:27 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 803601C002 for ; Thu, 30 Jul 2020 21:53:14 +0200 (CEST) IronPort-SDR: uXeJE0Qkz9aUXampmU6Pa+87iWFOKCVlGUdNjwY+op2F9zyGXqLcOv4KztiFzqqDRo+BSndfmO E12DJ55TgMvg== X-IronPort-AV: E=McAfee;i="6000,8403,9698"; a="139672309" X-IronPort-AV: E=Sophos;i="5.75,415,1589266800"; d="scan'208";a="139672309" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2020 12:53:12 -0700 IronPort-SDR: 2YETDMufcvDvGUFwPAxMwpdYjZ1K9xHF82qNxGjtLk/UtyTKBH2uEJm9nbcb5Bxbk/juvd81lk cvus7KJ1bsjQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,415,1589266800"; d="scan'208";a="465378106" Received: from txasoft-yocto.an.intel.com ([10.123.72.192]) by orsmga005.jf.intel.com with ESMTP; 30 Jul 2020 12:53:11 -0700 From: "McDaniel, Timothy" To: jerinj@marvell.com Cc: mattias.ronnblom@ericsson.com, dev@dpdk.org, gage.eads@intel.com, harry.van.haaren@intel.com, "McDaniel, Timothy" Date: Thu, 30 Jul 2020 14:49:58 -0500 Message-Id: <1596138614-17409-12-git-send-email-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1596138614-17409-1-git-send-email-timothy.mcdaniel@intel.com> References: <1593232671-5690-0-git-send-email-timothy.mcdaniel@intel.com> <1596138614-17409-1-git-send-email-timothy.mcdaniel@intel.com> Subject: [dpdk-dev] [PATCH 11/27] event/dlb: add flexible PMD to device interfaces 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: "McDaniel, Timothy" The PMD uses function pointers so that it can be executed as a bifurcated PMD accessing hardware via a linux kernel mode driver, or as a PF PMD where it has complete control of the hardware device. Note that this interface is not used in the data path. Signed-off-by: McDaniel, Timothy --- drivers/event/dlb/Makefile | 1 + drivers/event/dlb/dlb_iface.c | 105 +++++++++++++++++++++++++++++++++++++++++ drivers/event/dlb/dlb_iface.h | 92 ++++++++++++++++++++++++++++++++++++ drivers/event/dlb/meson.build | 3 +- 4 files changed, 200 insertions(+), 1 deletion(-) create mode 100644 drivers/event/dlb/dlb_iface.c create mode 100644 drivers/event/dlb/dlb_iface.h diff --git a/drivers/event/dlb/Makefile b/drivers/event/dlb/Makefile index 0d27fc3..b506e75 100644 --- a/drivers/event/dlb/Makefile +++ b/drivers/event/dlb/Makefile @@ -20,6 +20,7 @@ LIBABIVER := 1 EXPORT_MAP := rte_pmd_dlb_event_version.map # library source files +SRCS-$(CONFIG_RTE_LIBRTE_PMD_DLB_EVENTDEV) += dlb_iface.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_DLB_EVENTDEV) += pf/dlb_pf.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_DLB_EVENTDEV) += pf/dlb_main.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_DLB_EVENTDEV) += pf/base/dlb_resource.c diff --git a/drivers/event/dlb/dlb_iface.c b/drivers/event/dlb/dlb_iface.c new file mode 100644 index 0000000..72f2452 --- /dev/null +++ b/drivers/event/dlb/dlb_iface.c @@ -0,0 +1,105 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2016-2020 Intel Corporation + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#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); + +void (*dlb_iface_domain_close)(struct dlb_eventdev *dlb); + +int (*dlb_iface_get_driver_version)(struct dlb_hw_dev *handle, + struct dlb_cmd_response *response); + +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_sched_domain_create)(struct dlb_hw_dev *handle, + struct dlb_create_sched_domain_args *args); + +int (*dlb_iface_ldb_credit_pool_create)(struct dlb_hw_dev *handle, + struct dlb_create_ldb_pool_args *cfg); + +int (*dlb_iface_dir_credit_pool_create)(struct dlb_hw_dev *handle, + struct dlb_create_dir_pool_args *cfg); + +int (*dlb_iface_ldb_queue_create)(struct dlb_hw_dev *handle, + struct dlb_create_ldb_queue_args *cfg); + +int (*dlb_iface_dir_queue_create)(struct dlb_hw_dev *handle, + struct dlb_create_dir_queue_args *cfg); + +int (*dlb_iface_ldb_port_create)(struct dlb_hw_dev *handle, + struct dlb_create_ldb_port_args *cfg, + enum dlb_cq_poll_modes poll_mode); + +int (*dlb_iface_dir_port_create)(struct dlb_hw_dev *handle, + struct dlb_create_dir_port_args *cfg, + enum dlb_cq_poll_modes poll_mode); + +int (*dlb_iface_map_qid)(struct dlb_hw_dev *handle, + struct dlb_map_qid_args *cfg); + +int (*dlb_iface_unmap_qid)(struct dlb_hw_dev *handle, + struct dlb_unmap_qid_args *cfg); + +int (*dlb_iface_sched_domain_start)(struct dlb_hw_dev *handle, + struct dlb_start_domain_args *cfg); + +int (*dlb_iface_block_on_cq_interrupt)(struct dlb_hw_dev *handle, + int port_id, bool is_ldb, + volatile void *cq_va, uint8_t cq_gen, + bool arm); + +int (*dlb_iface_pending_port_unmaps)(struct dlb_hw_dev *handle, + struct dlb_pending_port_unmaps_args *args); + +int (*dlb_iface_get_ldb_queue_depth)(struct dlb_hw_dev *handle, + struct dlb_get_ldb_queue_depth_args *args); + +int (*dlb_iface_get_dir_queue_depth)(struct dlb_hw_dev *handle, + struct dlb_get_dir_queue_depth_args *args); + +int (*dlb_iface_enqueue_domain_alert)(struct dlb_hw_dev *handle, + uint64_t alert_data); + +int (*dlb_iface_get_cq_poll_mode)(struct dlb_hw_dev *handle, + enum dlb_cq_poll_modes *mode); + +int (*dlb_iface_get_sn_allocation)(struct dlb_hw_dev *handle, + struct dlb_get_sn_allocation_args *args); + +int (*dlb_iface_set_sn_allocation)(struct dlb_hw_dev *handle, + struct dlb_set_sn_allocation_args *args); + +int (*dlb_iface_get_sn_occupancy)(struct dlb_hw_dev *handle, + struct dlb_get_sn_occupancy_args *args); + +void (*dlb_iface_port_mmap)(struct dlb_port *qm_port); diff --git a/drivers/event/dlb/dlb_iface.h b/drivers/event/dlb/dlb_iface.h new file mode 100644 index 0000000..8c3d88b --- /dev/null +++ b/drivers/event/dlb/dlb_iface.h @@ -0,0 +1,92 @@ +/* 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 void (*dlb_iface_domain_close)(struct dlb_eventdev *dlb); + +extern int (*dlb_iface_get_driver_version)(struct dlb_hw_dev *handle, + struct dlb_cmd_response *response); + +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_sched_domain_create)(struct dlb_hw_dev *handle, + struct dlb_create_sched_domain_args *args); + +extern int (*dlb_iface_ldb_credit_pool_create)(struct dlb_hw_dev *handle, + struct dlb_create_ldb_pool_args *cfg); + +extern int (*dlb_iface_dir_credit_pool_create)(struct dlb_hw_dev *handle, + struct dlb_create_dir_pool_args *cfg); + +extern int (*dlb_iface_ldb_queue_create)(struct dlb_hw_dev *handle, + struct dlb_create_ldb_queue_args *cfg); + +extern int (*dlb_iface_dir_queue_create)(struct dlb_hw_dev *handle, + struct dlb_create_dir_queue_args *cfg); + +extern int (*dlb_iface_ldb_port_create)(struct dlb_hw_dev *handle, + struct dlb_create_ldb_port_args *cfg, + enum dlb_cq_poll_modes poll_mode); + +extern int (*dlb_iface_dir_port_create)(struct dlb_hw_dev *handle, + struct dlb_create_dir_port_args *cfg, + enum dlb_cq_poll_modes poll_mode); + +extern int (*dlb_iface_map_qid)(struct dlb_hw_dev *handle, + struct dlb_map_qid_args *cfg); + +extern int (*dlb_iface_unmap_qid)(struct dlb_hw_dev *handle, + struct dlb_unmap_qid_args *cfg); + +extern int (*dlb_iface_sched_domain_start)(struct dlb_hw_dev *handle, + struct dlb_start_domain_args *cfg); + +extern int (*dlb_iface_block_on_cq_interrupt)(struct dlb_hw_dev *handle, + int port_id, bool is_ldb, + volatile void *cq_va, uint8_t cq_gen, + bool arm); + +extern int (*dlb_iface_pending_port_unmaps)(struct dlb_hw_dev *handle, + struct dlb_pending_port_unmaps_args *args); + +extern int (*dlb_iface_get_ldb_queue_depth)(struct dlb_hw_dev *handle, + struct dlb_get_ldb_queue_depth_args *args); + +extern int (*dlb_iface_get_dir_queue_depth)(struct dlb_hw_dev *handle, + struct dlb_get_dir_queue_depth_args *args); + +extern int (*dlb_iface_enqueue_domain_alert)(struct dlb_hw_dev *handle, + uint64_t alert_data); + +extern int (*dlb_iface_get_cq_poll_mode)(struct dlb_hw_dev *handle, + enum dlb_cq_poll_modes *mode); + +extern int (*dlb_iface_get_sn_allocation)(struct dlb_hw_dev *handle, + struct dlb_get_sn_allocation_args *args); + +extern int (*dlb_iface_set_sn_allocation)(struct dlb_hw_dev *handle, + struct dlb_set_sn_allocation_args *args); + +extern int (*dlb_iface_get_sn_occupancy)(struct dlb_hw_dev *handle, + struct dlb_get_sn_occupancy_args *args); + +extern void (*dlb_iface_port_mmap)(struct dlb_port *qm_port); + +#endif /* _DLB_IFACE_H */ diff --git a/drivers/event/dlb/meson.build b/drivers/event/dlb/meson.build index 1e30b4c..1471a43 100644 --- a/drivers/event/dlb/meson.build +++ b/drivers/event/dlb/meson.build @@ -1,7 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2019-2020 Intel Corporation -sources = files('pf/dlb_pf.c', +sources = files('dlb_iface.c', + 'pf/dlb_pf.c', 'pf/dlb_main.c', 'pf/base/dlb_resource.c' ) -- 1.7.10