From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 090F8A3160 for ; Fri, 11 Oct 2019 16:03:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BE8811EB1A; Fri, 11 Oct 2019 16:03:35 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id DB5751EAEA for ; Fri, 11 Oct 2019 16:03:31 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 7D92A2001BC; Fri, 11 Oct 2019 16:03:31 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id F372620054C; Fri, 11 Oct 2019 16:03:28 +0200 (CEST) Received: from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 714AD402E4; Fri, 11 Oct 2019 22:03:25 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: jerinj@marvell.com, hemant.agrawal@nxp.com, Nipun Gupta Date: Fri, 11 Oct 2019 19:17:57 +0530 Message-Id: <20191011134757.3359-2-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191011134757.3359-1-nipun.gupta@nxp.com> References: <20191011134757.3359-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 2/2] event/dpaa: support Tx adapter 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch adds the support of Tx adapter for DPAA1 platform Signed-off-by: Nipun Gupta --- drivers/event/dpaa/dpaa_eventdev.c | 75 ++++++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 5 deletions(-) diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c index 570983251..b8761c6a9 100644 --- a/drivers/event/dpaa/dpaa_eventdev.c +++ b/drivers/event/dpaa/dpaa_eventdev.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -864,6 +865,66 @@ dpaa_eventdev_crypto_stop(const struct rte_eventdev *dev, return 0; } +static int +dpaa_eventdev_tx_adapter_create(uint8_t id, + const struct rte_eventdev *dev) +{ + RTE_SET_USED(id); + RTE_SET_USED(dev); + + /* Nothing to do. Simply return. */ + return 0; +} + +static int +dpaa_eventdev_tx_adapter_caps(const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev, + uint32_t *caps) +{ + RTE_SET_USED(dev); + RTE_SET_USED(eth_dev); + + *caps = RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT; + return 0; +} + +static uint16_t +dpaa_eventdev_txa_enqueue_same_dest(void *port, + struct rte_event ev[], + uint16_t nb_events) +{ + struct rte_mbuf *m[DPAA_EVENT_MAX_PORT_ENQUEUE_DEPTH], *m0; + uint8_t qid, i; + + RTE_SET_USED(port); + + m0 = (struct rte_mbuf *)ev[0].mbuf; + qid = rte_event_eth_tx_adapter_txq_get(m0); + + for (i = 0; i < nb_events; i++) + m[i] = (struct rte_mbuf *)ev[i].mbuf; + + return rte_eth_tx_burst(m0->port, qid, m, nb_events); +} + +static uint16_t +dpaa_eventdev_txa_enqueue(void *port, + struct rte_event ev[], + uint16_t nb_events) +{ + struct rte_mbuf *m = (struct rte_mbuf *)ev[0].mbuf; + uint8_t qid, i; + + RTE_SET_USED(port); + + for (i = 0; i < nb_events; i++) { + qid = rte_event_eth_tx_adapter_txq_get(m); + rte_eth_tx_burst(m->port, qid, &m, 1); + } + + return nb_events; +} + static struct rte_eventdev_ops dpaa_eventdev_ops = { .dev_infos_get = dpaa_event_dev_info_get, .dev_configure = dpaa_event_dev_configure, @@ -879,11 +940,13 @@ static 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, + .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, + .eth_tx_adapter_caps_get = dpaa_eventdev_tx_adapter_caps, + .eth_tx_adapter_create = dpaa_eventdev_tx_adapter_create, .crypto_adapter_caps_get = dpaa_eventdev_crypto_caps_get, .crypto_adapter_queue_pair_add = dpaa_eventdev_crypto_queue_add, .crypto_adapter_queue_pair_del = dpaa_eventdev_crypto_queue_del, @@ -956,6 +1019,8 @@ dpaa_event_dev_create(const char *name, const char *params) eventdev->dequeue = dpaa_event_dequeue_intr; eventdev->dequeue_burst = dpaa_event_dequeue_burst_intr; } + eventdev->txa_enqueue = dpaa_eventdev_txa_enqueue; + eventdev->txa_enqueue_same_dest = dpaa_eventdev_txa_enqueue_same_dest; RTE_LOG(INFO, PMD, "%s eventdev added", name); -- 2.17.1