From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0063.outbound.protection.outlook.com [104.47.37.63]) by dpdk.org (Postfix) with ESMTP id 0E1FC1B413 for ; Fri, 22 Dec 2017 16:17:50 +0100 (CET) Received: from BN6PR03CA0018.namprd03.prod.outlook.com (10.168.230.156) by CY1PR03MB2364.namprd03.prod.outlook.com (10.166.207.151) 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:49 +0000 Received: from BL2FFO11FD015.protection.gbl (2a01:111:f400:7c09::110) by BN6PR03CA0018.outlook.office365.com (2603:10b6:404:23::28) 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:49 +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 BL2FFO11FD015.mail.protection.outlook.com (10.173.160.223) 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:34 +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 vBMFHVf2024113; Fri, 22 Dec 2017 08:17:47 -0700 From: Sunil Kumar Kori To: CC: , Date: Fri, 22 Dec 2017 20:47:22 +0530 Message-ID: <20171222151725.11273-9-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: 131584294543801884; (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)(346002)(396003)(376002)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(76176011)(6666003)(8936002)(5890100001)(6916009)(2906002)(51416003)(68736007)(85426001)(2351001)(77096006)(53936002)(97736004)(8656006)(36756003)(50466002)(48376002)(8676002)(106466001)(105606002)(5660300001)(2950100002)(1076002)(104016004)(86362001)(498600001)(316002)(81156014)(305945005)(54906003)(81166006)(16586007)(356003)(4326008)(50226002)(47776003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2364; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD015; 1:10gg14G+Zy9sHzEFctBxXlCYvaanCUehcZ++RnK7gDK3Tr7w9sXXuhyXRAcQirb8W+3vzIHNHFHSRQqiGo3TRyOxqrfx+FEDCBQoqPymICuM/vOX+RTeVAop9AmKlH/L MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d6020f8a-10cd-45f1-be1c-08d5494f20c4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:CY1PR03MB2364; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2364; 3:rJljufoWJ4flQjn/QfJan3V1xY3iwVErG4nrxgnyhdtX43rj/1htIZEX8g9tkIjom+Ruul937A8O8cD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GjCvItHiOECjWeW2CpDfHt4GVFYo7+UPz39lFmvj1THzNgc0lhfMl4aRaKXIcLrFX3Xw01etNsg3yNtzkoolGjq2BehcXaIJ5lZYdjFO8By9T5cLc2IO+bDz3TifeZOWroFMpYcA+QDCpzdjQbm3MyFGJ96OyBAGUyWFS1l7e X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231023)(944510044)(944921044)(946801044)(946901044)(3002001)(6055026)(6096035)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123565025)(20161123561025)(20161123556025)(20161123563025)(20161123559100)(201708071742011); SRVR:CY1PR03MB2364; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR03MB2364; X-Forefront-PRVS: 05299D545B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2364; 23:ctXNyUeRBgQJeUsUXRew+xzPIgs8F2PYied+NliB5?= =?us-ascii?Q?wcyJAtsT1ImBZJzuiri6XtS3FbRUZEP5xXwVzQ1uswqv0WBqJB3t0cd9v0A/?= =?us-ascii?Q?MUkImLhl0KX7uRAOwZtMj19N9qQaEMO3316uFhg6jQQLPHbvDqrHyOqtepts?= =?us-ascii?Q?6ojl5SSq1A32VT7XLM4DBw8gSRaING76kyJIoT/zU3KYHQY0tCzVyWQMjrRB?= =?us-ascii?Q?q8dUIeoHSUNaYROLSjWwidy8ca5N/pHfNcbIa1t/Id+tn0u71rWf1rYUCABt?= =?us-ascii?Q?5OCI5GFaa42bOpBh8B9wnQPw7dmvFK+V4rcb1816xQRgTgzc+cP2h/sEMJKT?= =?us-ascii?Q?IdBq0ov15Rh7wEEoy1eHoMwD5+c1sImkm1graxU3n2tiZ7sajArQzW6Tg5VA?= =?us-ascii?Q?QpmgfmCXGFroSIf5ktHeGC0bxZq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XN9w5oFA3/cir4xR8J6XaXrToC+4UFOEkVBDGwjS+uzg0K4P/R6f97anuGGBYfY3dtRTfOLZe3paWilFSZuFgG0lOEZq2hoGTaB/yz88i/NLB3eqZkA+t4D5r2ZWV/C8JkDqr4s9mgzAyvxUOraztArqreo9ETKnmkYx2QA6ClRH/M1nBmcGY3mJYZz7T9CWs=; 5:IraBK9m+yEP+0jSg0XoinPlFXcvzCVQNFYALzWxQlZWJUEFBf0Hpc14rcAVVILKdzx4F82t4eaT/j3N5eRwJV22Udmf5ijU7pZ/FXtyQRGaJNm4aNi4J7Dra/rEVxCbrwcQrewgBIctALSNDLBkrd02kNWmMoqwivaLa7xDoL/w=; 24:+QX2vJzGiNY5S62ACewiyUw6CNLqY5ZZ+EV45auITLlRfykD5GsZeGd3S7wNiITAL5vn3vgynZVjhTsa22XKrVXKAY5wJV171heF1P2R0k4=; 7:OKBhQPFJ7FfWEqirvwq35xqIBRhN7NFePGKTnbFwg9ojkmFf43hKIHPxP2a9KrlXK1qXN9uB6di06WgBZMuwiHIbUvK7rZ5Y2oVD+RCm+AMtg1KaJSnCGrnAnYR6DJT9W9KLZy4N6stIaerEDYJ/nPQXHh3NXVJGkRsJUTpDcoJeNE5TL+eylfc0+1Q8l66SWVRuIWZtqwvxhnA2wQLYfcEU0VuAUPvcKL6OcKCzSGG/fjpyfHgisMa5HHAPX44Q SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Dec 2017 15:17:34.2085 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6020f8a-10cd-45f1-be1c-08d5494f20c4 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: CY1PR03MB2364 Subject: [dpdk-dev] [PATCH v2 09/12] 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: Fri, 22 Dec 2017 15:17:52 -0000 Signed-off-by: Sunil Kumar Kori --- 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 7b3d8fb..13345da 100644 --- a/drivers/event/dpaa/dpaa_eventdev.c +++ b/drivers/event/dpaa/dpaa_eventdev.c @@ -345,6 +345,118 @@ dpaa_event_port_unlink(struct rte_eventdev *dev, void *port, 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, @@ -360,6 +472,11 @@ static const struct rte_eventdev_ops dpaa_eventdev_ops = { .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 -- 2.9.3