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 4B7ADA00BE; Fri, 12 Jun 2020 23:28:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 06C931C044; Fri, 12 Jun 2020 23:26:39 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 4FCBF1BF95 for ; Fri, 12 Jun 2020 23:26:27 +0200 (CEST) IronPort-SDR: JA+M9NWZ4KGXncumjdprkm7qhmNruBCmX8Lw9nC/0YJlnKsvis60Ht9c6zPPvzitcx7Ui7Gf6d txyZj2t/Y+uw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2020 14:26:26 -0700 IronPort-SDR: GM1DQheCpcdYuOoNjXjxoELNpd6KLFgOL/LcGrrB8ZMzMEFPCNwCHmpqLOluE2NqlwuUK/vbfB aGiggEKndcDw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,504,1583222400"; d="scan'208";a="272035824" Received: from txasoft-yocto.an.intel.com ([10.123.72.192]) by orsmga003.jf.intel.com with ESMTP; 12 Jun 2020 14:26:26 -0700 From: "McDaniel, Timothy" To: jerinj@marvell.com Cc: dev@dpdk.org, gage.eads@intel.com, harry.van.haaren@intel.com Date: Fri, 12 Jun 2020 16:24:18 -0500 Message-Id: <20200612212434.6852-12-timothy.mcdaniel@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20200612212434.6852-1-timothy.mcdaniel@intel.com> References: <20200612212434.6852-1-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" 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. Change-Id: I42a3f9d7370e9a7d89855ea1327cb31df4eebf85 Signed-off-by: McDaniel, Timothy Change-Id: I3cce87a28b95cf6e528420da89c8435f41a233ee Signed-off-by: McDaniel, Timothy --- drivers/event/dlb/dlb_iface.c | 105 ++++++++++++++++++++++++++++++++++++++++++ drivers/event/dlb/dlb_iface.h | 92 ++++++++++++++++++++++++++++++++++++ 2 files changed, 197 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_iface.c b/drivers/event/dlb/dlb_iface.c new file mode 100644 index 000000000..72f245220 --- /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 000000000..8c3d88bfe --- /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 */ -- 2.13.6