From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0053.outbound.protection.outlook.com [104.47.38.53]) by dpdk.org (Postfix) with ESMTP id 007192BA1 for ; Fri, 9 Jun 2017 10:38:06 +0200 (CEST) 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=cx28+LoP8cCZcLJ0U9PxuAOJwVSmZRIntbA74c8LMFI=; b=MMo6kk9ykPveXIWkz7Mou4fDSLxpmZANzBa2qcibGHYjcAR8nfJbeHi/hmw61f266w2DgVX4ecXUAI0vqeKvDbQE7v58ZV5PSpqluBuRPfA+fHtrbC0NkFxW5NyTwNf3hH2ea3Vscx220me1VVlVwWmua4mW7BXebn2w5o7ipR0= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=caviumnetworks.com; Received: from jerin.caveonetworks.com (111.93.218.67) by BLUPR0701MB1713.namprd07.prod.outlook.com (10.163.85.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Fri, 9 Jun 2017 08:38:03 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: bruce.richardson@intel.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, gage.eads@intel.com, nipun.gupta@nxp.com, gaetan.rivet@6wind.com, Jerin Jacob Date: Fri, 9 Jun 2017 14:07:29 +0530 Message-Id: <20170609083729.10586-5-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170609083729.10586-1-jerin.jacob@caviumnetworks.com> References: <20170607084333.6338-2-jerin.jacob@caviumnetworks.com> <20170609083729.10586-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0113.INDPRD01.PROD.OUTLOOK.COM (10.174.144.29) To BLUPR0701MB1713.namprd07.prod.outlook.com (10.163.85.14) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLUPR0701MB1713: X-MS-Office365-Filtering-Correlation-Id: 83b3019c-422f-4b31-3348-08d4af12d97a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 3:E54IN1bnyr8cpxpxuI1pa941KES7K35eEWJqMUZo4+bxAjrTnf9lCeXgSF+8XfPKqMK4gUo2wFBns3QS+69CI9A6jTJ7M5EQBGgVRn7mqSpwmzZr6evQgpzYXbWdR2OWnZF1h6sPnO3bbSWnTeAocZBWspI7FUpY51bVRuiwY6q3xdY1ir+KVa5uDWC3REdIiWIMKihNK2z61rP8+rM+2WZvJa69fXzaGFL19j6/8+ieOHubOyraCkNi4mAIPXgoiGL0WTczfHWu7R23wJepkE26223iEV/E6Csvhjiby6Wd30LYsyrb/v174lQDfIHal6CYHUWasV8IeUNpO/SLOA==; 25:tlFZIXSh6gbINnT3lJZFwP2J3NsH+tK+M9Oh4xLil89zMormutpv4s9RH7rOoPDXsFgeI1PJHZhLcBgkb7W9k/IV6jz6PKhD/eMhdZg4wlKMhgJlo9MjmRExzwjx0GVJLJ3mLEDE3LvDlZ4JC2XBV2hMxTWR85twYPbcEM2n1wO1yHeK+xsEN0esSPXqwpbqTHhL6iLogFS5bBR90CM5wFj9Vld4yzUPfE4XFybqo2x9+cr1jaA7q8FtaH/iWedZNkIM6KO0apKjFQ7C9uf5W48TldMouKJgHyAskGPhSsj61xXAyAK/tT4diBpav+cvPnEMpW+nMFRX6PxUmCRPvZ4qo3219k/K9W8UNSc49bZs786TPbKUIr26nO1v/sSIK1eTC42fTwPmE9paA8cJ5g6hlWlLmJ4p3xRr2138NkKRDlCTmXm15ZCdUAK/8St5dQMjXGemtWWogcFJvM4CdhGDQadtQ+AtYb4NDXBkhAs= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 31:UQv9XXbR2gzj94TSByMTM4Ey030cIBDgKj6IoFq8PDpIF05/RizAbG48GVkTqJBBoHqrLqJp7+5TdZrjMxhHYHcBRYHid9HB5U802dmgp7OpB0Ygh9NUA9dUGiBdEoPD4xLd0taAoRlCYfRIuB2tg7lyumjREeTvCiCwKjll03i5N/f2g4lZj0l1m4ihNSDrBAzqWuQ5cqxZimHdx/vmqMbatW9rEsBNdhfg2BiXuFQ=; 20:UO210qepOh6EPLElgquuvTkZnWfY0MvZJZAKYSj5UEpdye1bhTcpT801DDqyNVGY58JGmvVJjowIzKZ+DaZMGw2CadeT63wqHyZkl7lCcpPHXXB32Ejoog1prwKXuZkTtcirj5o1CpsSAtA+Ss1RyGsbwT9Y6LJ+MoZU/QGVU2RRw7N1O+LCtPoPNXbL76wAA9yyR4tSp3lR9qAne1pTlwxmqcrPcfhGrVLZJCYJnanIp//H7EpAX+GFbAd2Z4/GX4r11SCsS1QUfiYhFg9r6BvjWnR+hCGmhBYtBKOTgCPzk50rPbivG0YO1xu8hSFtCtNPo6L8nDeIbSvYjKzYrmNRydqz1nLfa7WvLxXSfa8ArOQASAIPfwEtsEfTnCwhbk1XM+OXPynwQgX5DrXVoSW4E7FFu/Ka9W0TpwgRe6OFxT6mBGAaZkXwfA2J8Kot7YYO9zVnIOrt/ytsO75+v+R5qrmFQEShRL82B62+ovSFRXKFQDR7RU7W2CAdsKLmoVtKM2qO88kSmhwd4k4wGGKmqW+KeplRkdL3ptLxCSU9Oe1jVXuzhFoIxVI1qLgbJCpgegpGhISWYzlpLf4PvoWpnCCuwZgbB55bi6OyYRA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(3002001)(100000703101)(100105400095)(10201501046)(6041248)(20161123555025)(20161123558100)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0701MB1713; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1713; 4:Xs18JzGaSRhVb45MHnZLv/HwiNCLiMZh7ijuP1uM?= =?us-ascii?Q?bZf56V7BbPxsjdm7yo7IRyWKKfTfQkL3AQcgecDE1rnSraIvMeYpdCCYYjGi?= =?us-ascii?Q?eNzzcU/wqdrLQXXe5SmShCPPHhRQEtDMdJvg/bco3CqKI1eM8VMPB6pdq5ja?= =?us-ascii?Q?lnlbqYbuxD1UawjPj4RUpCNiAXZn9OkGhCRW0G9Wfz36aDbbPboCMya4Gq1B?= =?us-ascii?Q?sbkWC24aIS3LHo0I0LZJ9jUfg+M6uT8WES0Dtv58qkpLR3BiQfyMI0pOg9rm?= =?us-ascii?Q?N+7hLwZl8mmPTY8ioYRuGycM9CDJN1J6w2bhWwi7XyU7lCMITYq6Ha6wfg0G?= =?us-ascii?Q?UDklg4UKfJREXln4O/tDStvlCaSMtriM0d2+eIRGNOAtTq4vp1CSWPOEUVfw?= =?us-ascii?Q?3Z5nN4lBJ+h/C/d9sua8hN0aMr8AVtgIRxzReKAcLGMl8z1+ZLasEPYySoC0?= =?us-ascii?Q?BRgDjTysaiNhk+HLUXtpuJw1LrKQ699FO9pEL13czMEFfO+Rcuzmk0HfhQPN?= =?us-ascii?Q?Erf0PcLLUp6Dz4dc8fZGc+3hdNsLAJHm/6E5TkojuEZdqyz9uCIBpY7O8b65?= =?us-ascii?Q?7izq9HLggZdT2MN3zHGqr5SaYXDglt1MnKspFo3uemF/iak30zet3zzkTxo5?= =?us-ascii?Q?5ZiUdIgMZPCcRG5FfOgEqFSxX1+NyWEK3SiJhsKHRDWCit6/vkPFhNUKD0v9?= =?us-ascii?Q?wPftT/PDgYgJiKLjyapw9UUvMfPNctcN56Sm501xx1jeqn3WKHVwOHFaYVZb?= =?us-ascii?Q?PD2vqLmJfX5kkfGRr2ZztltYgBM6I6J7DxAomgAdy3Sap4ZTcf7jP93rCxCd?= =?us-ascii?Q?9OGI7Od0D6zePV91eblBMWfRxCtomEJrZo9Mpi5SPu3pSNWXz0PjWbs1tZZq?= =?us-ascii?Q?0D80uTe+k5L7mobFB3jEobPCMCvpeQmOZoVch91zCAkrixSu697zZ5wiXnVf?= =?us-ascii?Q?AVxRUFR05c48o6cDqdvll75QlPs9rXCd+QSUhdtTYJ0rlOIatwO1A4fGcNtA?= =?us-ascii?Q?7e+ErUFUBHDS1y9Y1qh6nrMd5B/U1Kmmu0tRg6O7X0oAL284mBouIbmSOEum?= =?us-ascii?Q?yN+IxltKyjZ/nchQUzrtJXhySClr4spUgj1eBpPWsuC75RrL4zGH6AlUqegf?= =?us-ascii?Q?mUGC7FXDnkJQW8hfug1TAPk5SXjnEczUACUesRIMe3z0/Q4Q13Sz1A=3D=3D?= X-Forefront-PRVS: 03333C607F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39400400002)(39450400003)(39850400002)(39840400002)(39410400002)(48376002)(47776003)(76176999)(8656002)(66066001)(6512007)(2950100002)(25786009)(4326008)(53936002)(6916009)(5009440100003)(3846002)(1076002)(6666003)(478600001)(42882006)(6506006)(36756003)(6486002)(50986999)(110136004)(575784001)(2906002)(33646002)(305945005)(2361001)(50226002)(81166006)(7736002)(8676002)(53416004)(107886003)(42186005)(38730400002)(72206003)(5003940100001)(2351001)(5660300001)(189998001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1713; H:jerin.caveonetworks.com; FP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yqr8cuab/?= =?us-ascii?Q?lw6D4aKw1dsAkpJbf+GSJnN7WAccVcApUlSL5n/dVRd8HnNWqSD4jO3Ews4j?= =?us-ascii?Q?mpE9Nn79ODfJDO4mNIKi39OSVwdr4Nsm+K5FOou4cUi4oKApCFHjy+fY9uCY?= =?us-ascii?Q?0ZDlDIO7ViJq2i0qOwxSA3tIW5iNZaANgerpSs3gysFa2ngtf7AhguXbhtTQ?= =?us-ascii?Q?a6WNLQobj1Hrlod4lUDUdahhhtkw8pvhylxhOjYRg8CPTo7JAfDNB74/sdmm?= =?us-ascii?Q?Jk0VlnrvaItp0Wl9tP4ysrgllUPUindzWttRaWbRkQPLOGiRm3gVKM4SOGWv?= =?us-ascii?Q?DA8J/dsUwy5mgB1WLd8p2DL09NFgjsu7Au5b91++uAUJuADg2ILJehBQCoQo?= =?us-ascii?Q?bU/9sUkY1d0o0ILA=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 6:67dFfQVq3NHhXMBYtK8b3D82J6+ooDyxWeU3DXI38sepE/4mEWx9bTwZagcdzDG4zJV24RZvO1B5QgHinoq5KOh+1Q5MmZgdKzHFZ4lKgwqaTcp5WfZJjHjP89DN7BG45aFKgdydTHJPslc9wobuNzrmkHV5CvaXGAhpzmy1JtgEOt6QCd2VuH06y5t5g6+EmEmI2d4COrdgiW3/UeLLG7qclJZr48C6NpkoP6GHvduu1w5dcXYmCVwYwQqlg0JdLoCqbCMWXG90yxCLy01gKoLoD+e7qjf1WbnaS3YnZGjv8NMklfP3PMXyb5cQ7wWoYq6/WWINWvNy10z09Vyvwk/p75sBwFzyPHPVXLzC5kg3unstX+wz114z+8CgUhL5OW7z/m+kPpjuTXpvSrGHPz//LBH2XIkshysEcHsX6cH/uoWFPvbyrA7qu/9IcMx144VtR8cv/CAkEUCz3w4JLOSDAzcjpFVGMIoBYMPqLNwoys+Lpe7yiRmg5qM5kCxw3blEJUlwEXn8YMaQQmA3bg== X-Microsoft-Exchange-Diagnostics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rg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2017 08:38:03.6658 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1713 Subject: [dpdk-dev] [PATCH v4 4/4] eventdev: make vdev init and uninit functions optional 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: Fri, 09 Jun 2017 08:38:08 -0000 Made libeventdev library independent of VDEV bus by moving vdev pmd specific function to rte_eventdev_pmd_vdev.h header file. Eventdev VDEV PMD can include that for generic eventdev VDEV init and uninit function enablement. Signed-off-by: Jerin Jacob --- drivers/event/octeontx/ssovf_evdev.c | 2 + drivers/event/octeontx/ssovf_evdev.h | 2 +- drivers/event/skeleton/skeleton_eventdev.h | 1 + drivers/event/sw/sw_evdev.c | 1 + drivers/event/sw/sw_evdev.h | 2 +- lib/librte_eventdev/Makefile | 1 + lib/librte_eventdev/rte_eventdev.c | 50 ----------- lib/librte_eventdev/rte_eventdev_pmd.h | 29 ------ lib/librte_eventdev/rte_eventdev_pmd_vdev.h | 134 ++++++++++++++++++++++++++++ 9 files changed, 141 insertions(+), 81 deletions(-) create mode 100644 lib/librte_eventdev/rte_eventdev_pmd_vdev.h diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index c80a44379..cf61137d9 100644 --- a/drivers/event/octeontx/ssovf_evdev.c +++ b/drivers/event/octeontx/ssovf_evdev.c @@ -30,6 +30,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include + #include #include #include diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h index 6e0a35219..03902e41a 100644 --- a/drivers/event/octeontx/ssovf_evdev.h +++ b/drivers/event/octeontx/ssovf_evdev.h @@ -34,7 +34,7 @@ #define __SSOVF_EVDEV_H__ #include -#include +#include #include #include "rte_pmd_octeontx_ssovf.h" diff --git a/drivers/event/skeleton/skeleton_eventdev.h b/drivers/event/skeleton/skeleton_eventdev.h index 5b59fcbc0..a321a273e 100644 --- a/drivers/event/skeleton/skeleton_eventdev.h +++ b/drivers/event/skeleton/skeleton_eventdev.h @@ -34,6 +34,7 @@ #define __SKELETON_EVENTDEV_H__ #include +#include #ifdef RTE_LIBRTE_PMD_SKELETON_EVENTDEV_DEBUG #define PMD_DRV_LOG(level, fmt, args...) \ diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c index a31aaa662..7f7a473ea 100644 --- a/drivers/event/sw/sw_evdev.c +++ b/drivers/event/sw/sw_evdev.c @@ -30,6 +30,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include diff --git a/drivers/event/sw/sw_evdev.h b/drivers/event/sw/sw_evdev.h index 61c671d62..0929d0576 100644 --- a/drivers/event/sw/sw_evdev.h +++ b/drivers/event/sw/sw_evdev.h @@ -34,7 +34,7 @@ #define _SW_EVDEV_H_ #include -#include +#include #include #define SW_DEFAULT_CREDIT_QUANTA 32 diff --git a/lib/librte_eventdev/Makefile b/lib/librte_eventdev/Makefile index 040556fc4..629069ad6 100644 --- a/lib/librte_eventdev/Makefile +++ b/lib/librte_eventdev/Makefile @@ -47,6 +47,7 @@ SRCS-y += rte_eventdev.c SYMLINK-y-include += rte_eventdev.h SYMLINK-y-include += rte_eventdev_pmd.h SYMLINK-y-include += rte_eventdev_pmd_pci.h +SYMLINK-y-include += rte_eventdev_pmd_vdev.h # versioning export map EXPORT_MAP := rte_eventdev_version.map diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c index 9328cda1b..a246965e6 100644 --- a/lib/librte_eventdev/rte_eventdev.c +++ b/lib/librte_eventdev/rte_eventdev.c @@ -1195,53 +1195,3 @@ rte_event_pmd_release(struct rte_eventdev *eventdev) eventdev->data = NULL; return 0; } - -struct rte_eventdev * -rte_event_pmd_vdev_init(const char *name, size_t dev_private_size, - int socket_id) -{ - struct rte_eventdev *eventdev; - - /* Allocate device structure */ - eventdev = rte_event_pmd_allocate(name, socket_id); - if (eventdev == NULL) - return NULL; - - /* Allocate private device structure */ - if (rte_eal_process_type() == RTE_PROC_PRIMARY) { - eventdev->data->dev_private = - rte_zmalloc_socket("eventdev device private", - dev_private_size, - RTE_CACHE_LINE_SIZE, - socket_id); - - if (eventdev->data->dev_private == NULL) - rte_panic("Cannot allocate memzone for private device" - " data"); - } - - return eventdev; -} - -int -rte_event_pmd_vdev_uninit(const char *name) -{ - int ret; - struct rte_eventdev *eventdev; - - if (name == NULL) - return -EINVAL; - - eventdev = rte_event_pmd_get_named_dev(name); - if (eventdev == NULL) - return -ENODEV; - - ret = rte_event_dev_close(eventdev->data->dev_id); - if (ret < 0) - return ret; - - /* Free the event device */ - rte_event_pmd_release(eventdev); - - return 0; -} diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h index 3686de549..ecefb94d6 100644 --- a/lib/librte_eventdev/rte_eventdev_pmd.h +++ b/lib/librte_eventdev/rte_eventdev_pmd.h @@ -495,35 +495,6 @@ rte_event_pmd_allocate(const char *name, int socket_id); int rte_event_pmd_release(struct rte_eventdev *eventdev); -/** - * Creates a new virtual event device and returns the pointer to that device. - * - * @param name - * PMD type name - * @param dev_private_size - * Size of event PMDs private data - * @param socket_id - * Socket to allocate resources on. - * - * @return - * - Eventdev pointer if device is successfully created. - * - NULL if device cannot be created. - */ -struct rte_eventdev * -rte_event_pmd_vdev_init(const char *name, size_t dev_private_size, - int socket_id); - -/** - * Destroy the given virtual event device - * - * @param name - * PMD type name - * @return - * - 0 on success, negative on error - */ -int -rte_event_pmd_vdev_uninit(const char *name); - #ifdef __cplusplus } #endif diff --git a/lib/librte_eventdev/rte_eventdev_pmd_vdev.h b/lib/librte_eventdev/rte_eventdev_pmd_vdev.h new file mode 100644 index 000000000..714a59924 --- /dev/null +++ b/lib/librte_eventdev/rte_eventdev_pmd_vdev.h @@ -0,0 +1,134 @@ +/* + * + * Copyright(c) 2016-2017 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_VDEV_H_ +#define _RTE_EVENTDEV_PMD_VDEV_H_ + +/** @file + * RTE Eventdev VDEV PMD APIs + * + * @note + * These API are from event VDEV PMD only and user applications should not call + * them directly. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#include +#include +#include + +#include "rte_eventdev_pmd.h" + +/** + * @internal + * Creates a new virtual event device and returns the pointer to that device. + * + * @param name + * PMD type name + * @param dev_private_size + * Size of event PMDs private data + * @param socket_id + * Socket to allocate resources on. + * + * @return + * - Eventdev pointer if device is successfully created. + * - NULL if device cannot be created. + */ +static inline struct rte_eventdev * +rte_event_pmd_vdev_init(const char *name, size_t dev_private_size, + int socket_id) +{ + + struct rte_eventdev *eventdev; + + /* Allocate device structure */ + eventdev = rte_event_pmd_allocate(name, socket_id); + if (eventdev == NULL) + return NULL; + + /* Allocate private device structure */ + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + eventdev->data->dev_private = + rte_zmalloc_socket("eventdev device private", + dev_private_size, + RTE_CACHE_LINE_SIZE, + socket_id); + + if (eventdev->data->dev_private == NULL) + rte_panic("Cannot allocate memzone for private device" + " data"); + } + + return eventdev; +} + +/** + * @internal + * Destroy the given virtual event device + * + * @param name + * PMD type name + * @return + * - 0 on success, negative on error + */ +static inline int +rte_event_pmd_vdev_uninit(const char *name) +{ + int ret; + struct rte_eventdev *eventdev; + + if (name == NULL) + return -EINVAL; + + eventdev = rte_event_pmd_get_named_dev(name); + if (eventdev == NULL) + return -ENODEV; + + ret = rte_event_dev_close(eventdev->data->dev_id); + if (ret < 0) + return ret; + + /* Free the event device */ + rte_event_pmd_release(eventdev); + + return 0; +} + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_EVENTDEV_PMD_VDEV_H_ */ -- 2.13.1