From patchwork Fri Oct 11 13:47:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 175965 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp799826ill; Fri, 11 Oct 2019 07:03:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1Rjf+EdK5b2B+ZinBonO1SvADIGKhOJ/0Pwo6wgc4YvRuuavVTMTQ0AhJVvsKcjDyK9nG X-Received: by 2002:a17:906:6a4f:: with SMTP id n15mr14039654ejs.19.1570802613296; Fri, 11 Oct 2019 07:03:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570802613; cv=none; d=google.com; s=arc-20160816; b=tn6/cVWtye/ednuzVGqMVRCCLWm52oFL++QDoIrrmBBLekPEeJJ7805jEsC/y4ay54 miPwDpz0sRlxyO2HhMfwGPJKTrr5AUQ7s79AJcD5J7dA1339p0MxXh43K7lVMGoi8xhE 1nRA80hKbNnJ9o4huePDmdTvdHsV6r83GmWmgpwX0LcvRRnEWUBus1yN2TBpmqENuUJA Gcl3/fqzuo70IzVvas8PyXo/7ceVBCaMBiw35El+zM3VZIi7Zm4654rwwee8qRZ5uWvC fCzTNR/7Tgww6qKmsbuRghi41lz/IkC6lF82vfrw3xdcPVxl3GR8S2hzfNDIBjvgjR6T F+xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:cc:to :from; bh=LOb/tGBD8uiwBa12kJVG70Rj9h98d9jmD4iJwtJ2pC0=; b=xs4MUXpy+MrB2DcUJvxo93pPCAs84G2bVWodoPBMgpds4Uza72eXjmReMr6vBOWj1O P4Lo+1z7+Xt4UqiFOdkzKyvLVpQGz+b2UM/MC3kLNyP/Mw47K7QIz5a7H+yv5EeZVEzs LvjQ0U6tkm/ejPmZ441rAIBvvgWAa9CWSwp3HQS0uO/VP4Ejyqgva+0HaX5l3lV8PCXZ X87/WYLU+Uxhg+7gkvV5lYqj5mMURrXiA7+RHUH50WJblJMaoE6rzXg3UqEe3/E0HG+/ utn+lZnd9/w+zprGbpaWldlm47xuWFZRBAj71Z/JE16i7mqnD70ZLltYhG9WkxHYdI+L /7nA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id dv24si5258442ejb.60.2019.10.11.07.03.33; Fri, 11 Oct 2019 07:03:33 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BAACB1EAED; Fri, 11 Oct 2019 16:03:32 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 409331EAEA; Fri, 11 Oct 2019 16:03:31 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id EFA861A0213; Fri, 11 Oct 2019 16:03:30 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 4899F1A0096; 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 24A35402DA; Fri, 11 Oct 2019 22:03:24 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: jerinj@marvell.com, hemant.agrawal@nxp.com, stable@dpdk.org, Nipun Gupta Date: Fri, 11 Oct 2019 19:17:56 +0530 Message-Id: <20191011134757.3359-1-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 1/2] event/dpaa: fix number of supported atomic flows 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" The number of atomic flows supported was not returned correctly for DPAA driver. This patch fixes the same. Fixes: b08dc6430abd ("event/dpaa: add queue config get/set") Cc: stable@dpdk.org Signed-off-by: Nipun Gupta --- drivers/event/dpaa/dpaa_eventdev.c | 1 + drivers/event/dpaa/dpaa_eventdev.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.17.1 Acked-by: Hemant Agrawal diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c index d02b8694e..570983251 100644 --- a/drivers/event/dpaa/dpaa_eventdev.c +++ b/drivers/event/dpaa/dpaa_eventdev.c @@ -471,6 +471,7 @@ dpaa_event_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id, RTE_SET_USED(queue_id); memset(queue_conf, 0, sizeof(struct rte_event_queue_conf)); + queue_conf->nb_atomic_flows = DPAA_EVENT_QUEUE_ATOMIC_FLOWS; queue_conf->schedule_type = RTE_SCHED_TYPE_PARALLEL; queue_conf->priority = RTE_EVENT_DEV_PRIORITY_HIGHEST; } diff --git a/drivers/event/dpaa/dpaa_eventdev.h b/drivers/event/dpaa/dpaa_eventdev.h index b8f247c61..5ce15a3db 100644 --- a/drivers/event/dpaa/dpaa_eventdev.h +++ b/drivers/event/dpaa/dpaa_eventdev.h @@ -32,7 +32,7 @@ do { \ RTE_EVENT_DEV_CAP_BURST_MODE; \ } while (0) -#define DPAA_EVENT_QUEUE_ATOMIC_FLOWS 0 +#define DPAA_EVENT_QUEUE_ATOMIC_FLOWS 2048 #define DPAA_EVENT_QUEUE_ORDER_SEQUENCES 2048 #define RTE_EVENT_ETH_RX_ADAPTER_DPAA_CAP \ From patchwork Fri Oct 11 13:47:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 175966 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp800086ill; Fri, 11 Oct 2019 07:03:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwnOHxuiq8Wyy394foNhRAOGsCv+pF7mtfTPQVxLc+YB2rpkH+Nmh8aLMwzerrHp609Dbr X-Received: by 2002:a17:906:2cd4:: with SMTP id r20mr13822925ejr.307.1570802623360; Fri, 11 Oct 2019 07:03:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570802623; cv=none; d=google.com; s=arc-20160816; b=ykkkmr/Ts8Fi4P5+32GYdHvd/71IU6T6hPhxTj891H81EgA0LNPjvcp2E2q4/hNvlt n8UpTcuyREEl9nnvGctolZ31U5uF9tUxr8hZXA+wWNnbs3otXMg/O5e8nMZnRmkPw0M3 fnbmCo/t4NqhKDj+NbuQRr1uuiDcYFabteUnSTLxWrG1QEk4/ACrg3wSCUR8hVAHdQ12 5NZYOj5l3jEJ5chiidDBRZRcgs3Ya2cVeY1e4ddaXKdWp/EGfOPfa855r+NQqyO8hPaB 5yhELdICQJaqzMnL2epIIvAZoaXBnYuD7nullE+w4EwiX49EIKT+u9329Yqz4S2DKX8V Nb1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=H1oQIM1QOOsre9DwwbH5k6bUJuj9+LWQYsy/aDl2nYM=; b=RAf0ei5fHRvlZ/2DojXWzegehPPWPyRHJCw2MBcnFxCCT9fy3PihYvtBunQSPAu4nS w3yMkY9ubwMdslUCCjB5m24vnAv0CMZU33g3L17k8jD3XgteCFkpC0tWQqOzXwi3rRn4 dM+P/a93NY/MhEpuBdXLeaO4IoSlSn3YPwxqM1PFQfQTFheKZAW+KJBi+hGu8CIRbqMn rBxmGctXMzhOSePPv1hG5wcjk8a3ngstcKmE224ndxBdFyQeT9I3uaXPe4DmVbH45lPn ht+9MDZ7EUIFugK7RX4Dd48X5PmV9ZelVgRCbLjL8xVXgk4PvkLvL7Gs2H8QBhMDATFm PEDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id h19si5091340edv.393.2019.10.11.07.03.43; Fri, 11 Oct 2019 07:03:43 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com 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(-) -- 2.17.1 Acked-by: Hemant Agrawal 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);