From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0048.outbound.protection.outlook.com [104.47.34.48]) by dpdk.org (Postfix) with ESMTP id 4C5631B1B8 for ; Tue, 16 Jan 2018 12:43:32 +0100 (CET) Received: from BLUPR0301CA0020.namprd03.prod.outlook.com (10.162.113.158) by CY1PR0301MB0730.namprd03.prod.outlook.com (10.160.159.148) 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 11:43:29 +0000 Received: from BL2FFO11FD045.protection.gbl (2a01:111:f400:7c09::185) by BLUPR0301CA0020.outlook.office365.com (2a01:111:e400:5259::30) 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 11:43:29 +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 BL2FFO11FD045.mail.protection.outlook.com (10.173.161.207) 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 11:43:29 +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 w0GBgtjT014705; Tue, 16 Jan 2018 04:43:26 -0700 From: Nipun Gupta To: CC: , , Date: Tue, 16 Jan 2018 23:28:02 +0530 Message-ID: <1516125485-28919-10-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516125485-28919-1-git-send-email-nipun.gupta@nxp.com> References: <20171215130828.14218-1-sunil.kori@nxp.com> <1516125485-28919-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131605766092914955; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(396003)(39380400002)(376002)(346002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(77096006)(85426001)(50466002)(6916009)(305945005)(104016004)(68736007)(5890100001)(97736004)(50226002)(53936002)(4326008)(6666003)(36756003)(54906003)(356003)(48376002)(86362001)(8656006)(2950100002)(5660300001)(498600001)(2351001)(316002)(8676002)(81156014)(296002)(106466001)(16586007)(81166006)(105606002)(51416003)(47776003)(8936002)(76176011)(2906002)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0730; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD045; 1:DhU6+JDbaNJ0KfzxLmzJ84ftodzSMtj0XTi4vzK5QzfhUQ5n98WtS+fhqDnycaqR4Bfm0rt7Ui5mIj0xbF5O6W1imByr+q84eXl56WbPJzQkGujhlWSxVnMMQUVfXb0g MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 71e185bf-72e0-4f6b-810b-08d55cd65cd3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:CY1PR0301MB0730; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0730; 3:M9rpbeqV141a0ZeoJX1/vbmnO+szqevFLqSZbuj93rQ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Ky3iJa0IpBBYUKn2zLWhjzAdKJxAOCbzzL3CGPHM9XFjGBuL5ThidhUuyN9VprSQllVXe5le0mkbS2tiJDOusA8sPSgNzWohTubrwODFDvosgRxr5uMKc46pqKXMRkb/F8dHcV051CIO+CQxSo/rEmG3kmmCHvat9eftkm7TjGqPisuuO5v9HLQ3gbFmGafc/+pYK1Nurtfl3UvA6u3XrpVxdH+Hu3jmtNiUA+xeGv 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)(3231023)(944501161)(3002001)(10201501046)(6055026)(6096035)(201703131430075)(201703131520075)(201703131433075)(201703131448075)(201703151042153)(20161123559100)(20161123561025)(20161123556025)(20161123565025)(20161123563025)(201708071742011); SRVR:CY1PR0301MB0730; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR0301MB0730; X-Forefront-PRVS: 0554B1F54F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB0730; 23:9lHwXKtqEsnP6kQTo0UL93hyCZVDTv0DQzcLoDs?= =?us-ascii?Q?iKLLcr2XLXv7BPcNiCkxVbm/Rl6kkvDCxgk+PeV8ZFy0zjBQHhVJxN79n4lt?= =?us-ascii?Q?5puLgRryPSLdp+QuB/s1mQKbEX7Tw7W+LNU9LUOn9pkSHt4jrvZZIsV6rMwC?= =?us-ascii?Q?YkwbaOHjqun9ztVoq5teVNEGqkX9jz/a/m7tDEvGWrWn2pRKhM8ZVEoObeIu?= =?us-ascii?Q?1jVxFPPJg319zpEbXlAslScVdeC0qk3mvuFy2MdKyvRyxsR+NH7HbbGd3vyP?= =?us-ascii?Q?0G+NbIEOXfZ1TqWWrid3lxk4hE0vNg7eBjzeO7sB3X5jtMpj2+yTLY+1jEAY?= =?us-ascii?Q?uahpmWAvOmOhniXm+20LQOkuMF8Y0+8vGIL+DmRkZf+E0VUW+caU2s16htcW?= =?us-ascii?Q?hT65m6yMT/iwSlMXR9eXdFFEmE4qfzhanXsps4kSL+31dNtrI7RkAmL2Ne6G?= =?us-ascii?Q?q5mg8abydE/fhIGJJ7s3I/t3HdX6eSLkhgv67XwQvALYoWNHFMczb8KWiCCi?= =?us-ascii?Q?IAnmxUE1+yCxejL88rkqHWdlUVN159+zb5CE1b2KWvDkMgcsMv41BiRuyJi8?= =?us-ascii?Q?HXHvoSq+tI/RoMtcecZT8iq3rXhQMIdr+M6aTlWlRbOIEIOMscSACSQfskgz?= =?us-ascii?Q?I2MpxJYXm1z82Bmu8+YxScDXD3h6bO+Wd4xR02mq92TyFGvAdh+hvKKz4b/B?= =?us-ascii?Q?nxdh5WB965ijFYrhovx9z/h2tDKEVIqUanaFp6GVPAymQnMt5o5/jwpw5Krj?= =?us-ascii?Q?FjF272l6M7swekFa+fhC7+Mnl33Y83KXwRDMbU2bDIVfhJyzyonXx9fA5q/V?= =?us-ascii?Q?ku+hYXeSG1O2a44GlHqY6/seGuEQ6mie929WbNpeJDmclD0e6HTcI3L+a2xE?= =?us-ascii?Q?yqlOlRLnLKH/SFwu41HzRUxDljjDon5HFzC52FtTA8dp1v8Ojrfs2DPRcqqa?= =?us-ascii?Q?X2ECAUkx1hAOVlnen6EQ74LKGWnVfz1Da2smkv4AJKSyszkO7nL/fGfNriak?= =?us-ascii?Q?GVVar6JBPI944liwJC3G2DzpTDC+bwWFVA5/XVyV4Ou8BiYpfJKk3ewhnCsV?= =?us-ascii?Q?F0E64C0dlkkpsyiHa1HHyzTIDIAtVrszZSRI3c7j9LXiUtRwDqeb8h87h7wZ?= =?us-ascii?Q?5aIEa0I+I2sA=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0730; 6:ccqXItt/jFxdtYWEx7hFwxUbchtidwO4WfNA2u5gTbE9zLhg6LXreizGUvJy2HeY/LTm50UWjO95StPdMBe0aFGKQqlbxrfbtvjLv8PEkCWlq/C5WU6QsMKQgloLAdKudaYhv392gGu4c+5GvNm4L1eLbvupyAUAAxQwTTxfJ2QItMK03BDh6UVKIOdWkI4PK27jkqofir2BWIYstp7TW7fzAKrjWe1RClWo3c6AGsumPdk8KLixfzu368isisj/LV30E6pZKnCzJpfPW2vauZQAk8tWjveNAzWcKIunSlcaAcfowvgX4Ndem7mVbPEkUswFy5Ac98hm9vB7/orIsDPbsUpbwbqoGWYygsyRawQ=; 5:4Dib7QaLrRmewETt4L9io2/Kbao1ctB3cJOZvi73QghFjvNCMEs5mAS3E6WWwn59zBAK0xrfGU6P0Uik/9Xe81TpnW3oK8ypojGOXo4eCKVfaQ2P3IJ0vbi0HRHyAaM2wBxCu6JTzR9qj+zm0LI/J9zi+FGVzLLL9bngVcYKv/g=; 24:Q44rhMYES4uzTa7wZazr/7tJLJWeRq30weHdwPO1SYP1oTEOaXpMimB1ZhtP5elbprCtSWxuWRsWIC+uT9yPdwtjjxS/xex2LEzNUof7bbI=; 7:Fbg7fcW/mn8L6TA82EvsHgSXV77nY4WfSJZh/I0H+5CtrnCbNPj1N9opVQXCecttR840MJW++d/kIZMhZarFdKwUohMmm9W8pAqp/ock8P9e7DWgJJq9s9cfNYkJDtZ0GuY2TskiB0voYoSFK73bHu0NuEKZtl0/6n12IgQ2Y0TL/kVtdFwvSugmqzOTjWAT+VLwIbZUFBn/rWfqrAIscPm2Mv3KKVTStiwyCJRDBnKxXQPzmzNql5hvtxebKM/J SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 11:43:29.1198 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 71e185bf-72e0-4f6b-810b-08d55cd65cd3 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: CY1PR0301MB0730 Subject: [dpdk-dev] [PATCH 09/12 v3] 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 11:43:33 -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 b4b7aed..0d9037e 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