All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nipun Gupta <nipun.gupta@nxp.com>
To: <jerin.jacob@caviumnetworks.com>
Cc: <dev@dpdk.org>, <sunil.kori@nxp.com>, <hemant.agrawal@nxp.com>
Subject: [PATCH 09/12 v3] event/dpaa: add eth rx adapter queue config support
Date: Tue, 16 Jan 2018 23:28:02 +0530	[thread overview]
Message-ID: <1516125485-28919-10-git-send-email-nipun.gupta@nxp.com> (raw)
In-Reply-To: <1516125485-28919-1-git-send-email-nipun.gupta@nxp.com>

From: Sunil Kumar Kori <sunil.kori@nxp.com>

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 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

  parent reply	other threads:[~2018-01-16 11:43 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-15 13:08 [PATCH 0/6] event/dpaa: Support for eventdev Sunil Kumar Kori
2017-12-15 13:08 ` [PATCH 1/6] bus/dpaa: added event dequeue and consumption support Sunil Kumar Kori
2017-12-16 12:34   ` Jerin Jacob
2017-12-15 13:08 ` [PATCH 2/6] bus/dpaa: add dpaa eventdev dynamic log support Sunil Kumar Kori
2017-12-15 13:08 ` [PATCH 3/6] net/dpaa: ethdev Rx queue configurations with eventdev Sunil Kumar Kori
2017-12-15 13:08 ` [PATCH 4/6] event/dpaa: add eventdev PMD Sunil Kumar Kori
2017-12-16 12:37   ` Jerin Jacob
2017-12-19  7:08     ` Sunil Kumar Kori
2017-12-15 13:08 ` [PATCH 5/6] config: enabling compilation of DPAA " Sunil Kumar Kori
2017-12-16 12:39   ` Jerin Jacob
2017-12-15 13:08 ` [PATCH 6/6] doc: add DPAA eventdev guide Sunil Kumar Kori
2017-12-22 15:17   ` [PATCH v2 01/12] config: enabling compilation of DPAA eventdev PMD Sunil Kumar Kori
2017-12-22 15:17     ` [PATCH v2 02/12] bus/dpaa: add event dequeue and consumption support Sunil Kumar Kori
2017-12-22 15:17     ` [PATCH v2 03/12] bus/dpaa: add dpaa eventdev dynamic log support Sunil Kumar Kori
2017-12-22 15:17     ` [PATCH v2 04/12] net/dpaa: ethdev Rx queue configurations with eventdev Sunil Kumar Kori
2017-12-22 15:17     ` [PATCH v2 05/12] event/dpaa: add eventdev PMD Sunil Kumar Kori
2017-12-22 15:17     ` [PATCH v2 06/12] event/dpaa: add event queue config get/set support Sunil Kumar Kori
2017-12-22 15:17     ` [PATCH v2 07/12] event/dpaa: add event port " Sunil Kumar Kori
2017-12-22 15:17     ` [PATCH v2 08/12] event/dpaa: add dequeue timeout conversion support Sunil Kumar Kori
2017-12-22 15:17     ` [PATCH v2 09/12] event/dpaa: add eth rx adapter queue config support Sunil Kumar Kori
2017-12-22 15:17     ` [PATCH v2 10/12] event/dpaa: add eventdev enqueue/dequeue support Sunil Kumar Kori
2017-12-22 15:17     ` [PATCH v2 11/12] config: add eventdev library to application Sunil Kumar Kori
2017-12-22 15:17     ` [PATCH v2 12/12] doc: add DPAA eventdev guide Sunil Kumar Kori
2018-01-08 11:29       ` Jerin Jacob
2018-01-08 14:13         ` Hemant Agrawal
2018-01-10 12:10           ` Hemant Agrawal
2018-01-10 18:23             ` Jerin Jacob
2018-01-15 17:25               ` Jerin Jacob
2017-12-16 12:31 ` [PATCH 0/6] event/dpaa: Support for eventdev Jerin Jacob
2018-01-16 17:57 ` [PATCH 00/12 v3] " Nipun Gupta
2018-01-16 17:57   ` [PATCH 01/12 v3] config: enabling compilation of DPAA eventdev PMD Nipun Gupta
2018-01-16 17:57   ` [PATCH 02/12 v3] bus/dpaa: add event dequeue and consumption support Nipun Gupta
2018-01-16 17:57   ` [PATCH 03/12 v3] bus/dpaa: add dpaa eventdev dynamic log support Nipun Gupta
2018-01-16 17:57   ` [PATCH 04/12 v3] net/dpaa: ethdev Rx queue configurations with eventdev Nipun Gupta
2018-01-16 17:57   ` [PATCH 05/12 v3] event/dpaa: add eventdev PMD Nipun Gupta
2018-01-16 17:57   ` [PATCH 06/12 v3] event/dpaa: add event queue config get/set support Nipun Gupta
2018-01-16 17:58   ` [PATCH 07/12 v3] event/dpaa: add event port " Nipun Gupta
2018-01-16 17:58   ` [PATCH 08/12 v3] event/dpaa: add dequeue timeout conversion support Nipun Gupta
2018-01-16 11:50     ` Jerin Jacob
2018-01-16 13:35       ` Nipun Gupta
2018-01-16 17:58   ` Nipun Gupta [this message]
2018-01-16 17:58   ` [PATCH 10/12 v3] event/dpaa: add eventdev enqueue/dequeue support Nipun Gupta
2018-01-16 17:58   ` [PATCH 11/12 v3] config: add eventdev library to application Nipun Gupta
2018-01-16 11:52     ` Jerin Jacob
2018-01-16 17:58   ` [PATCH 12/12 v3] doc: add DPAA eventdev guide Nipun Gupta
2018-01-16 11:49     ` Jerin Jacob
2018-01-16 15:32     ` Kovacevic, Marko
2018-01-17  3:28       ` Nipun Gupta
2018-01-16 20:43 ` [PATCH 00/10 v4] event/dpaa: Support for eventdev Nipun Gupta
2018-01-16 15:04   ` Jerin Jacob
2018-01-16 20:43   ` [PATCH 01/10 v4] config: enabling compilation of DPAA eventdev PMD Nipun Gupta
2018-01-16 20:43   ` [PATCH 02/10 v4] bus/dpaa: add event dequeue and consumption support Nipun Gupta
2018-01-16 20:43   ` [PATCH 03/10 v4] bus/dpaa: add dpaa eventdev dynamic log support Nipun Gupta
2018-01-16 20:43   ` [PATCH 04/10 v4] net/dpaa: ethdev Rx queue configurations with eventdev Nipun Gupta
2018-01-16 20:43   ` [PATCH 05/10 v4] event/dpaa: add eventdev PMD Nipun Gupta
2018-01-16 20:43   ` [PATCH 06/10 v4] event/dpaa: add event queue config get/set support Nipun Gupta
2018-01-16 20:44   ` [PATCH 07/10 v4] event/dpaa: add event port " Nipun Gupta
2018-01-16 20:44   ` [PATCH 08/10 v4] event/dpaa: add eth rx adapter queue config support Nipun Gupta
2018-01-16 20:44   ` [PATCH 09/10 v4] event/dpaa: add eventdev enqueue/dequeue support Nipun Gupta
2018-01-16 20:44   ` [PATCH 10/10 v4] doc: add DPAA eventdev guide Nipun Gupta
2018-01-17 16:54     ` Mcnamara, John
2018-01-18  6:56   ` [PATCH 00/10 v4] event/dpaa: Support for eventdev Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1516125485-28919-10-git-send-email-nipun.gupta@nxp.com \
    --to=nipun.gupta@nxp.com \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=sunil.kori@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.