From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0055.outbound.protection.outlook.com [104.47.38.55]) by dpdk.org (Postfix) with ESMTP id 804FF2C5E for ; Sun, 18 Dec 2016 15:22:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ukO/gin8QXyEiwkDdpWxL04OdUboE8ZRUZ0R/um4wu8=; b=QpbWZ8OuRvSb20+i/51gzvL17YUbZxYbhSshDUtj1MKwfb40W6AbU7uY8rtcPUyNOTfUBbyYdB++l1xMtg38+1VxfHtCYb5RUu7tRrOAD7x6emrkeBX9/TTEoctPfdBMPcnk06NnOw3nAQ2WdHFB3dBtqpP20hc7zIdORyYdG50= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (14.140.2.178) by CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14; Sun, 18 Dec 2016 14:22:17 +0000 From: Jerin Jacob To: CC: , , , , , Jerin Jacob Date: Sun, 18 Dec 2016 19:51:31 +0530 Message-ID: <1482070895-32491-3-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1482070895-32491-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1480798539-13360-1-git-send-email-jerin.jacob@caviumnetworks.com> <1482070895-32491-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: MAXPR01CA0003.INDPRD01.PROD.OUTLOOK.COM (10.164.147.10) To CY1PR0701MB1725.namprd07.prod.outlook.com (10.163.21.14) X-MS-Office365-Filtering-Correlation-Id: ee702049-dc6d-49fe-38c1-08d4275147cf X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 3:IUMZTUaPvaOV8aUW2Sr871nkg+3oltBExCar2OMhMuqaO3O4gMQYFaFzvavKEyt4Zj/1YjJto4//aWBPLeR15QM26ROsBk3Bc3r4kX61V94XfFGTgQ9io01Kd38+aqsHdkiUsLiZJw7XnPpUzOFQwabYQwI7PYxVVGv1mBR2grln0tm1GJVKMSYTP08WxoHY8314t4dNfQ3RcDFb0eCC0cBMpCQQbDRtFr/3bkFj90fe6Ol66IVx8Kjt9ugqOhjgagrVmv9P6zLzoVFDyvNvZA==; 25:jFajbxuKEmfzVfhRmjavz0MEjxiArUYpxYni+eZm6CoEQy4Lnn8hZv8/x8LPHqbK9nyW380UW2BMimDQ1vCDY7x1j+UOMkWM7p8j+plD7YzkWwhKWa6jArAZtalu0LFVsowz91jy21D4WO24afBRtTD5S7Pi6raqzhomdwr8MyzLJ7QT7YZrnvI2gJIglpLFz6qPn26vpRxqHYKG2MO8Wl5jKBREH/NnprpYsvsPXKsL+ejPYzzv4AO5pqLYiPrirXRsdYsv8BYEHu0GzeqBE2gqjZ/artJDg6xy+3VJL3QNmU7yYagh+9kFZ41rnmIsOjJOqTsy52oq4J8Ff4wTCshOisLrb5mGVRbgjR2lr/nMADukIdSBfm9oG/8PggLchqmyhj0znq6/TIXDnOEgRYsfZhggzS9k2Y7NthB5OZFmkJK5CjnYMu1WTj14esTKrsXTVaMbIf48UnTfpKq4YA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 31:BHA+B0vRPRtbwHxtExdcRpEUb9ro45arQUGiz52azZgmHXfpNFaagyHDFhiZnpZk7Lg643/yiB1vvViOlzNeVrcQbgk/F88a1hBxLvY3VrXRXGRPJ18M20m+1bgzB+o26Y1ffRF6yyT8l219RD+shWb1Lufejk+Rk2JI8wybvoUAxgElT05XsK+SFZQQlv9rHMJeGYwasBkuOggnSs3KpI2GKCZ8wMoEGq0JKa+6vxjNBAXFqrX8qJeF+Td1t9CI; 20:HGY10lcJCFQ015XvhF4duDTT1JKcb4Sj35PSk75wrf+3FP2ZK/bPNSnjNgylNiDrnGhKWqHCf4fRDIWJcWKNNmunul8JjF/nkVyv4BqaLqcIxNNMSrbpWGJJh6agH0giCiKeYcNMm2V9cIIJit/zoShAFaR+ouK9GYTeMBv52WrBxPUskBV5wf2EfWBY4Poo79a05NOpbfw7Pc03MJuGEKNddLNqKAv+W1dkZHS4u87jhOmytUg2Ae6Rygihh/23AgIax/S9+i3KIDz9sjBtVaV66WzQIWo7VNC0AlZd18NLP7hWdZlyzJGe+3PiZAxxRPARX3bEkVMeXLutMogI3bWr9Dg9fbbxq1AUg1fo5tSkbuyUFFHIX/U1N+gffMecx5BScQWCe3IaCJbaa/JHqtOPWfi3QOQ2KQ5/vR0Tp/hmMiIp2kNyDm/5tlNlFG4rz++NTFUZiFcFjTbfK1tYR41hJ+gztgaLM7bF21eeCBG7uhPQtqrUnI0B32TVb3yg0zUXxXp+x9BI/15J1nAoatx+HO3A/Tk03vkj+3yAYQ7t43scMMY5uCaecoT5AJrj58Ip59Ak1jEzOUVsvDLxrhPY/ceWvgGnniiLhRwnybU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123558021)(20161123564025)(20161123562025)(6072148); SRVR:CY1PR0701MB1725; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1725; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 4:K2V9U1OIWerhntued7ITVFizUGSbQnt6Mmt4Hi3VmrXvLRGu43zJFFP7eCb4TJK+fAtwVPGSHAWt1wMfvTfG7kHW5s2dQNLI2WlxhBXJAimpzmDTVOzf5dMPi+pPlhHhES3V9FnY2sl1dw7a+tyGmFKKIs6l3uixOYB266Adzggjf/4t03bza4qikMgi/q1BtvKrk6ylDT3aOVv9bm3KSXOCh0Ts7CGFwtEHApUgGDoTr41I236JfZdhMjA+MpAxewa0kF5IIzPSysFgPTaMM0gF1o36BDa+UWRGT7cErwt9bkxhbDzJleRDT+O/7utgbqp7lta+VoXpFU9bZSwp2Io+fyO9CKzid/thOFAYHy7qVNqsMlJyoAw9rXxWkpvhu4YU4G59QwyRIh+KmBh+GC539Rm0QHmQybVXgz5iZmxxSXW9U0IyVDjqCxyXaC7DyjwuC28ah2027xDwCEM4i4HCylcX1B0gqtxz6p0z1OC4Lbvszswvthq+NM2J60e5qtYqxmEnZ+36FxzbDb++EsGkO8trPOsNbU8rKPWxzvsenhmWCjf0yvkq67tiR3V7PEJy1vQ95hjLk/H/lXorkDw1XTkWRF8rFWHA3zdW2BP38Las7GE//TrMpi370RBjzr1h01i4FXeWy9wyxu9NLg== X-Forefront-PRVS: 01604FB62B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(979002)(6009001)(6069001)(7916002)(39450400003)(189002)(199003)(6512006)(6506006)(106356001)(6486002)(5003940100001)(48376002)(68736007)(25786008)(101416001)(42186005)(5009440100003)(4001430100002)(81166006)(4326007)(105586002)(50226002)(92566002)(81156014)(50986999)(76176999)(107886002)(8676002)(2906002)(42882006)(6916009)(2950100002)(36756003)(6666003)(110136003)(2351001)(47776003)(38730400001)(305945005)(3846002)(97736004)(66066001)(8666005)(50466002)(6116002)(189998001)(5660300001)(33646002)(7736002)(7099028)(110426004)(7059030)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1725; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1725; 23:+L273hMQ4DKVH3wargzaygrET1oOKAtex43vpWB?= =?us-ascii?Q?JqVZ2CHUzx+59BCHcTvnZXQ2q45u6hw6/vr6PufLDuxXyzO/ceu/xs0RHZnw?= =?us-ascii?Q?uviogZCMG11/cP3rlcrFFHwoji4+3EVhAfEjFK/kSARz6Eh3njBuO5QYmgC/?= =?us-ascii?Q?B/hB6NU08WL0hTiiKD+e2aOnx5fnvr2IiGBbR2ubl/sGtNWkh7HLzRlGr5MH?= =?us-ascii?Q?HaMRC7/oywwBNnrcvNXKkga5W2Wwu6ZHmD/M2WS/Sdg9xP/x4etVvLOe9SuW?= =?us-ascii?Q?YeBVJl+08pbplOHEx27+4lh58nvXRgJmwlJlpXSMY1s34pPpEWBFodvm9z1I?= =?us-ascii?Q?op6nsTdJFibkDRqunUVKzkUAmWuSk/guzs+QXF19CMDWJNLReCsJQIMtTLUD?= =?us-ascii?Q?2h1c5WPVGE+Gqp6/BT+8vvXmDWyeXhWidtMSgBb7J6XBfKlNFExwJASjelQd?= =?us-ascii?Q?1QUayhsm8qv0LcxKcmipIyUzFy713Syxp2gBZEZUHUfMO0ir9e8fRuNtb0Gr?= =?us-ascii?Q?xKDoJwgsNcg3QX6eO1OULegUm/JGH8LaLBeqPQ9tRYuo5BIwtntOwuNyCmrn?= =?us-ascii?Q?AKz66YT+TfQ+uLNN3fdIjIl227KqZuFH1VW7R/MadCsVFTEJzcugcE4E0Nyf?= =?us-ascii?Q?VYqMPk+ngbaTFPRIofu/8P4bZtx0uZRz4W6LUt/WXCmZe9l7769CSPN+EtlW?= =?us-ascii?Q?c3ksELHB3t+HghPEoAwRMmiCRiNQgfc1bknZ1eytFYoHPdEFPhGn8PI0M6Vf?= =?us-ascii?Q?jrjJ1OZETM8a2XobTchwPbmz6lj1KY5S0VBnoSGTpf+6HnsbWJ/BQTYYqn+V?= =?us-ascii?Q?tej3HbYjmI7y1FzAcrEgnLLR4mbPWZW8zFff8IaEuh2Kgj8XZVvps+qNKjJN?= =?us-ascii?Q?KtdtNraWcGVzjNpLO8/04y/UYCu+8wbMe14XR+EUxfCjxPy7X1GKCpHHjDqf?= =?us-ascii?Q?cH/t0HgHnoxRrVHiP8hpy95BO/eR+QcoJJcvv1lPnvrnCl4We+0ZgdIeL4B+?= =?us-ascii?Q?HRXP9b05UeVmtk9a1iBox3ZEA7dpIVAYkKAxsSlbPsPrIOVCsdNzjfNAscZ8?= =?us-ascii?Q?DSn825wdr7I8fL5jM+St0ZKLht1ueSOVQpi6TObNTcl/sL0CBo4BaaWyChx+?= =?us-ascii?Q?zvdcnffk0J0rp7bwnmHIwIPtLdmlj2ktKpTVcCdIP2xV6wPS0rtqveAvJzzU?= =?us-ascii?Q?GKf/oe88mmSzQcQ83tk7MZwvmNkMIy2m/L0mxHIROIEI6W/TJDRa9lzjo4vk?= =?us-ascii?Q?8kRWAf4WfYFNwZsNfqjjiSew0E08p7kMDLE+xcoj7oXlJYJKe9YmVe9AjcYT?= =?us-ascii?Q?7LPZoNevCtVX7Dp1IzJtJD+M58gwUPeECf/0tK5O036KBnFak1kBtLvWWCXW?= =?us-ascii?Q?EiIDeqyXrmBqa1VzckhKDraB/7TQ=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 6:daKZ9F4RpZJPkCJm/p0DmKjjj/JFn3FFGalBYNGdmTdJGsgNmD0FTsIpH16N1XQirJLv+7jsWd9OuiIj9wGJsofc3FzBR+iz5CYrU+WJr1r3YY6adXeCzFp7ecVzvRp73xou15mwXgl8LorCrNwqwee9HqBJsJMQTzzZWJVKgV4hScX57IfX7YMbgYXZGw/TAsiafSRIVW7XR6/x/LznqvzdQjW92+GLssr0cSnxZ6XxEtUtOgzFUnNXuMOFGaDlEonZVb+RRQ4AalL/IpFAmeYY05HtWyvCMnRNmKCJh2AGPerleryVIDUkXraMJh3Abih3/xTrMgFVAVsVOhcUwuAwW+VUFlrJqTBXYprMQgwe5fApy6YuWPX8KIH05Zj2zRX0QsEgkl8Muk4ekoqKj0aLbcjudU95FL6NBdZbnJQ=; 5:ebPswOonbADO24Oq02CAI3tOsbomdsd7th9+8srg0YgQzHpbBySd58HYpB3Ao6qHRtSruq8m42BGz2Gd/RawljpHuQsSSimbSMAZ/BMb/95G76VntPjQpzVB9B6ywyHu8AEnxCU2AGd2tLC2hmKMdg==; 24:EhNLAx9COLK4gOA4kMrr+lAslmacg/wsXxu+3Evmm/gqEynfJp8MBII6YOw/PFZv2fu65x0evReEKEp3f15CItY3WEx2T7pE2XmYP2Cze/g= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1725; 7:9DqSPlJGgM3U61BVSjLuvx1Ul3un9uMsoQZ69LtYtnxecPOZ2fzYcX7D2RVudawjp3AwVWjNYuskKiJvoIkePONNllBxCQN8KtNNhiQfvqE4Zu3honU54tIJ129MVqc/JbHurdG67QkNhgFIfylAjaXkZ1+IBZsjWhKz8Iu+l7s+6jbzbgSZzlNjrlQx2xAicr+Y4NafmGbZesUwThwNcfZ8/eKkkHGzbqNsw6z1F7o9luch7p8qooZRMqbXGPmCWN2cUnzqmH9W3uysUZ7x8ShyeBZJkh3z3BWOBDRoeZaTb0be4ffBWHAk4DFFIysXoM2BX9S1JHNdcxeGiWS3QEAhTzUXWHX1wEtu1ZZjt63v9dk3n8gKcYpl7XNt5bwCVQX7xNIdQXLxdLqkJqcIUmAQlEtGJHLOTDYKJP0kGYgMGRHFvqpVuvE3MFKlGdaD+g/WrCDP8SZQrAjpl3l3+w== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2016 14:22:17.6496 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1725 Subject: [dpdk-dev] [PATCH v3 2/6] eventdev: define southbound driver 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: , X-List-Received-Date: Sun, 18 Dec 2016 14:22:24 -0000 Signed-off-by: Jerin Jacob --- lib/librte_eventdev/rte_eventdev.h | 38 +++++ lib/librte_eventdev/rte_eventdev_pmd.h | 291 +++++++++++++++++++++++++++++++++ 2 files changed, 329 insertions(+) create mode 100644 lib/librte_eventdev/rte_eventdev_pmd.h diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h index e190a3e..16115f7 100644 --- a/lib/librte_eventdev/rte_eventdev.h +++ b/lib/librte_eventdev/rte_eventdev.h @@ -972,6 +972,44 @@ struct rte_event { }; }; +struct rte_eventdev_ops; +struct rte_eventdev; + +typedef void (*event_schedule_t)(struct rte_eventdev *dev); +/**< @internal Schedule one or more events in the event dev. */ + +typedef uint16_t (*event_enqueue_t)(void *port, const struct rte_event *ev); +/**< @internal Enqueue event on port of a device */ + +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 (*event_dequeue_t)(void *port, struct rte_event *ev, + uint64_t timeout_ticks); +/**< @internal Dequeue event from port of a device */ + +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 */ + + +/** @internal The data structure associated with each event device. */ +struct rte_eventdev { + event_schedule_t schedule; + /**< Pointer to PMD schedule function. */ + event_enqueue_t enqueue; + /**< Pointer to PMD enqueue function. */ + event_enqueue_burst_t enqueue_burst; + /**< Pointer to PMD enqueue burst function. */ + event_dequeue_t dequeue; + /**< Pointer to PMD dequeue function. */ + event_dequeue_burst_t dequeue_burst; + /**< Pointer to PMD dequeue burst function. */ + +} __rte_cache_aligned; + + /** * Schedule one or more events in the event dev. * diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h new file mode 100644 index 0000000..2677c37 --- /dev/null +++ b/lib/librte_eventdev/rte_eventdev_pmd.h @@ -0,0 +1,291 @@ +/* + * + * Copyright(c) 2016 Cavium networks. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Cavium networks nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _RTE_EVENTDEV_PMD_H_ +#define _RTE_EVENTDEV_PMD_H_ + +/** @file + * RTE Event PMD APIs + * + * @note + * These API are from event PMD only and user applications should not call + * them directly. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "rte_eventdev.h" + +/** + * Definitions of all functions exported by a driver through the + * the generic structure of type *event_dev_ops* supplied in the + * *rte_eventdev* structure associated with a device. + */ + +/** + * Get device information of a device. + * + * @param dev + * Event device pointer + * @param dev_info + * Event device information structure + * + * @return + * Returns 0 on success + */ +typedef void (*eventdev_info_get_t)(struct rte_eventdev *dev, + struct rte_event_dev_info *dev_info); + +/** + * Configure a device. + * + * @param dev + * Event device pointer + * + * @return + * Returns 0 on success + */ +typedef int (*eventdev_configure_t)(const struct rte_eventdev *dev); + +/** + * Start a configured device. + * + * @param dev + * Event device pointer + * + * @return + * Returns 0 on success + */ +typedef int (*eventdev_start_t)(struct rte_eventdev *dev); + +/** + * Stop a configured device. + * + * @param dev + * Event device pointer + */ +typedef void (*eventdev_stop_t)(struct rte_eventdev *dev); + +/** + * Close a configured device. + * + * @param dev + * Event device pointer + * + * @return + * - 0 on success + * - (-EAGAIN) if can't close as device is busy + */ +typedef int (*eventdev_close_t)(struct rte_eventdev *dev); + +/** + * Retrieve the default event queue configuration. + * + * @param dev + * Event device pointer + * @param queue_id + * Event queue index + * @param[out] queue_conf + * Event queue configuration structure + * + */ +typedef void (*eventdev_queue_default_conf_get_t)(struct rte_eventdev *dev, + uint8_t queue_id, struct rte_event_queue_conf *queue_conf); + +/** + * Setup an event queue. + * + * @param dev + * Event device pointer + * @param queue_id + * Event queue index + * @param queue_conf + * Event queue configuration structure + * + * @return + * Returns 0 on success. + */ +typedef int (*eventdev_queue_setup_t)(struct rte_eventdev *dev, + uint8_t queue_id, + const struct rte_event_queue_conf *queue_conf); + +/** + * Release resources allocated by given event queue. + * + * @param queue_id + * Event queue index + * + */ +typedef void (*eventdev_queue_release_t)(uint8_t queue_id); + +/** + * Retrieve the default event port configuration. + * + * @param dev + * Event device pointer + * @param port_id + * Event port index + * @param[out] port_conf + * Event port configuration structure + * + */ +typedef void (*eventdev_port_default_conf_get_t)(struct rte_eventdev *dev, + uint8_t port_id, struct rte_event_port_conf *port_conf); + +/** + * Setup an event port. + * + * @param dev + * Event device pointer + * @param port_id + * Event port index + * @param port_conf + * Event port configuration structure + * + * @return + * Returns 0 on success. + */ +typedef int (*eventdev_port_setup_t)(struct rte_eventdev *dev, + uint8_t port_id, + const struct rte_event_port_conf *port_conf); + +/** + * Release memory resources allocated by given event port. + * + * @param port + * Event port pointer + * + */ +typedef void (*eventdev_port_release_t)(void *port); + +/** + * Link multiple source event queues to destination event port. + * + * @param port + * Event port pointer + * @param link + * Points to an array of *nb_links* event queues to be linked + * to the event port. + * @param priorities + * Points to an array of *nb_links* service priorities associated with each + * event queue link to event port. + * @param nb_links + * The number of links to establish + * + * @return + * Returns 0 on success. + * + */ +typedef int (*eventdev_port_link_t)(void *port, + const uint8_t queues[], const uint8_t priorities[], + uint16_t nb_links); + +/** + * Unlink multiple source event queues from destination event port. + * + * @param port + * Event port pointer + * @param queues + * An array of *nb_unlinks* event queues to be unlinked from the event port. + * @param nb_unlinks + * The number of unlinks to establish + * + * @return + * Returns 0 on success. + * + */ +typedef int (*eventdev_port_unlink_t)(void *port, + uint8_t queues[], uint16_t nb_unlinks); + +/** + * Converts nanoseconds to *timeout_ticks* value for rte_event_dequeue() + * + * @param dev + * Event device pointer + * @param ns + * Wait time in nanosecond + * @param[out] timeout_ticks + * Value for the *timeout_ticks* parameter in rte_event_dequeue() function + * + */ +typedef void (*eventdev_dequeue_timeout_ticks_t)(struct rte_eventdev *dev, + uint64_t ns, uint64_t *timeout_ticks); + +/** + * Dump internal information + * + * @param dev + * Event device pointer + * @param f + * A pointer to a file for output + * + */ +typedef void (*eventdev_dump_t)(struct rte_eventdev *dev, FILE *f); + +/** Event device operations function pointer table */ +struct rte_eventdev_ops { + eventdev_info_get_t dev_infos_get; /**< Get device info. */ + eventdev_configure_t dev_configure; /**< Configure device. */ + eventdev_start_t dev_start; /**< Start device. */ + eventdev_stop_t dev_stop; /**< Stop device. */ + eventdev_close_t dev_close; /**< Close device. */ + + eventdev_queue_default_conf_get_t queue_def_conf; + /**< Get default queue configuration. */ + eventdev_queue_setup_t queue_setup; + /**< Set up an event queue. */ + eventdev_queue_release_t queue_release; + /**< Release an event queue. */ + + eventdev_port_default_conf_get_t port_def_conf; + /**< Get default port configuration. */ + eventdev_port_setup_t port_setup; + /**< Set up an event port. */ + eventdev_port_release_t port_release; + /**< Release an event port. */ + + eventdev_port_link_t port_link; + /**< Link event queues to an event port. */ + eventdev_port_unlink_t port_unlink; + /**< Unlink event queues from an event port. */ + eventdev_dequeue_timeout_ticks_t timeout_ticks; + /**< Converts ns to *timeout_ticks* value for rte_event_dequeue() */ + eventdev_dump_t dump; + /* Dump internal information */ +}; + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_EVENTDEV_PMD_H_ */ -- 2.5.5