From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0040.outbound.protection.outlook.com [104.47.33.40]) by dpdk.org (Postfix) with ESMTP id DE5491B407 for ; Fri, 22 Dec 2017 16:17:47 +0100 (CET) Received: from CY4PR03CA0003.namprd03.prod.outlook.com (10.168.162.13) by MWHPR03MB2704.namprd03.prod.outlook.com (10.168.207.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Fri, 22 Dec 2017 15:17:46 +0000 Received: from BN1AFFO11FD014.protection.gbl (2a01:111:f400:7c10::108) by CY4PR03CA0003.outlook.office365.com (2603:10b6:903:33::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.345.14 via Frontend Transport; Fri, 22 Dec 2017 15:17:46 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD014.mail.protection.outlook.com (10.58.52.74) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.302.6 via Frontend Transport; Fri, 22 Dec 2017 15:17:30 +0000 Received: from sunil-OptiPlex-790.ap.freescale.net (sunil-OptiPlex-790.ap.freescale.net [10.232.132.53]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id vBMFHVf0024113; Fri, 22 Dec 2017 08:17:43 -0700 From: Sunil Kumar Kori To: CC: , Date: Fri, 22 Dec 2017 20:47:20 +0530 Message-ID: <20171222151725.11273-7-sunil.kori@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20171222151725.11273-1-sunil.kori@nxp.com> References: <20171215130828.14218-7-sunil.kori@nxp.com> <20171222151725.11273-1-sunil.kori@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131584294509754526; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(376002)(39860400002)(396003)(39380400002)(346002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(86362001)(2351001)(85426001)(51416003)(36756003)(53936002)(2906002)(81166006)(8676002)(81156014)(47776003)(48376002)(105606002)(316002)(4326008)(50466002)(356003)(106466001)(50226002)(305945005)(2950100002)(77096006)(8656006)(498600001)(6666003)(54906003)(6916009)(97736004)(1076002)(76176011)(16586007)(68736007)(5660300001)(104016004)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2704; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD014; 1:ESi1C0x00Mnns0gxGVUDo9GhgG6LyC9NrOh08Cwt4XLecE1B37wMu2jaFRKptnoQHbblg6A/5q77SEZl8aUcZSawfkZB4NbClkEutN6UUgoTmYAQK0GzdVlgWXRESah2 MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d966b21b-3e23-41d8-389e-08d5494f1ebd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:MWHPR03MB2704; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2704; 3:B/Ykbg5PzwmirEHVjFhGtrnbKTUmn3n8GGpWIqdsT9+Tiw53lZkoghQxWdTCualTdoo6ScXKB59afiX8uQGtntf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9YCKtKdbn/g3YsCe/EmxHk80/jXg9/aOr4Z6K1jkRrjTWeiSQelyKmI7WxbVgkGqrHPq8u0QzHiA/LCEBKSaG1Z4/RucDqKpwwSegav/gWleEP49YNBog2dzk7bhlufcgTgfNC18zLIARTgiWtkllYAl3QcsOh477gzbghB5h4XPbxo++uezn8hAF1m X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231023)(6055026)(6096035)(20161123556025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123559100)(20161123563025)(20161123561025)(20161123565025)(201708071742011); SRVR:MWHPR03MB2704; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:MWHPR03MB2704; X-Forefront-PRVS: 05299D545B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2704; 23:C2ofqBH4VH8a+K/5DkTuoIQP4PpuBXCr2CZqDjGzo?= =?us-ascii?Q?0lvfCY2WL9TYq8pizk/UG0vqPFfo3ZGNNtRY3FOFU0zxi1/cBzFlKuvieleV?= =?us-ascii?Q?bxQL66+u/2AK/o3NrP3Ej9wQIBDYorc4V0Ms2Sz5DdjOLaQS1rPJGMR7CjBF?= =?us-ascii?Q?6hNeUGuG+f9o12HEGxH58yrk3vYeH35140yVJqtzq3eYPpIo9gPcxqKPTeAN?= =?us-ascii?Q?uNJ8msIPIImcjcrSAq7sYv3TJrt+DOH9jA5GW4l/KhKmMtz0QGZL/W/+i5cY?= =?us-ascii?Q?NY+c7RFNULUGgaCxRx0Iyf4bzWWg7L2Si0+CD9UGgMmGX2wei9P85yagGaPi?= =?us-ascii?Q?vvSEL6cWsbDMlZxslKphmPob4kqFJgXAf4/f/yPMeG3hTP1HXMKwjHZuWa7M?= =?us-ascii?Q?ABwCH7Leld0+YVZX8HupaxDr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B6uUvZysL2p1PCPqk9B4ANjHNo9PKFWt1qPZD9MwSJIEXsesAYvTcRtA0glHk/z80kHGdxlpyOSeRdnLVUCp48jG2zJcVwJviy1Mkfwcys71+NVek7cWvXnorhqWJKJng/Ck0S2zeaYQ4sOpsA+tLT5GFqS1HHC8JTaebXSTXmpMMCvRijM=; 5:hRojsB4S+Xjd4W7G4ccWEcYJhTwV+MtzST+zFNzmotMXw/oqFG7vG3X9yY3zRNk6Y+YF5P8AA0L93tLfbcP/pbvP5N4OMQ3xcvrZIMTDCl9A1Rbbbau3MsYFgIVk7TbkycXb+n0OrS9Qxe4XvgLkMnc9zdCrJqnN5YyVOGlvVGI=; 24:JsGxlDqqkLlIT2eIbIA4Yp3NHKC3gnTqSOfe0w8wUPVkRcS6FlZHyv3on/UJJ+hyYRVOyp2VKFo617rpUZDDmwteYEzJiu9Symasp+ZlEpQ=; 7:dVFoWOUiuCpL8iE/7g8nXXn9kju4X8gm4lqNBr3roqtZ0IWX/wtglkEaXIqbZ9bRQ75CnTCeVky52j0Ns/J/ygPcWCAK6Vpp5AVNkX5DHZdVr4PE8UyWz1hxE1tWwfj5dkqA0ryCBud+tFLXgFaDcV2NahqTN02+Bh6sHJoAGKASv5pIVC/6NBCB8ZvXo44ntnTeG88GpUH+wljRFnRLbjzZzusLAn5rAUQtwnXyLZM2ZQMMOb9HnOr2ld2MEWyH SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Dec 2017 15:17:30.8038 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d966b21b-3e23-41d8-389e-08d5494f1ebd X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2704 Subject: [dpdk-dev] [PATCH v2 07/12] event/dpaa: add event port config get/set support 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, 22 Dec 2017 15:17:48 -0000 Signed-off-by: Sunil Kumar Kori --- drivers/event/dpaa/dpaa_eventdev.c | 105 +++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c index 538ba01..a3e1f7c 100644 --- a/drivers/event/dpaa/dpaa_eventdev.c +++ b/drivers/event/dpaa/dpaa_eventdev.c @@ -245,6 +245,106 @@ dpaa_event_queue_release(struct rte_eventdev *dev, uint8_t queue_id) RTE_SET_USED(queue_id); } +static void +dpaa_event_port_default_conf_get(struct rte_eventdev *dev, uint8_t port_id, + struct rte_event_port_conf *port_conf) +{ + EVENTDEV_DRV_FUNC_TRACE(); + + RTE_SET_USED(dev); + RTE_SET_USED(port_id); + + port_conf->new_event_threshold = DPAA_EVENT_MAX_NUM_EVENTS; + port_conf->dequeue_depth = DPAA_EVENT_MAX_PORT_DEQUEUE_DEPTH; + port_conf->enqueue_depth = DPAA_EVENT_MAX_PORT_ENQUEUE_DEPTH; +} + +static int +dpaa_event_port_setup(struct rte_eventdev *dev, uint8_t port_id, + const struct rte_event_port_conf *port_conf) +{ + struct dpaa_eventdev *eventdev = dev->data->dev_private; + + EVENTDEV_DRV_FUNC_TRACE(); + + RTE_SET_USED(port_conf); + dev->data->ports[port_id] = &eventdev->ports[port_id]; + + return 0; +} + +static void +dpaa_event_port_release(void *port) +{ + EVENTDEV_DRV_FUNC_TRACE(); + + RTE_SET_USED(port); +} + +static int +dpaa_event_port_link(struct rte_eventdev *dev, void *port, + const uint8_t queues[], const uint8_t priorities[], + uint16_t nb_links) +{ + struct dpaa_eventdev *priv = dev->data->dev_private; + struct dpaa_port *event_port = (struct dpaa_port *)port; + struct dpaa_eventq *event_queue; + uint8_t eventq_id; + int i; + + RTE_SET_USED(dev); + RTE_SET_USED(priorities); + + /* First check that input configuration are valid */ + for (i = 0; i < nb_links; i++) { + eventq_id = queues[i]; + event_queue = &priv->evq_info[eventq_id]; + if ((event_queue->event_queue_cfg + & RTE_EVENT_QUEUE_CFG_SINGLE_LINK) + && (event_queue->event_port)) { + return -EINVAL; + } + } + + for (i = 0; i < nb_links; i++) { + eventq_id = queues[i]; + event_queue = &priv->evq_info[eventq_id]; + event_port->evq_info[i].event_queue_id = eventq_id; + event_port->evq_info[i].ch_id = event_queue->ch_id; + event_queue->event_port = port; + } + + event_port->num_linked_evq = event_port->num_linked_evq + i; + + return (int)i; +} + +static int +dpaa_event_port_unlink(struct rte_eventdev *dev, void *port, + uint8_t queues[], uint16_t nb_links) +{ + int i; + uint8_t eventq_id; + struct dpaa_eventq *event_queue; + struct dpaa_eventdev *priv = dev->data->dev_private; + struct dpaa_port *event_port = (struct dpaa_port *)port; + + if (!event_port->num_linked_evq) + return nb_links; + + for (i = 0; i < nb_links; i++) { + eventq_id = queues[i]; + event_port->evq_info[eventq_id].event_queue_id = -1; + event_port->evq_info[eventq_id].ch_id = 0; + event_queue = &priv->evq_info[eventq_id]; + event_queue->event_port = NULL; + } + + event_port->num_linked_evq = event_port->num_linked_evq - i; + + return (int)i; +} + static const struct rte_eventdev_ops dpaa_eventdev_ops = { .dev_infos_get = dpaa_event_dev_info_get, .dev_configure = dpaa_event_dev_configure, @@ -254,6 +354,11 @@ static const struct rte_eventdev_ops dpaa_eventdev_ops = { .queue_def_conf = dpaa_event_queue_def_conf, .queue_setup = dpaa_event_queue_setup, .queue_release = dpaa_event_queue_release, + .port_def_conf = dpaa_event_port_default_conf_get, + .port_setup = dpaa_event_port_setup, + .port_release = dpaa_event_port_release, + .port_link = dpaa_event_port_link, + .port_unlink = dpaa_event_port_unlink, }; static int -- 2.9.3