From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0044.outbound.protection.outlook.com [104.47.32.44]) by dpdk.org (Postfix) with ESMTP id A90651B1E1 for ; Tue, 16 Jan 2018 15:29:20 +0100 (CET) Received: from CY4PR03CA0101.namprd03.prod.outlook.com (2603:10b6:910:4d::42) by SN2PR03MB2366.namprd03.prod.outlook.com (2603:10b6:804:e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Tue, 16 Jan 2018 14:29:19 +0000 Received: from BN1BFFO11FD042.protection.gbl (2a01:111:f400:7c10::1:179) by CY4PR03CA0101.outlook.office365.com (2603:10b6:910:4d::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Tue, 16 Jan 2018 14:29:18 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.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 BN1BFFO11FD042.mail.protection.outlook.com (10.58.144.105) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 16 Jan 2018 14:29:18 +0000 Received: from b27504-OptiPlex-790.ap.freescale.net (b27504-OptiPlex-790.ap.freescale.net [10.232.132.60]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w0GESqAI024963; Tue, 16 Jan 2018 07:29:15 -0700 From: Nipun Gupta To: CC: , , Date: Wed, 17 Jan 2018 02:14:00 +0530 Message-ID: <1516135443-10509-8-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516135443-10509-1-git-send-email-nipun.gupta@nxp.com> References: <20171215130828.14218-1-sunil.kori@nxp.com> <1516135443-10509-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131605865586185531; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(396003)(39860400002)(39380400002)(376002)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(81156014)(8676002)(498600001)(77096006)(51416003)(50226002)(53936002)(296002)(8936002)(2906002)(76176011)(26005)(86362001)(81166006)(54906003)(68736007)(85426001)(316002)(16586007)(104016004)(305945005)(106466001)(105606002)(2351001)(36756003)(97736004)(2950100002)(6666003)(50466002)(6916009)(5660300001)(4326008)(47776003)(356003)(8656006)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2366; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD042; 1:nr8wPqWti0dKUS1XfnnKt/p2oM2vyXH+H1EinbIGWPVvVYxKFPE/MJ8tE/7lEk4EsYqkNm1o3PMKw6lj9TCsPGE99DUIebi6MzmHo+bPZ3ER99lw4CLl7aK5CTZ2Qk5J MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 057afd09-515b-42f9-553b-08d55ced8716 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:SN2PR03MB2366; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2366; 3:eTnAw2YU0It3nmy2qfoItCegikuTmcjRtq14BvCSqrO2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3YP5aZMD4RmJpg6WinAsgMqnUkptHGVrPtfWhdAzBCWhmXO9YLtzpHm851/cEKvhGo3EgXE3dVwaAGZB1VcfYxGpz0JCsCPPGUH/9f71zHlqaKBz/VjmfLkOZ1xR/f28edcfuy8kzTEl1JGLPVETq+8a2qM4r8cPFSGSng/uCe9wFHHTd3X2m365znwOfA/v5gLsfZffBFoQydCpZ15 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)(93006095)(93001095)(3002001)(3231023)(944501161)(10201501046)(6055026)(6096035)(20161123556025)(20161123559100)(20161123561025)(20161123565025)(20161123563025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703151042153)(201708071742011); SRVR:SN2PR03MB2366; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:SN2PR03MB2366; X-Forefront-PRVS: 0554B1F54F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2366; 23:syoDjxfWBuAJzEjmYdm3CzHYD3oxeNolbHZQFIq/H?= =?us-ascii?Q?5J4Ziqrjo0/Wo73/Xk51A7NFddgdS8XxN/suiXPi8qBDpNRUJm6HpWfGB9wk?= =?us-ascii?Q?0G83zwWZU8gE3ZN0rRDdC914EGFV4EPBEVOV3406+42o1f/Oj6hWRM/MuQq4?= =?us-ascii?Q?VueO6YcXuu2S5ZfiE3d07qWcnIJ4NVXRnngBmm1r9+z+PvsHf4IGYnyJDOPT?= =?us-ascii?Q?+jnrymSDElkD5Wo2QV02UrkJ0zj9cCQE/PCwio0xO5pYQtNqyPsKJBs6qgaf?= =?us-ascii?Q?0oFUOCFwnccp0KRxp0BHho1g2iYfo5yWrpg3ccREAYHXzFfUlLgw+nlLcgK4?= =?us-ascii?Q?vKZtFqP4Vr+Aob53QfynK0tPEL+j1Jj2sA8RDrwH40A9RPJzPpVeB57a+wCz?= =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2q+YyhZGfhjyJrZpkogg3NQtmSL3kADJG8cYziHhb+3tg1NI4CBhE2uV72B2ORu/zCJv/Qj5Y4TSShrBou63F4YyoXJnpciKcmIJj7pNU20fgsO6lpOogPgdU634HBMfWOkHLkjmPdjuutgBp2282IXbA332UMCQbh+GJ60PcPpZC9aZDtDn1szmY87SxvJ1F0pyz3Oy3GvE=; 5:BPVCnzhtdgnYos0IPn2jIjl1NhLGHEwHrjkUO8Sq6x6FlB/nb0UraNKYbw7JIGZcgWDVsPaocK8KsnJgT/6CN7d+jzeQdWv+xKAC2qLwQrMZSkRuR52S4GV0rlKMHzUyXcV4McXLHtHYe2PAylGlcucrXvvBOFryY9g2k7oUEU8=; 24:sc7Xiws5RhFWoNnKJtQ7RvY4KLV4g4PDeoIDf/MQff+tC82QIplN8sVVd5rZWIoVIVAy6A6a0Ext8Ok0SzbJmIG3ts7yKgHL39ebOePfxcg=; 7:FT/lJXFQSqHd3lD4p70iTnVFgcMqpZ2cMjKC0B1w8o3Rs+l16Qui2kJQMNBf2buMz4lOT7CBh+34t2UdfjSNDN89I1qxAwjYa9EDEsxYYCXmjtcYIytyfHlFHlxauskyI/Hm9MyemHvNXcs6/gcw6Vvpw5qHmfof6x5Jo0kSofFvGJP4biWbxFbDZKJR8N2k0WQkoziJHaDY5wDqnISF+Eskoj48J80nIS4vEKDDuU04V5TQKOPHvryJ2C7Vi9Sg SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 14:29:18.4469 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 057afd09-515b-42f9-553b-08d55ced8716 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: SN2PR03MB2366 Subject: [dpdk-dev] [PATCH 07/10 v4] 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: Tue, 16 Jan 2018 14:29:21 -0000 From: Sunil Kumar Kori Signed-off-by: Sunil Kumar Kori Acked-by: Hemant Agrawal --- 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 e7548e5..cb63ffa 100644 --- a/drivers/event/dpaa/dpaa_eventdev.c +++ b/drivers/event/dpaa/dpaa_eventdev.c @@ -247,6 +247,106 @@ 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, @@ -256,6 +356,11 @@ .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, .timeout_ticks = dpaa_event_dequeue_timeout_ticks, }; -- 1.9.1