From patchwork Fri Sep 21 11:46:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 147244 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp713328ljw; Fri, 21 Sep 2018 04:48:25 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZda2dMXyRPAhiCRr5pyD+AXwBeubRoT741hZFjnskyls3cXA0U8wLt3ZYUs8uemjOWew8H X-Received: by 2002:a1c:1510:: with SMTP id 16-v6mr6585650wmv.74.1537530505712; Fri, 21 Sep 2018 04:48:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537530505; cv=none; d=google.com; s=arc-20160816; b=z39Htxipd+vRU4SfUtmkYykNjo3qaV5VMneYSqkIHan1T1qj9E8L+nPIRUqtt0kTfd b7Vq/NUb1NDIdGghoVOouxUgnMdrZ1NjlwzioLiRawxNNbiMDP4x0z60whGzhVl4owjW /NEKyJM0xHONYk8E8q72keg0EQT6o6sLgcVkb0UxjMphncJAyCYV/7v9wJy0f1NqtH/q 24meD9EzPbKr1K3Ejvd13+rOEtDVvePTULAl9CYnmcIV0JFYXcVuwuj7VeM7XGdN6VBI 2Tz5BCRJZ1V1O9SAWNDpF6vTvLFRSu0XiFiWQLhsYol2W5tvttpSLGUpscpKCnxuascM QwHg== 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=jqg+9SzWIO+J53AVRtYlNvxtsiIpluu5f2yOfYRMfuE=; b=FKp6NV+hqlJAC+WEeG1zCPefUDhE2alFY6qb5jaA7CFUYktKJXR/SnIfHJHKfseHyg 4MX4yBlpYV4FPAF9QCoTKfOkVEuHcDFcLK6t7VqzEKIueg7IDBy7lYJ2oYQrhiRr+vaz sIIfhEbWY9s3m6crqbr5fYlAWaZVqjz6+5Kl5AY1vMRHLsAxLq+wG4fkb3IquNneKp+j Gmgk03BwGP4Ow62R1uDAyXZKEYWXZeLDEho/ZMrd/6czOGAwjhE4jqyl+wI8ceWS0Py9 u1sP0ffJcCWKilOrvP8IFokPAtUEM9Yut/zc54lt87G+ddTPnm+8XPJfntXnyFCuXJE0 8JZQ== 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 f17-v6si4637547wrj.147.2018.09.21.04.48.25; Fri, 21 Sep 2018 04:48:25 -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 0626E4C9D; Fri, 21 Sep 2018 13:48:19 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 686E91B19; Fri, 21 Sep 2018 13:48:15 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 3538B1A02C4; Fri, 21 Sep 2018 13:48:15 +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 E69B51A02C3; Fri, 21 Sep 2018 13:48:12 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 7E660402A9; Fri, 21 Sep 2018 19:48:09 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: jerin.jacob@caviumnetworks.com, Hemant Agrawal , stable@dpdk.org Date: Fri, 21 Sep 2018 17:16:02 +0530 Message-Id: <1537530366-4722-1-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535609039-10869-1-git-send-email-hemant.agrawal@nxp.com> References: <1535609039-10869-1-git-send-email-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 1/5] event/dpaa2: fix mbuf assignment in atomic processing 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" Fixes: 7b6edb640b73 ("event/dpaa2: have separate structure to hold dqrr entries") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/event/dpaa2/dpaa2_eventdev.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index ea1e5cc..ea9d868 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -197,6 +197,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, ev->mbuf->seqn = dqrr_index + 1; DPAA2_PER_LCORE_DQRR_SIZE++; DPAA2_PER_LCORE_DQRR_HELD |= 1 << dqrr_index; + DPAA2_PER_LCORE_DQRR_MBUF(dqrr_index) = ev->mbuf; } static uint16_t From patchwork Fri Sep 21 11:46:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 147243 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp713183ljw; Fri, 21 Sep 2018 04:48:17 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZOHkk/0bKLlBvVn1/mbUxlvyT7M6kVnCdzZr2eJrQHTTvmGBq3lrfKv71FSMsCTB5ItV5p X-Received: by 2002:a1c:4007:: with SMTP id n7-v6mr7069571wma.108.1537530497746; Fri, 21 Sep 2018 04:48:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537530497; cv=none; d=google.com; s=arc-20160816; b=f1NSfgbuIRQm+AQh8BbSg4JW3oaUcbL4Qe2Tm7Yr7yr9+9Ll4G8OziPtf/4PE4CDHO 5HVlfqOVfNA3NszwMmwzjlFeMXb6c60a9uscyrVKTEJuFZ4Bah24SDWwVTaWya19o9KI tABqmbWAEkTuDoHZ1Qll+g44h4nyerJzIx6lJIVuOzW+4M+/pEtRYMBBtBiGIQQidvUB FFYh9Aqsy425dC/ibixFCXbeKZw/HDOE8dZdFBi8y2YMVU111wFHqfC7nQ22kxuYHKKc 4jjBhcuoBlbZbCNOH0HxUyHAtA8S163B5Be75/Exri0ZH/cVCavq6T3E9ojs5RpvwLve GSWg== 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=6C5Wbi4tDPiIU9UGgL/d123HgnaWLeV05i3TwHZcYm8=; b=I5MHj+cK2qCWQo6/1wfQPcdIaNFhIQ1XxokSsGGsnDZSrHNpFaKElj1U1sDQvm23vg s+if7iD5KUgaaXIsJ7WdzUYtOBjT+u/p2z+e8o2iP25wbwQVsG1u6pLn9gp8NDlS/Otc bjXeRXsQDXFEa59FZzgovuqeb8f2tx3XrSdTY5MJG1DnyB4cVobKwgLwO2z+TuT+cnlG uSoNc3ATvXR/d2pLSWjbkBvkj0C/K4fcrsmnmdRz9n72g1uEnVXLorecAIamxClxijC6 1B7F8jncAUou8YRAU4p1aORnJkqSdL32yJofe0548fnry4Osn3X8v6TUEu4r2mATjqIj gLjQ== 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 x23-v6si3918372wrd.120.2018.09.21.04.48.17; Fri, 21 Sep 2018 04:48:17 -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 944861DA4; Fri, 21 Sep 2018 13:48:16 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 6C52C1DA4 for ; Fri, 21 Sep 2018 13:48:15 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 3D1121A02C5; Fri, 21 Sep 2018 13:48:15 +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 5D3F01A02B6; Fri, 21 Sep 2018 13:48:13 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 6C2C0402DD; Fri, 21 Sep 2018 19:48:10 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: jerin.jacob@caviumnetworks.com, Hemant Agrawal Date: Fri, 21 Sep 2018 17:16:03 +0530 Message-Id: <1537530366-4722-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537530366-4722-1-git-send-email-hemant.agrawal@nxp.com> References: <1535609039-10869-1-git-send-email-hemant.agrawal@nxp.com> <1537530366-4722-1-git-send-email-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 2/5] event/dpaa2: rename evq info to dpaa2 eventq 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 is to keep the dpaa2 driver aligned with dpaa driver. Signed-off-by: Hemant Agrawal --- drivers/event/dpaa2/dpaa2_eventdev.c | 8 ++++---- drivers/event/dpaa2/dpaa2_eventdev.h | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index ea9d868..c4064a4 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -58,7 +58,7 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[], ((struct dpaa2_io_portal_t *)port)->eventdev; struct dpaa2_eventdev *priv = ev_dev->data->dev_private; uint32_t queue_id = ev[0].queue_id; - struct evq_info_t *evq_info = &priv->evq_info[queue_id]; + struct dpaa2_eventq *evq_info = &priv->evq_info[queue_id]; uint32_t fqid; struct qbman_swp *swp; struct qbman_fd fd_arr[MAX_TX_RING_SLOTS]; @@ -385,7 +385,7 @@ dpaa2_eventdev_queue_setup(struct rte_eventdev *dev, uint8_t queue_id, const struct rte_event_queue_conf *queue_conf) { struct dpaa2_eventdev *priv = dev->data->dev_private; - struct evq_info_t *evq_info = + struct dpaa2_eventq *evq_info = &priv->evq_info[queue_id]; EVENTDEV_INIT_FUNC_TRACE(); @@ -449,7 +449,7 @@ dpaa2_eventdev_port_unlink(struct rte_eventdev *dev, void *port, { struct dpaa2_eventdev *priv = dev->data->dev_private; struct dpaa2_io_portal_t *dpaa2_portal = port; - struct evq_info_t *evq_info; + struct dpaa2_eventq *evq_info; int i; EVENTDEV_INIT_FUNC_TRACE(); @@ -473,7 +473,7 @@ dpaa2_eventdev_port_link(struct rte_eventdev *dev, void *port, { struct dpaa2_eventdev *priv = dev->data->dev_private; struct dpaa2_io_portal_t *dpaa2_portal = port; - struct evq_info_t *evq_info; + struct dpaa2_eventq *evq_info; uint8_t channel_index; int ret, i, n; diff --git a/drivers/event/dpaa2/dpaa2_eventdev.h b/drivers/event/dpaa2/dpaa2_eventdev.h index 229f66a..d2f98c6 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.h +++ b/drivers/event/dpaa2/dpaa2_eventdev.h @@ -56,17 +56,18 @@ struct dpaa2_dpcon_dev { uint8_t channel_index; }; -struct evq_info_t { +struct dpaa2_eventq { /* DPcon device */ struct dpaa2_dpcon_dev *dpcon; /* Attached DPCI device */ struct dpaa2_dpci_dev *dpci; /* Configuration provided by the user */ uint32_t event_queue_cfg; + uint32_t event_queue_id; }; struct dpaa2_eventdev { - struct evq_info_t evq_info[DPAA2_EVENT_MAX_QUEUES]; + struct dpaa2_eventq evq_info[DPAA2_EVENT_MAX_QUEUES]; uint32_t dequeue_timeout_ns; uint8_t max_event_queues; uint8_t nb_event_queues; From patchwork Fri Sep 21 11:46:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 147245 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp713514ljw; Fri, 21 Sep 2018 04:48:34 -0700 (PDT) X-Google-Smtp-Source: ACcGV60HyGKqE1lfAwv6zpihGWSGL+agwkpZi4Jldu4H1ISeLxz0dlVJmGbYXIEztHfrqDqd/aYx X-Received: by 2002:adf:f0d1:: with SMTP id x17-v6mr9373339wro.49.1537530513972; Fri, 21 Sep 2018 04:48:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537530513; cv=none; d=google.com; s=arc-20160816; b=SA302EYNcQFJQixbngGfVZ1Ux8OyGhrcKyBjP7hVHYiYuy0P7jzwhVq2m/fZ606diE D8mSskoRaCsyey9yR680Ymu9hhzmxONh4KagB22lfcGUsiBj5AfEiwS+hPpYrw0Ed3c1 iSqIJeVq4nyx1y6VT7UI2GMDQXFkgCc3GSz4epBwjjXlHIO43ekedrFnZTb66jD4lg8x ZRLX5nJOvki0Ck1WVqJZtiVGzOjuW06UVtFRMwUS3C+IzDRjoyp20d1LlnmgcLw7OT57 MJ7rv5uo4ZBhMW4SyKlGG8tupPP3mEW79Ak7X/wpNbECVxOrELNkJ5t1EVjrTKa3/yPt omMg== 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=970h3Ldi1F9d1Nld6NUFtTA50GZYXuTEtv/8h9FYZmg=; b=iNSnK85YZigFT9bBeUw7VU9Cf/odE2G1POVurxjLIBzjzrFDZxNgZTsx8fw5WrLOfx bkQY7rN05YT+xK+ymEyXr+FGxYf5j4CRu+Vuft24PU0WeWjPyEbfXf9V2dg/L4Ohk701 95MxZgsvK64uDBIdnBRoJDnqAK6fMsHH5aRyMuFMmFEq5D3aA++Ld1T0a1fNyWumH1mO XUDopu+3Vj8WeeWw336pt/D2jJ1qA0wnEgIGS6BzF/DKIq8qgMwGhpz6AlYuwktg5F8R iupDTk1pAbj9ch0XgyGFw+UPxXgNIxkOqT523AaffTHfv8I5Ilol6pVKm97/5OALPPW8 AeVg== 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 l74-v6si138799wmd.35.2018.09.21.04.48.33; Fri, 21 Sep 2018 04:48: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 C95064CA5; Fri, 21 Sep 2018 13:48:21 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 28F011B19 for ; Fri, 21 Sep 2018 13:48:16 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 0DAFF1A02B6; Fri, 21 Sep 2018 13:48:16 +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 2D8031A02B4; Fri, 21 Sep 2018 13:48:14 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 438AF402E5; Fri, 21 Sep 2018 19:48:11 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: jerin.jacob@caviumnetworks.com, Hemant Agrawal Date: Fri, 21 Sep 2018 17:16:04 +0530 Message-Id: <1537530366-4722-3-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537530366-4722-1-git-send-email-hemant.agrawal@nxp.com> References: <1535609039-10869-1-git-send-email-hemant.agrawal@nxp.com> <1537530366-4722-1-git-send-email-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 3/5] event/dpaa2: enchance timeout handling 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 enahances: 1. configure the dequeue time out value as per the given method or per dequeue, global or default. 2. The timeout values were being mixed as ns or ms timeouts. now the values are stored as ns and scale is in ms. Signed-off-by: Hemant Agrawal --- v2: added description drivers/event/dpaa2/dpaa2_eventdev.c | 19 ++++++++++++++++--- drivers/event/dpaa2/dpaa2_eventdev.h | 1 + 2 files changed, 17 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index c4064a4..4b56e2e 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -284,7 +284,7 @@ dpaa2_eventdev_info_get(struct rte_eventdev *dev, dev_info->max_dequeue_timeout_ns = DPAA2_EVENT_MAX_DEQUEUE_TIMEOUT; dev_info->dequeue_timeout_ns = - DPAA2_EVENT_MIN_DEQUEUE_TIMEOUT; + DPAA2_EVENT_PORT_DEQUEUE_TIMEOUT_NS; dev_info->max_event_queues = priv->max_event_queues; dev_info->max_event_queue_flows = DPAA2_EVENT_MAX_QUEUE_FLOWS; @@ -314,7 +314,6 @@ dpaa2_eventdev_configure(const struct rte_eventdev *dev) EVENTDEV_INIT_FUNC_TRACE(); - priv->dequeue_timeout_ns = conf->dequeue_timeout_ns; priv->nb_event_queues = conf->nb_event_queues; priv->nb_event_ports = conf->nb_event_ports; priv->nb_event_queue_flows = conf->nb_event_queue_flows; @@ -322,6 +321,20 @@ dpaa2_eventdev_configure(const struct rte_eventdev *dev) priv->nb_event_port_enqueue_depth = conf->nb_event_port_enqueue_depth; priv->event_dev_cfg = conf->event_dev_cfg; + /* Check dequeue timeout method is per dequeue or global */ + if (priv->event_dev_cfg & RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT) { + /* + * Use timeout value as given in dequeue operation. + * So invalidating this timeout value. + */ + priv->dequeue_timeout_ns = 0; + + } else if (conf->dequeue_timeout_ns == 0) { + priv->dequeue_timeout_ns = DPAA2_EVENT_PORT_DEQUEUE_TIMEOUT_NS; + } else { + priv->dequeue_timeout_ns = conf->dequeue_timeout_ns; + } + DPAA2_EVENTDEV_DEBUG("Configured eventdev devid=%d", dev->data->dev_id); return 0; @@ -516,7 +529,7 @@ static int dpaa2_eventdev_timeout_ticks(struct rte_eventdev *dev, uint64_t ns, uint64_t *timeout_ticks) { - uint32_t scale = 1; + uint32_t scale = 1000*1000; EVENTDEV_INIT_FUNC_TRACE(); diff --git a/drivers/event/dpaa2/dpaa2_eventdev.h b/drivers/event/dpaa2/dpaa2_eventdev.h index d2f98c6..8898024 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.h +++ b/drivers/event/dpaa2/dpaa2_eventdev.h @@ -21,6 +21,7 @@ #define DPAA2_EVENT_MAX_QUEUES 16 #define DPAA2_EVENT_MIN_DEQUEUE_TIMEOUT 1 #define DPAA2_EVENT_MAX_DEQUEUE_TIMEOUT (UINT32_MAX - 1) +#define DPAA2_EVENT_PORT_DEQUEUE_TIMEOUT_NS 100UL #define DPAA2_EVENT_MAX_QUEUE_FLOWS 2048 #define DPAA2_EVENT_MAX_QUEUE_PRIORITY_LEVELS 8 #define DPAA2_EVENT_MAX_EVENT_PRIORITY_LEVELS 0 From patchwork Fri Sep 21 11:46:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 147246 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp713646ljw; Fri, 21 Sep 2018 04:48:42 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZH/nlXGMt7CdfZZnt19Tn2/HrRjC5GQEYr90lJeYiD3dUc1vPRkQ9FQhjNmfvpmT5jSz4x X-Received: by 2002:a1c:85cb:: with SMTP id h194-v6mr6479746wmd.54.1537530522242; Fri, 21 Sep 2018 04:48:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537530522; cv=none; d=google.com; s=arc-20160816; b=Ju3oxDzk9f2zjaGyIhmyvXncgBICI6KArMrX3bUZsSAZhi3e4phCkXJaKfCI/c845V egRe54kt1gT1v7ZCPAv076KLVpYsrfmP/K0y1QCJZYYUpUn/30LfL5a8sIF4rYp+YW+d Xf/plryTm2FraCJDLVmfu5ZITe+ygouG9j+Ym8XEmleGp970BGUGwi49JxfPKBWsu+5V olx6wrmRYp8OubCoLD0Z8cS0kB0C9axM+uXkYWz/KofkZqdAblE8cH1jHWS0a5PJ4j1h i4ESMEktmmfZJmvnuviICGYY1ERZsxsdunqId313JFohkwRcVpUSKUvgkVtKQN+K2z5I R0Zg== 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=AN2Tcq9fKOjUryhMgwvTdq3Jd1mA6e06DQp29rc6mYo=; b=Ze/jDU2t3rGrKXT7pvw4VjkbMJN60oRBtoCWyOn+ze2KhId4M5aSn1xWXOCncvq8pt isQxrVizbUfysE4DjxJVR4I1aq16h3uxy4KhY7JNXpT3egHnbAY5z4vKS9nI1dlkSLlf BoU1zwpVGhjfcALlhpATeTjZVu7Pcp5rG9TsQJ3qIqOd7kZ9uCa5P+CTtVQg7ADfOY+E mswHL4WBBVgYwYFGT6bh4TDF+Gm327EjGKLMz+taSzOdFzjXgCTZrxWPesZYO1bqtfSg F7qztHOm5qMmjHQtTikeC7OuVbdmUte0UCBXBF/8qIxyeO6p2kaTq7SDrNya5QQvbDep TUsQ== 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 4-v6si452120wrh.71.2018.09.21.04.48.42; Fri, 21 Sep 2018 04:48:42 -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 932964D3A; Fri, 21 Sep 2018 13:48:23 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 099952BD3 for ; Fri, 21 Sep 2018 13:48:17 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id E09471A02CA; Fri, 21 Sep 2018 13:48:16 +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 0B9FF1A02BE; Fri, 21 Sep 2018 13:48:15 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 15DA7402E6; Fri, 21 Sep 2018 19:48:11 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: jerin.jacob@caviumnetworks.com, Hemant Agrawal Date: Fri, 21 Sep 2018 17:16:05 +0530 Message-Id: <1537530366-4722-4-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537530366-4722-1-git-send-email-hemant.agrawal@nxp.com> References: <1535609039-10869-1-git-send-email-hemant.agrawal@nxp.com> <1537530366-4722-1-git-send-email-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 4/5] event/dpaa2: support Max event port value 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 shall be number of available cores. Signed-off-by: Hemant Agrawal --- drivers/event/dpaa2/dpaa2_eventdev.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.7.4 diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index 4b56e2e..456b446 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -293,6 +293,9 @@ dpaa2_eventdev_info_get(struct rte_eventdev *dev, dev_info->max_event_priority_levels = DPAA2_EVENT_MAX_EVENT_PRIORITY_LEVELS; dev_info->max_event_ports = rte_fslmc_get_device_count(DPAA2_IO); + /* we only support dpio upto number of cores*/ + if (dev_info->max_event_ports > rte_lcore_count()) + dev_info->max_event_ports = rte_lcore_count(); dev_info->max_event_port_dequeue_depth = DPAA2_EVENT_MAX_PORT_DEQUEUE_DEPTH; dev_info->max_event_port_enqueue_depth = From patchwork Fri Sep 21 11:46:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 147248 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp713762ljw; Fri, 21 Sep 2018 04:48:49 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb4bu62zchMywYugPrXFhI1YwEmAkCnSsVrXQOjrBBvK91UD4he2PSY1fcG2gUGT31bt/po X-Received: by 2002:adf:8385:: with SMTP id 5-v6mr24268981wre.13.1537530529656; Fri, 21 Sep 2018 04:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537530529; cv=none; d=google.com; s=arc-20160816; b=eYhcVcHooho/PbujbOCptD9jvnCkUlCCaB3/XA85lwvsAdzIu8XG2+29X39WLwrmmt X9yPi0YbjOqdWLWpPgY+It+/VacfNYXs9weSV9Cb6KGRZOwdSvwEa9bBJwz3ys4ITVEO dU6r0skTaG1iOFwRJB0Ig+0vEiryLMNGC7oq/mOfR5gclI7Q3lD2ukTuLGAqV42xyPKj lPFpWnPGj9L7+DVi2ZyWJB+RhnJDKWciS7N8saeuDRLgA3Etx5RKryGleA39pmLzau79 3pjNBDlrLidYO0nVZWK9GqxmTzdyxgrq4LpG6ujQT35EleIaDqlbKjFlrS5f4togOJb3 y34g== 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=NycAhThmIcfi33DfdFCurfKxOIlpT+1nndfYYbJFxPA=; b=qyAghNOugZxZp0wQz3xCali1M8nVqj+Ci+uFLRw7PZpNnFOn366gwks9uU5/ZlHCgZ /BjWgkeJkDYljID3Rb4qDvbZ3h3j7OxdCvKeh3giRAW6Ae971M8X+tvnDrD9aHRoz/cJ 3pLsLzJd8CBsl2EsT/fAZM07nAYs9tEwDUJo9ZsTon+lGLH3GtfzG6j9vZ8Fsqbf+pbv cD28jShqdiW8rdkP1Q4PsQzYvsd058mAm4yMddtP8ZtgNB20+xZhn7EEQPF/WgRw7hM0 whrmjD5H6bQu/j2oZy7iFH9PE8sJJ+zv8VUNE6Tsm86zW753RsE0wvxnm4H4hy/GyIMq 0BMQ== 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 e67-v6si5653622wmg.44.2018.09.21.04.48.49; Fri, 21 Sep 2018 04:48:49 -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 004884F9B; Fri, 21 Sep 2018 13:48:25 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id C83404CA5 for ; Fri, 21 Sep 2018 13:48:20 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id ABB981A02B4; Fri, 21 Sep 2018 13:48:20 +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 031DE1A02C6; Fri, 21 Sep 2018 13:48:18 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id EF934402F8; Fri, 21 Sep 2018 19:48:12 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: jerin.jacob@caviumnetworks.com, Hemant Agrawal , Sunil Kumar Kori Date: Fri, 21 Sep 2018 17:16:06 +0530 Message-Id: <1537530366-4722-5-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537530366-4722-1-git-send-email-hemant.agrawal@nxp.com> References: <1535609039-10869-1-git-send-email-hemant.agrawal@nxp.com> <1537530366-4722-1-git-send-email-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 5/5] event/dpaa2: affining portal at runtime during I/O 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 restructure the code to have the QBMAN portal affliated at run time for per lcore basis. The device cleanup is also improved. Signed-off-by: Sunil Kumar Kori Signed-off-by: Hemant Agrawal --- v5: fixed a compilation error on x86 drivers/event/dpaa2/dpaa2_eventdev.c | 277 ++++++++++++++++++++++++----------- drivers/event/dpaa2/dpaa2_eventdev.h | 9 ++ 2 files changed, 198 insertions(+), 88 deletions(-) -- 2.7.4 diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index 456b446..24df8d7 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -54,31 +54,60 @@ static uint16_t dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[], uint16_t nb_events) { - struct rte_eventdev *ev_dev = - ((struct dpaa2_io_portal_t *)port)->eventdev; - struct dpaa2_eventdev *priv = ev_dev->data->dev_private; + + struct dpaa2_port *dpaa2_portal = port; + struct dpaa2_dpio_dev *dpio_dev; uint32_t queue_id = ev[0].queue_id; - struct dpaa2_eventq *evq_info = &priv->evq_info[queue_id]; + struct dpaa2_eventq *evq_info; uint32_t fqid; struct qbman_swp *swp; struct qbman_fd fd_arr[MAX_TX_RING_SLOTS]; uint32_t loop, frames_to_send; struct qbman_eq_desc eqdesc[MAX_TX_RING_SLOTS]; uint16_t num_tx = 0; - int ret; - - RTE_SET_USED(port); + int i, n, ret; + uint8_t channel_index; if (unlikely(!DPAA2_PER_LCORE_DPIO)) { + /* Affine current thread context to a qman portal */ ret = dpaa2_affine_qbman_swp(); - if (ret) { + if (ret < 0) { DPAA2_EVENTDEV_ERR("Failure in affining portal"); return 0; } } - + /* todo - dpaa2_portal shall have dpio_dev - no per thread variable */ + dpio_dev = DPAA2_PER_LCORE_DPIO; swp = DPAA2_PER_LCORE_PORTAL; + if (likely(dpaa2_portal->is_port_linked)) + goto skip_linking; + + /* Create mapping between portal and channel to receive packets */ + for (i = 0; i < DPAA2_EVENT_MAX_QUEUES; i++) { + evq_info = &dpaa2_portal->evq_info[i]; + if (!evq_info->event_port) + continue; + + ret = dpio_add_static_dequeue_channel(dpio_dev->dpio, + CMD_PRI_LOW, + dpio_dev->token, + evq_info->dpcon->dpcon_id, + &channel_index); + if (ret < 0) { + DPAA2_EVENTDEV_ERR( + "Static dequeue config failed: err(%d)", ret); + goto err; + } + + qbman_swp_push_set(swp, channel_index, 1); + evq_info->dpcon->channel_index = channel_index; + } + dpaa2_portal->is_port_linked = true; + +skip_linking: + evq_info = &dpaa2_portal->evq_info[queue_id]; + while (nb_events) { frames_to_send = (nb_events >> 3) ? MAX_TX_RING_SLOTS : nb_events; @@ -99,14 +128,14 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[], qbman_eq_desc_set_no_orp(&eqdesc[loop], 0); qbman_eq_desc_set_response(&eqdesc[loop], 0, 0); - if (event->mbuf->seqn) { + if (event->sched_type == RTE_SCHED_TYPE_ATOMIC + && event->mbuf->seqn) { uint8_t dqrr_index = event->mbuf->seqn - 1; qbman_eq_desc_set_dca(&eqdesc[loop], 1, dqrr_index, 0); DPAA2_PER_LCORE_DQRR_SIZE--; - DPAA2_PER_LCORE_DQRR_HELD &= - ~(1 << dqrr_index); + DPAA2_PER_LCORE_DQRR_HELD &= ~(1 << dqrr_index); } memset(&fd_arr[loop], 0, sizeof(struct qbman_fd)); @@ -116,7 +145,7 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[], * to avoid copy */ struct rte_event *ev_temp = rte_malloc(NULL, - sizeof(struct rte_event), 0); + sizeof(struct rte_event), 0); if (!ev_temp) { if (!loop) @@ -143,6 +172,18 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[], } return num_tx; +err: + for (n = 0; n < i; n++) { + evq_info = &dpaa2_portal->evq_info[n]; + if (!evq_info->event_port) + continue; + qbman_swp_push_set(swp, evq_info->dpcon->channel_index, 0); + dpio_remove_static_dequeue_channel(dpio_dev->dpio, 0, + dpio_dev->token, + evq_info->dpcon->dpcon_id); + } + return 0; + } static uint16_t @@ -205,22 +246,53 @@ dpaa2_eventdev_dequeue_burst(void *port, struct rte_event ev[], uint16_t nb_events, uint64_t timeout_ticks) { const struct qbman_result *dq; + struct dpaa2_dpio_dev *dpio_dev = NULL; + struct dpaa2_port *dpaa2_portal = port; + struct dpaa2_eventq *evq_info; struct qbman_swp *swp; const struct qbman_fd *fd; struct dpaa2_queue *rxq; - int num_pkts = 0, ret, i = 0; - - RTE_SET_USED(port); + int num_pkts = 0, ret, i = 0, n; + uint8_t channel_index; if (unlikely(!DPAA2_PER_LCORE_DPIO)) { + /* Affine current thread context to a qman portal */ ret = dpaa2_affine_qbman_swp(); - if (ret) { + if (ret < 0) { DPAA2_EVENTDEV_ERR("Failure in affining portal"); return 0; } } + + dpio_dev = DPAA2_PER_LCORE_DPIO; swp = DPAA2_PER_LCORE_PORTAL; + if (likely(dpaa2_portal->is_port_linked)) + goto skip_linking; + + /* Create mapping between portal and channel to receive packets */ + for (i = 0; i < DPAA2_EVENT_MAX_QUEUES; i++) { + evq_info = &dpaa2_portal->evq_info[i]; + if (!evq_info->event_port) + continue; + + ret = dpio_add_static_dequeue_channel(dpio_dev->dpio, + CMD_PRI_LOW, + dpio_dev->token, + evq_info->dpcon->dpcon_id, + &channel_index); + if (ret < 0) { + DPAA2_EVENTDEV_ERR( + "Static dequeue config failed: err(%d)", ret); + goto err; + } + + qbman_swp_push_set(swp, channel_index, 1); + evq_info->dpcon->channel_index = channel_index; + } + dpaa2_portal->is_port_linked = true; + +skip_linking: /* Check if there are atomic contexts to be released */ while (DPAA2_PER_LCORE_DQRR_SIZE) { if (DPAA2_PER_LCORE_DQRR_HELD & (1 << i)) { @@ -259,6 +331,18 @@ dpaa2_eventdev_dequeue_burst(void *port, struct rte_event ev[], } while (num_pkts < nb_events); return num_pkts; +err: + for (n = 0; n < i; n++) { + evq_info = &dpaa2_portal->evq_info[n]; + if (!evq_info->event_port) + continue; + + qbman_swp_push_set(swp, evq_info->dpcon->channel_index, 0); + dpio_remove_static_dequeue_channel(dpio_dev->dpio, 0, + dpio_dev->token, + evq_info->dpcon->dpcon_id); + } + return 0; } static uint16_t @@ -387,31 +471,39 @@ dpaa2_eventdev_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id, queue_conf->priority = RTE_EVENT_DEV_PRIORITY_NORMAL; } -static void -dpaa2_eventdev_queue_release(struct rte_eventdev *dev, uint8_t queue_id) -{ - EVENTDEV_INIT_FUNC_TRACE(); - - RTE_SET_USED(dev); - RTE_SET_USED(queue_id); -} - static int dpaa2_eventdev_queue_setup(struct rte_eventdev *dev, uint8_t queue_id, const struct rte_event_queue_conf *queue_conf) { struct dpaa2_eventdev *priv = dev->data->dev_private; - struct dpaa2_eventq *evq_info = - &priv->evq_info[queue_id]; + struct dpaa2_eventq *evq_info = &priv->evq_info[queue_id]; EVENTDEV_INIT_FUNC_TRACE(); + switch (queue_conf->schedule_type) { + case RTE_SCHED_TYPE_PARALLEL: + case RTE_SCHED_TYPE_ATOMIC: + break; + case RTE_SCHED_TYPE_ORDERED: + DPAA2_EVENTDEV_ERR("Schedule type is not supported."); + return -1; + } evq_info->event_queue_cfg = queue_conf->event_queue_cfg; + evq_info->event_queue_id = queue_id; return 0; } static void +dpaa2_eventdev_queue_release(struct rte_eventdev *dev, uint8_t queue_id) +{ + EVENTDEV_INIT_FUNC_TRACE(); + + RTE_SET_USED(dev); + RTE_SET_USED(queue_id); +} + +static void dpaa2_eventdev_port_def_conf(struct rte_eventdev *dev, uint8_t port_id, struct rte_event_port_conf *port_conf) { @@ -419,7 +511,6 @@ dpaa2_eventdev_port_def_conf(struct rte_eventdev *dev, uint8_t port_id, RTE_SET_USED(dev); RTE_SET_USED(port_id); - RTE_SET_USED(port_conf); port_conf->new_event_threshold = DPAA2_EVENT_MAX_NUM_EVENTS; @@ -430,56 +521,44 @@ dpaa2_eventdev_port_def_conf(struct rte_eventdev *dev, uint8_t port_id, port_conf->disable_implicit_release = 0; } -static void -dpaa2_eventdev_port_release(void *port) -{ - EVENTDEV_INIT_FUNC_TRACE(); - - RTE_SET_USED(port); -} - static int dpaa2_eventdev_port_setup(struct rte_eventdev *dev, uint8_t port_id, const struct rte_event_port_conf *port_conf) { + char event_port_name[32]; + struct dpaa2_port *portal; + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(port_conf); - if (!dpaa2_io_portal[port_id].dpio_dev) { - dpaa2_io_portal[port_id].dpio_dev = - dpaa2_get_qbman_swp(port_id); - rte_atomic16_inc(&dpaa2_io_portal[port_id].dpio_dev->ref_count); - if (!dpaa2_io_portal[port_id].dpio_dev) - return -1; + sprintf(event_port_name, "event-port-%d", port_id); + portal = rte_malloc(event_port_name, sizeof(struct dpaa2_port), 0); + if (!portal) { + DPAA2_EVENTDEV_ERR("Memory allocation failure"); + return -ENOMEM; } - dpaa2_io_portal[port_id].eventdev = dev; - dev->data->ports[port_id] = &dpaa2_io_portal[port_id]; + memset(portal, 0, sizeof(struct dpaa2_port)); + dev->data->ports[port_id] = portal; return 0; } -static int -dpaa2_eventdev_port_unlink(struct rte_eventdev *dev, void *port, - uint8_t queues[], uint16_t nb_unlinks) +static void +dpaa2_eventdev_port_release(void *port) { - struct dpaa2_eventdev *priv = dev->data->dev_private; - struct dpaa2_io_portal_t *dpaa2_portal = port; - struct dpaa2_eventq *evq_info; - int i; + struct dpaa2_port *portal = port; EVENTDEV_INIT_FUNC_TRACE(); - for (i = 0; i < nb_unlinks; i++) { - evq_info = &priv->evq_info[queues[i]]; - qbman_swp_push_set(dpaa2_portal->dpio_dev->sw_portal, - evq_info->dpcon->channel_index, 0); - dpio_remove_static_dequeue_channel(dpaa2_portal->dpio_dev->dpio, - 0, dpaa2_portal->dpio_dev->token, - evq_info->dpcon->dpcon_id); - } + /* TODO: Cleanup is required when ports are in linked state. */ + if (portal->is_port_linked) + DPAA2_EVENTDEV_WARN("Event port must be unlinked before release"); - return (int)nb_unlinks; + if (portal) + rte_free(portal); + + portal = NULL; } static int @@ -488,46 +567,66 @@ dpaa2_eventdev_port_link(struct rte_eventdev *dev, void *port, uint16_t nb_links) { struct dpaa2_eventdev *priv = dev->data->dev_private; - struct dpaa2_io_portal_t *dpaa2_portal = port; + struct dpaa2_port *dpaa2_portal = port; struct dpaa2_eventq *evq_info; - uint8_t channel_index; - int ret, i, n; + uint16_t i; EVENTDEV_INIT_FUNC_TRACE(); + RTE_SET_USED(priorities); + for (i = 0; i < nb_links; i++) { evq_info = &priv->evq_info[queues[i]]; + memcpy(&dpaa2_portal->evq_info[queues[i]], evq_info, + sizeof(struct dpaa2_eventq)); + dpaa2_portal->evq_info[queues[i]].event_port = port; + dpaa2_portal->num_linked_evq++; + } - ret = dpio_add_static_dequeue_channel( - dpaa2_portal->dpio_dev->dpio, - CMD_PRI_LOW, dpaa2_portal->dpio_dev->token, - evq_info->dpcon->dpcon_id, &channel_index); - if (ret < 0) { - DPAA2_EVENTDEV_ERR( - "Static dequeue config failed: err(%d)", ret); - goto err; - } + return (int)nb_links; +} - qbman_swp_push_set(dpaa2_portal->dpio_dev->sw_portal, - channel_index, 1); - evq_info->dpcon->channel_index = channel_index; - } +static int +dpaa2_eventdev_port_unlink(struct rte_eventdev *dev, void *port, + uint8_t queues[], uint16_t nb_unlinks) +{ + struct dpaa2_port *dpaa2_portal = port; + int i; + struct dpaa2_dpio_dev *dpio_dev = NULL; + struct dpaa2_eventq *evq_info; + struct qbman_swp *swp; - RTE_SET_USED(priorities); + EVENTDEV_INIT_FUNC_TRACE(); - return (int)nb_links; -err: - for (n = 0; n < i; n++) { - evq_info = &priv->evq_info[queues[n]]; - qbman_swp_push_set(dpaa2_portal->dpio_dev->sw_portal, - evq_info->dpcon->channel_index, 0); - dpio_remove_static_dequeue_channel(dpaa2_portal->dpio_dev->dpio, - 0, dpaa2_portal->dpio_dev->token, - evq_info->dpcon->dpcon_id); + RTE_SET_USED(dev); + RTE_SET_USED(queues); + + for (i = 0; i < nb_unlinks; i++) { + evq_info = &dpaa2_portal->evq_info[queues[i]]; + + if (DPAA2_PER_LCORE_DPIO && evq_info->dpcon) { + /* todo dpaa2_portal shall have dpio_dev-no per lcore*/ + dpio_dev = DPAA2_PER_LCORE_DPIO; + swp = DPAA2_PER_LCORE_PORTAL; + + qbman_swp_push_set(swp, + evq_info->dpcon->channel_index, 0); + dpio_remove_static_dequeue_channel(dpio_dev->dpio, 0, + dpio_dev->token, + evq_info->dpcon->dpcon_id); + } + memset(evq_info, 0, sizeof(struct dpaa2_eventq)); + if (dpaa2_portal->num_linked_evq) + dpaa2_portal->num_linked_evq--; } - return ret; + + if (!dpaa2_portal->num_linked_evq) + dpaa2_portal->is_port_linked = false; + + return (int)nb_unlinks; } + static int dpaa2_eventdev_timeout_ticks(struct rte_eventdev *dev, uint64_t ns, uint64_t *timeout_ticks) @@ -806,6 +905,8 @@ dpaa2_eventdev_create(const char *name) priv->max_event_queues++; } while (dpcon_dev && dpci_dev); + RTE_LOG(INFO, PMD, "%s eventdev created\n", name); + return 0; fail: return -EFAULT; diff --git a/drivers/event/dpaa2/dpaa2_eventdev.h b/drivers/event/dpaa2/dpaa2_eventdev.h index 8898024..720e0c6 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.h +++ b/drivers/event/dpaa2/dpaa2_eventdev.h @@ -62,11 +62,20 @@ struct dpaa2_eventq { struct dpaa2_dpcon_dev *dpcon; /* Attached DPCI device */ struct dpaa2_dpci_dev *dpci; + /* Mapped event port */ + struct dpaa2_io_portal_t *event_port; /* Configuration provided by the user */ uint32_t event_queue_cfg; uint32_t event_queue_id; }; +struct dpaa2_port { + struct dpaa2_eventq evq_info[DPAA2_EVENT_MAX_QUEUES]; + uint8_t num_linked_evq; + uint8_t is_port_linked; + uint64_t timeout_us; +}; + struct dpaa2_eventdev { struct dpaa2_eventq evq_info[DPAA2_EVENT_MAX_QUEUES]; uint32_t dequeue_timeout_ns;