From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4C601A0C58; Mon, 23 Aug 2021 21:41:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A12FE411B1; Mon, 23 Aug 2021 21:40:56 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id E362C411DB for ; Mon, 23 Aug 2021 21:40:54 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 17NDcCBO018249; Mon, 23 Aug 2021 12:40:54 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=Oz2as0eKdTVyQ9X8O+WKv4bB/ap4xeLwS+I3oPTi6So=; b=VE+aGbOR2/K3UiAVC1i26Y5uX0mIVr/1zrNiac+YOrs51yD2GEj6zuhNGOl6IU6WpIye hH2mB3I/kqbv1E9jk5VZECFUvy4rOkxz++iJMNgJEgNWWgxDngB4u+M5BPhO9L+txVjp kRnQDauVlkhzzwVBFhYqO7pXBM3b2CNPo5XyaYtp32lUkGEnWRDKNImRlXjJO19sDhMC tGoVXzULOeTurj/ueN4WhmWSq2lQtcuoq+OTBL5Yic40rEYuuIgXf5rGK6wLswOvHtf3 gM8YSpQk5SD6PrN35vdQLuyCwCD5+MQlu2CIMam3VEcLcDiaUQbCPMyhzWC66cDmqnbv +A== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com with ESMTP id 3am1fk3eac-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 23 Aug 2021 12:40:54 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 23 Aug 2021 12:40:50 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Mon, 23 Aug 2021 12:40:50 -0700 Received: from BG-LT7430.marvell.com (BG-LT7430.marvell.com [10.28.177.176]) by maili.marvell.com (Postfix) with ESMTP id 3FD1E5B6936; Mon, 23 Aug 2021 12:40:47 -0700 (PDT) From: To: , Timothy McDaniel , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= , "Pavan Nikhilesh" , Harman Kalra CC: , Date: Tue, 24 Aug 2021 01:10:12 +0530 Message-ID: <20210823194020.1229-8-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210823194020.1229-1-pbhagavatula@marvell.com> References: <20210823194020.1229-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: TyCffXwktddaqoISm1PvuL56Y-Hh4aRP X-Proofpoint-ORIG-GUID: TyCffXwktddaqoISm1PvuL56Y-Hh4aRP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-08-23_04,2021-08-23_01,2020-04-07_01 Subject: [dpdk-dev] [RFC 08/15] eventdev: hide event device related structures X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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: Pavan Nikhilesh Move rte_eventdev, rte_eventdev_data structures to eventdev_pmd.h. Signed-off-by: Pavan Nikhilesh --- drivers/event/dlb2/dlb2_inline_fns.h | 2 + drivers/event/dsw/dsw_evdev.h | 2 + drivers/event/octeontx/timvf_worker.h | 2 + drivers/net/octeontx/octeontx_ethdev.c | 3 +- lib/eventdev/eventdev_pmd.h | 71 ++++++++++++++++ lib/eventdev/rte_eventdev.c | 22 ----- lib/eventdev/rte_eventdev_core.h | 113 ------------------------- 7 files changed, 79 insertions(+), 136 deletions(-) diff --git a/drivers/event/dlb2/dlb2_inline_fns.h b/drivers/event/dlb2/dlb2_inline_fns.h index ac8d01aa98..1429281cfd 100644 --- a/drivers/event/dlb2/dlb2_inline_fns.h +++ b/drivers/event/dlb2/dlb2_inline_fns.h @@ -5,6 +5,8 @@ #ifndef _DLB2_INLINE_FNS_H_ #define _DLB2_INLINE_FNS_H_ +#include + /* Inline functions required in more than one source file. */ static inline struct dlb2_eventdev * diff --git a/drivers/event/dsw/dsw_evdev.h b/drivers/event/dsw/dsw_evdev.h index 08889a0990..631daea55c 100644 --- a/drivers/event/dsw/dsw_evdev.h +++ b/drivers/event/dsw/dsw_evdev.h @@ -5,6 +5,8 @@ #ifndef _DSW_EVDEV_H_ #define _DSW_EVDEV_H_ +#include + #include #include diff --git a/drivers/event/octeontx/timvf_worker.h b/drivers/event/octeontx/timvf_worker.h index dede1a4a4f..3f1e77f1d1 100644 --- a/drivers/event/octeontx/timvf_worker.h +++ b/drivers/event/octeontx/timvf_worker.h @@ -2,6 +2,8 @@ * Copyright(c) 2017 Cavium, Inc */ +#include + #include #include diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index 9f4c0503b4..c55304839e 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -9,13 +9,14 @@ #include #include +#include #include #include #include #include #include -#include #include +#include #include #include #include diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h index f3a221e688..a7521fbd93 100644 --- a/lib/eventdev/eventdev_pmd.h +++ b/lib/eventdev/eventdev_pmd.h @@ -84,6 +84,9 @@ extern "C" { #define RTE_EVENTDEV_DETACHED (0) #define RTE_EVENTDEV_ATTACHED (1) +#define RTE_EVENTDEV_NAME_MAX_LEN (64) +/**< @internal Max length of name of event PMD */ + struct rte_eth_dev; /** Global structure used for maintaining state of allocated event devices */ @@ -91,6 +94,74 @@ struct rte_eventdev_global { uint8_t nb_devs; /**< Number of devices found */ }; +/** + * @internal + * The data part, with no function pointers, associated with each device. + * + * This structure is safe to place in shared memory to be common among + * different processes in a multi-process configuration. + */ +struct rte_eventdev_data { + int socket_id; + /**< Socket ID where memory is allocated */ + uint8_t dev_id; + /**< Device ID for this instance */ + uint8_t nb_queues; + /**< Number of event queues. */ + uint8_t nb_ports; + /**< Number of event ports. */ + void **ports; + /**< Array of pointers to ports. */ + struct rte_event_port_conf *ports_cfg; + /**< Array of port configuration structures. */ + struct rte_event_queue_conf *queues_cfg; + /**< Array of queue configuration structures. */ + uint16_t *links_map; + /**< Memory to store queues to port connections. */ + void *dev_private; + /**< PMD-specific private data */ + uint32_t event_dev_cap; + /**< Event device capabilities(RTE_EVENT_DEV_CAP_)*/ + struct rte_event_dev_config dev_conf; + /**< Configuration applied to device. */ + uint8_t service_inited; + /* Service initialization state */ + uint32_t service_id; + /* Service ID*/ + void *dev_stop_flush_arg; + /**< User-provided argument for event flush function */ + + RTE_STD_C11 + uint8_t dev_started : 1; + /**< Device state: STARTED(1)/STOPPED(0) */ + + char name[RTE_EVENTDEV_NAME_MAX_LEN]; + /**< Unique identifier name */ + + uint64_t reserved_64s[4]; /**< Reserved for future fields */ + void *reserved_ptrs[4]; /**< Reserved for future fields */ +} __rte_cache_aligned; + +/** @internal The data structure associated with each event device. */ +struct rte_eventdev { + struct rte_eventdev_data *data; + /**< Pointer to device data */ + struct eventdev_ops *dev_ops; + /**< Functions exported by PMD */ + struct rte_device *dev; + /**< Device info. supplied by probing */ + + RTE_STD_C11 + uint8_t attached : 1; + /**< Flag indicating the device is attached */ + + uint64_t reserved_64s[4]; /**< Reserved for future fields */ + void *reserved_ptrs[3]; /**< Reserved for future fields */ +} __rte_cache_aligned; + +extern struct rte_eventdev *rte_eventdevs; +/** @internal The pool of rte_eventdev structures. */ + /** * Get the rte_eventdev structure device pointer for the named device. * diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c index 941e1e7c8e..882654b788 100644 --- a/lib/eventdev/rte_eventdev.c +++ b/lib/eventdev/rte_eventdev.c @@ -1452,24 +1452,6 @@ rte_eventdev_find_free_device_index(void) return RTE_EVENT_MAX_DEVS; } -static uint16_t -rte_event_tx_adapter_enqueue(__rte_unused void *port, - __rte_unused struct rte_event ev[], - __rte_unused uint16_t nb_events) -{ - rte_errno = ENOTSUP; - return 0; -} - -static uint16_t -rte_event_crypto_adapter_enqueue(__rte_unused void *port, - __rte_unused struct rte_event ev[], - __rte_unused uint16_t nb_events) -{ - rte_errno = ENOTSUP; - return 0; -} - struct rte_eventdev * rte_event_pmd_allocate(const char *name, int socket_id) { @@ -1516,10 +1498,6 @@ rte_event_pmd_allocate(const char *name, int socket_id) eventdev = &rte_eventdevs[dev_id]; - eventdev->txa_enqueue = rte_event_tx_adapter_enqueue; - eventdev->txa_enqueue_same_dest = rte_event_tx_adapter_enqueue; - eventdev->ca_enqueue = rte_event_crypto_adapter_enqueue; - if (eventdev->data == NULL) { struct rte_eventdev_data *eventdev_data = NULL; diff --git a/lib/eventdev/rte_eventdev_core.h b/lib/eventdev/rte_eventdev_core.h index 4a7edacb0e..640d5ffcb2 100644 --- a/lib/eventdev/rte_eventdev_core.h +++ b/lib/eventdev/rte_eventdev_core.h @@ -14,55 +14,34 @@ extern "C" { typedef uint16_t (*rte_event_enqueue_t)(uint8_t dev_id, uint8_t port_id, const struct rte_event *ev); -typedef uint16_t (*event_enqueue_t)(void *port, const struct rte_event *ev); /**< @internal Enqueue event on port of a device */ typedef uint16_t (*rte_event_enqueue_burst_t)(uint8_t dev_id, uint8_t port_id, const struct rte_event ev[], uint16_t nb_events); -typedef uint16_t (*event_enqueue_burst_t)(void *port, - const struct rte_event ev[], - uint16_t nb_events); /**< @internal Enqueue burst of events on port of a device */ typedef uint16_t (*rte_event_dequeue_t)(uint8_t dev_id, uint8_t port_id, struct rte_event *ev, uint64_t timeout_ticks); -typedef uint16_t (*event_dequeue_t)(void *port, struct rte_event *ev, - uint64_t timeout_ticks); /**< @internal Dequeue event from port of a device */ typedef uint16_t (*rte_event_dequeue_burst_t)(uint8_t dev_id, uint8_t port_id, struct rte_event ev[], uint16_t nb_events, uint64_t timeout_ticks); -typedef uint16_t (*event_dequeue_burst_t)(void *port, struct rte_event ev[], - uint16_t nb_events, - uint64_t timeout_ticks); /**< @internal Dequeue burst of events from port of a device */ typedef uint16_t (*rte_event_tx_adapter_enqueue_t)(uint8_t dev_id, uint8_t port_id, struct rte_event ev[], uint16_t nb_events); -typedef uint16_t (*event_tx_adapter_enqueue)(void *port, struct rte_event ev[], - uint16_t nb_events); /**< @internal Enqueue burst of events on port of a device */ -typedef uint16_t (*event_tx_adapter_enqueue_same_dest)(void *port, - struct rte_event ev[], - uint16_t nb_events); -/**< @internal Enqueue burst of events on port of a device supporting - * burst having same destination Ethernet port & Tx queue. - */ - typedef uint16_t (*rte_event_crypto_adapter_enqueue_t)(uint8_t dev_id, uint8_t port_id, struct rte_event ev[], uint16_t nb_events); -typedef uint16_t (*event_crypto_adapter_enqueue)(void *port, - struct rte_event ev[], - uint16_t nb_events); /**< @internal Enqueue burst of events on crypto adapter */ struct rte_eventdev_api { @@ -89,98 +68,6 @@ struct rte_eventdev_api { extern struct rte_eventdev_api *rte_eventdev_api; -#define RTE_EVENTDEV_NAME_MAX_LEN (64) -/**< @internal Max length of name of event PMD */ - -/** - * @internal - * The data part, with no function pointers, associated with each device. - * - * This structure is safe to place in shared memory to be common among - * different processes in a multi-process configuration. - */ -struct rte_eventdev_data { - int socket_id; - /**< Socket ID where memory is allocated */ - uint8_t dev_id; - /**< Device ID for this instance */ - uint8_t nb_queues; - /**< Number of event queues. */ - uint8_t nb_ports; - /**< Number of event ports. */ - void **ports; - /**< Array of pointers to ports. */ - struct rte_event_port_conf *ports_cfg; - /**< Array of port configuration structures. */ - struct rte_event_queue_conf *queues_cfg; - /**< Array of queue configuration structures. */ - uint16_t *links_map; - /**< Memory to store queues to port connections. */ - void *dev_private; - /**< PMD-specific private data */ - uint32_t event_dev_cap; - /**< Event device capabilities(RTE_EVENT_DEV_CAP_)*/ - struct rte_event_dev_config dev_conf; - /**< Configuration applied to device. */ - uint8_t service_inited; - /* Service initialization state */ - uint32_t service_id; - /* Service ID*/ - void *dev_stop_flush_arg; - /**< User-provided argument for event flush function */ - - RTE_STD_C11 - uint8_t dev_started : 1; - /**< Device state: STARTED(1)/STOPPED(0) */ - - char name[RTE_EVENTDEV_NAME_MAX_LEN]; - /**< Unique identifier name */ - - uint64_t reserved_64s[4]; /**< Reserved for future fields */ - void *reserved_ptrs[4]; /**< Reserved for future fields */ -} __rte_cache_aligned; - -/** @internal The data structure associated with each event device. */ -struct rte_eventdev { - event_enqueue_t enqueue; - /**< Pointer to PMD enqueue function. */ - event_enqueue_burst_t enqueue_burst; - /**< Pointer to PMD enqueue burst function. */ - event_enqueue_burst_t enqueue_new_burst; - /**< Pointer to PMD enqueue burst function(op new variant) */ - event_enqueue_burst_t enqueue_forward_burst; - /**< Pointer to PMD enqueue burst function(op forward variant) */ - event_dequeue_t dequeue; - /**< Pointer to PMD dequeue function. */ - event_dequeue_burst_t dequeue_burst; - /**< Pointer to PMD dequeue burst function. */ - event_tx_adapter_enqueue_same_dest txa_enqueue_same_dest; - /**< Pointer to PMD eth Tx adapter burst enqueue function with - * events destined to same Eth port & Tx queue. - */ - event_tx_adapter_enqueue txa_enqueue; - /**< Pointer to PMD eth Tx adapter enqueue function. */ - struct rte_eventdev_data *data; - /**< Pointer to device data */ - struct eventdev_ops *dev_ops; - /**< Functions exported by PMD */ - struct rte_device *dev; - /**< Device info. supplied by probing */ - - RTE_STD_C11 - uint8_t attached : 1; - /**< Flag indicating the device is attached */ - - event_crypto_adapter_enqueue ca_enqueue; - /**< Pointer to PMD crypto adapter enqueue function. */ - - uint64_t reserved_64s[4]; /**< Reserved for future fields */ - void *reserved_ptrs[3]; /**< Reserved for future fields */ -} __rte_cache_aligned; - -extern struct rte_eventdev *rte_eventdevs; -/** @internal The pool of rte_eventdev structures. */ - #ifdef __cplusplus } #endif -- 2.17.1