From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0071.outbound.protection.outlook.com [104.47.34.71]) by dpdk.org (Postfix) with ESMTP id 0D5351B28B for ; Tue, 16 Jan 2018 15:29:23 +0100 (CET) Received: from CY4PR03CA0101.namprd03.prod.outlook.com (10.171.242.170) by MWHPR03MB2703.namprd03.prod.outlook.com (10.168.207.137) 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:21 +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:21 +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:21 +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 w0GESqAJ024963; Tue, 16 Jan 2018 07:29:18 -0700 From: Nipun Gupta To: CC: , , Date: Wed, 17 Jan 2018 02:14:01 +0530 Message-ID: <1516135443-10509-9-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: 131605865615826101; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(39860400002)(39380400002)(346002)(396003)(376002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(5890100001)(105606002)(85426001)(50226002)(77096006)(8936002)(47776003)(356003)(296002)(305945005)(316002)(8656006)(97736004)(26005)(16586007)(54906003)(86362001)(2950100002)(6666003)(36756003)(51416003)(5660300001)(104016004)(76176011)(48376002)(50466002)(4326008)(53936002)(8676002)(81156014)(81166006)(68736007)(2351001)(2906002)(106466001)(498600001)(6916009)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2703; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD042; 1:x0Ro1N7t4mHBIAU7ognDkrXJjrkR9ZnpagpVoFh9ckNpxcN7EfgjYwNG87ScXc9hjPbDzUxWWg2vEZjf1RNbCE0VX4Om70NwkgcYMmnH+hR7xuJ/8cwqByxuXrfmS2Dt MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3a15f27f-c3e8-4463-9cb5-08d55ced88da X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:MWHPR03MB2703; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2703; 3:uXHFS1wLhQqEMf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+G3f/I5OFksfYaOz2IwlBRWUfBLfZX5VqYSmpB+5Wgdq8hmAS/vq+2b59b95ACzWX3zG4Wgl4AOA3bLtkH8jzDX7bk13WMJye2binGnitQ0kR2qg8WBz042Ecp0D3Iu27FacPn+r/9yaNBwx4e1RXfMMOwmqi76hYrZ4NeLgqh/gMk5YYUhHdhLZikhYn+6ByeSK3e/C/fSf+VYHBeNyl3ggBG6p9hxV68ucTCdYSsCoXB+DEAlNPdL0L4 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)(10201501046)(93006095)(93001095)(3231023)(944501161)(3002001)(6055026)(6096035)(20161123556025)(20161123565025)(20161123561025)(20161123563025)(20161123559100)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703151042153)(201708071742011); SRVR:MWHPR03MB2703; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:MWHPR03MB2703; X-Forefront-PRVS: 0554B1F54F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2703; 23:NTukVVqOHO7NAPSkNNzdwqYUjWCvmn/pncJNyGAvg?= =?us-ascii?Q?WuQ/Wh1KO9NBeJ5+YiJgaiYb3BfPlTXTIbKcT/oLyMT6GOPf6/fqGbbvPfHK?= =?us-ascii?Q?aiJ432J5l9/ZyjLLrhTwfVXqFCFNzXddvBVDMJU5CHYT8f/aJI9BuxVE0fL7?= =?us-ascii?Q?csPGs67aWwR1THgrTgHrcyOfVKp2nRV08hojyD3so0yJ5y4Xxla7Bgi9pFV8?= =?us-ascii?Q?cQzU56zUjyorqKhBLtRDJpj1sVL9SKvTuBZT2oCiICRKtLGsiFEe4sv1dDQd?= =?us-ascii?Q?qBTmEm4MqsUX0S4hrLYXw+R+rqqhGMBm3tw0wsH0hjkDUOEE1qj4WEV28Iqu?= =?us-ascii?Q?gYEJwdBXTwo4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D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2703; 6:MpswRbzBo/vvHHFVMlzHXiMCTtd2UbsVgHeOtcL5ZFSXP2noPSM7qc/V2Py2LwqOJGQcbCq0BRHbxwEZ0K8WPwIZ4K4SMS1/dRUD5QPY+YkwsQTEKG08p5BVcynjf//48X+oCMM3Cb4s5LXhKYZLk/BP3lZrZ7jwQ2D7KUAJM+bcEXxZwCzXePfoLcBg3gdnubP6b5Vk1rWnKojRUrbKlL9HTjvMIViTZpm2UFMbYRdqAvke1X24tMVyPPWjXJ20N8ECak0p384noC+PNn/VpAL5ZaoqgBsvz2del81exrXHVZdq7WOKKQVgPuSPQO6OvbguRVsP/7OVyJBECrdWZX7RYULm/Cg51+xITXVXId8=; 5:OxtrUMmCFDwx85i79AW8DlgbezA8S4f7KU4KGLzgYkV7+equZLmkLOf6vrznntI7lFFWzzYjWGnRGkyCKTCi0nLgJybVcDxARCshW4Iz9AE/jGnMDqLUZeyr1YqDMGFas1tyf1eYbS+EaqyWjd9eU3NRWkejd3w5mqg721vvBng=; 24:BM67sXWq/VXx5noWnmpZhqzXbrdsm4dyhxIeiWPAUPUiO23iOLia+JjAzYZE/Y96EikhZ8w1CPHmz6rcZX7H0grzkEnjPUZpNI7VXgvpw4c=; 7:JaqOAQBLE2P+SFye1eTsFbkFnhkQ1w3EeijFlCtSAGlT3Dz3YvAmjcKnufkxnhAyxREdg+9p63qYqR1HT/0r/VV62CEp9n+Ozy9d/xGLd1uG/bsclENDmVDG6BIAXGGhEQDat3hu4fksx8u4IdIZNWonQ5NQ8//gu1CR9p22CeWvykvFbZtyQLVkdSKIo7xwjJXmymRRUmycUio8bsUUqWvXQm2fDqghvZ0g+wKy4T75jkkXrU64HAqhlrz3CNG2 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 14:29:21.4110 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3a15f27f-c3e8-4463-9cb5-08d55ced88da 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: MWHPR03MB2703 Subject: [dpdk-dev] [PATCH 08/10 v4] event/dpaa: add eth rx adapter queue config 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:23 -0000 From: Sunil Kumar Kori Signed-off-by: Sunil Kumar Kori Acked-by: Hemant Agrawal --- drivers/event/dpaa/dpaa_eventdev.c | 117 +++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c index cb63ffa..05469ae 100644 --- a/drivers/event/dpaa/dpaa_eventdev.c +++ b/drivers/event/dpaa/dpaa_eventdev.c @@ -347,6 +347,118 @@ return (int)i; } +static int +dpaa_event_eth_rx_adapter_caps_get(const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev, + uint32_t *caps) +{ + const char *ethdev_driver = eth_dev->device->driver->name; + + EVENTDEV_DRV_FUNC_TRACE(); + + RTE_SET_USED(dev); + + if (!strcmp(ethdev_driver, "net_dpaa")) + *caps = RTE_EVENT_ETH_RX_ADAPTER_DPAA_CAP; + else + *caps = RTE_EVENT_ETH_RX_ADAPTER_SW_CAP; + + return 0; +} + +static int +dpaa_event_eth_rx_adapter_queue_add( + const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev, + int32_t rx_queue_id, + const struct rte_event_eth_rx_adapter_queue_conf *queue_conf) +{ + struct dpaa_eventdev *eventdev = dev->data->dev_private; + uint8_t ev_qid = queue_conf->ev.queue_id; + u16 ch_id = eventdev->evq_info[ev_qid].ch_id; + struct dpaa_if *dpaa_intf = eth_dev->data->dev_private; + int ret, i; + + EVENTDEV_DRV_FUNC_TRACE(); + + if (rx_queue_id == -1) { + for (i = 0; i < dpaa_intf->nb_rx_queues; i++) { + ret = dpaa_eth_eventq_attach(eth_dev, i, ch_id, + queue_conf); + if (ret) { + EVENTDEV_DRV_ERR( + "Event Queue attach failed:%d\n", ret); + goto detach_configured_queues; + } + } + return 0; + } + + ret = dpaa_eth_eventq_attach(eth_dev, rx_queue_id, ch_id, queue_conf); + if (ret) + EVENTDEV_DRV_ERR("dpaa_eth_eventq_attach failed:%d\n", ret); + return ret; + +detach_configured_queues: + + for (i = (i - 1); i >= 0 ; i--) + dpaa_eth_eventq_detach(eth_dev, i); + + return ret; +} + +static int +dpaa_event_eth_rx_adapter_queue_del(const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev, + int32_t rx_queue_id) +{ + int ret, i; + struct dpaa_if *dpaa_intf = eth_dev->data->dev_private; + + EVENTDEV_DRV_FUNC_TRACE(); + + RTE_SET_USED(dev); + if (rx_queue_id == -1) { + for (i = 0; i < dpaa_intf->nb_rx_queues; i++) { + ret = dpaa_eth_eventq_detach(eth_dev, i); + if (ret) + EVENTDEV_DRV_ERR( + "Event Queue detach failed:%d\n", ret); + } + + return 0; + } + + ret = dpaa_eth_eventq_detach(eth_dev, rx_queue_id); + if (ret) + EVENTDEV_DRV_ERR("dpaa_eth_eventq_detach failed:%d\n", ret); + return ret; +} + +static int +dpaa_event_eth_rx_adapter_start(const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev) +{ + EVENTDEV_DRV_FUNC_TRACE(); + + RTE_SET_USED(dev); + RTE_SET_USED(eth_dev); + + return 0; +} + +static int +dpaa_event_eth_rx_adapter_stop(const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev) +{ + EVENTDEV_DRV_FUNC_TRACE(); + + RTE_SET_USED(dev); + RTE_SET_USED(eth_dev); + + return 0; +} + static const struct rte_eventdev_ops dpaa_eventdev_ops = { .dev_infos_get = dpaa_event_dev_info_get, .dev_configure = dpaa_event_dev_configure, @@ -362,6 +474,11 @@ .port_link = dpaa_event_port_link, .port_unlink = dpaa_event_port_unlink, .timeout_ticks = dpaa_event_dequeue_timeout_ticks, + .eth_rx_adapter_caps_get = dpaa_event_eth_rx_adapter_caps_get, + .eth_rx_adapter_queue_add = dpaa_event_eth_rx_adapter_queue_add, + .eth_rx_adapter_queue_del = dpaa_event_eth_rx_adapter_queue_del, + .eth_rx_adapter_start = dpaa_event_eth_rx_adapter_start, + .eth_rx_adapter_stop = dpaa_event_eth_rx_adapter_stop, }; static int -- 1.9.1