From patchwork Fri Oct 4 11:57:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 175227 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp613686ill; Fri, 4 Oct 2019 05:12:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6OX4+ip6bL/wWAh8TNJEgHOD8sKaHsXXFl8u7OQC//PTNMxwIi3wnG0l8+TiyVNJTc68c X-Received: by 2002:a50:cf8b:: with SMTP id h11mr14110647edk.236.1570191167250; Fri, 04 Oct 2019 05:12:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570191167; cv=none; d=google.com; s=arc-20160816; b=eX4G38bmCact5M7XD1d3q2FDmAhYyJ/DfCf8ICrEChEj2priw8Mqg93Nz6bPxh5st/ iph4XL+H/8tf6iWvuJM51WOrAJPMcX3zYBNAIR6l78uRx+H21dABuuHJvUAZVr1KLQ19 dBLoB19zD0ElL27be2xctjQevAtncNoZr3uDJB/E5AsluDxilE36FfmNT8m/B8Sf9TRS zOhesZ0gbB6Kq6tmYuoL0hYwYXfiLuBxY4yhSG7Z/InugvCZV0ExDPTswPQKHS36SRTa FJgXespTt966XkuTd9xwSjVTru6P0csRAN6dWjNUHN6RZt27cEm0f1xCtvX4Otm/hk69 yVgA== 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=VEVoNVdsI9mV0bB0UL9cd0wHndVSz56MOz9HK9yL1Tk=; b=l0Nb5Grb8+i0FTnUkLQWzpk3CibWSLUJf21M/QtqhHA6sTswGLCFlbyPyt4oHOq3GW btjr3WRhjZUgxPQV8OKxyxMP2Kf14xHpcVZMP2xL48XUiz37t8apDxPc7AXL1B8zYdYA nCz7kmx7OL0W3LzvpU+RoSmhFyRVqvhoZXmg9tCgK3jEm8vpiyRF36+x5fnYvlF221tZ Z0AjBQGlLqbMuf0u5rvdrd76fmW75QfKzuFRuoIz/OVrGeOokl7kWpgpRWzbWNxUGdzv cMteRZ2LQF171XBM0yjKqup0ftEYHeN2Cman9b4EgHIUgVOmOAeTAT6Dsw4ks++wVL40 mF3g== 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 v14si3565436ede.424.2019.10.04.05.12.46; Fri, 04 Oct 2019 05:12:47 -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 10E711C21C; Fri, 4 Oct 2019 14:12:46 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id A1D5E1C217 for ; Fri, 4 Oct 2019 14:12:44 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 287641A0194; Fri, 4 Oct 2019 14:12:44 +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 927B61A00E7; Fri, 4 Oct 2019 14:12:41 +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 460F2402B7; Fri, 4 Oct 2019 20:12:38 +0800 (SGT) From: Nipun Gupta To: dev@dpdk.org Cc: jerinj@marvell.com, hemant.agrawal@nxp.com, Nipun Gupta Date: Fri, 4 Oct 2019 17:27:24 +0530 Message-Id: <20191004115725.1915-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/dpaa2: set priority as per the dpcon device 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 sets the priority of the dpcon dev, such that it is within the supported range of dpcon Signed-off-by: Nipun Gupta --- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 11 +++++++++++ drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 10 +++++++--- drivers/crypto/dpaa2_sec/dpaa2_sec_event.h | 2 +- drivers/event/dpaa2/dpaa2_eventdev.c | 17 ++++++++--------- drivers/event/dpaa2/dpaa2_eventdev.h | 11 ----------- drivers/net/dpaa2/dpaa2_ethdev.c | 11 +++++++---- drivers/net/dpaa2/dpaa2_ethdev.h | 2 +- 7 files changed, 35 insertions(+), 29 deletions(-) -- 2.17.1 Acked-by: Hemant Agrawal diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 4bb6b26c7..3853003cc 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -182,6 +182,17 @@ struct dpaa2_dpci_dev { struct dpaa2_queue tx_queue[DPAA2_DPCI_MAX_QUEUES]; }; +struct dpaa2_dpcon_dev { + TAILQ_ENTRY(dpaa2_dpcon_dev) next; + struct fsl_mc_io dpcon; + uint16_t token; + rte_atomic16_t in_use; + uint32_t dpcon_id; + uint16_t qbman_ch_id; + uint8_t num_priorities; + uint8_t channel_index; +}; + /*! Global MCP list */ extern void *(*rte_mcp_ptr_list); diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 26458e5d1..30cf46170 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -3155,13 +3155,14 @@ dpaa2_sec_process_atomic_event(struct qbman_swp *swp __attribute__((unused)), int dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev, int qp_id, - uint16_t dpcon_id, + struct dpaa2_dpcon_dev *dpcon, const struct rte_event *event) { struct dpaa2_sec_dev_private *priv = dev->data->dev_private; struct fsl_mc_io *dpseci = (struct fsl_mc_io *)priv->hw; struct dpaa2_sec_qp *qp = dev->data->queue_pairs[qp_id]; struct dpseci_rx_queue_cfg cfg; + uint8_t priority; int ret; if (event->sched_type == RTE_SCHED_TYPE_PARALLEL) @@ -3171,11 +3172,14 @@ dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev, else return -EINVAL; + priority = (RTE_EVENT_DEV_PRIORITY_LOWEST / event->priority) * + (dpcon->num_priorities - 1); + memset(&cfg, 0, sizeof(struct dpseci_rx_queue_cfg)); cfg.options = DPSECI_QUEUE_OPT_DEST; cfg.dest_cfg.dest_type = DPSECI_DEST_DPCON; - cfg.dest_cfg.dest_id = dpcon_id; - cfg.dest_cfg.priority = event->priority; + cfg.dest_cfg.dest_id = dpcon->dpcon_id; + cfg.dest_cfg.priority = priority; cfg.options |= DPSECI_QUEUE_OPT_USER_CTX; cfg.user_ctx = (size_t)(qp); diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_event.h b/drivers/crypto/dpaa2_sec/dpaa2_sec_event.h index 977099429..c779d5d83 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_event.h +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_event.h @@ -9,7 +9,7 @@ int dpaa2_sec_eventq_attach(const struct rte_cryptodev *dev, int qp_id, - uint16_t dpcon_id, + struct dpaa2_dpcon_dev *dpcon, const struct rte_event *event); int dpaa2_sec_eventq_detach(const struct rte_cryptodev *dev, diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index 5249d2fe4..56cea5f90 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -688,14 +688,14 @@ dpaa2_eventdev_eth_queue_add_all(const struct rte_eventdev *dev, { struct dpaa2_eventdev *priv = dev->data->dev_private; uint8_t ev_qid = queue_conf->ev.queue_id; - uint16_t dpcon_id = priv->evq_info[ev_qid].dpcon->dpcon_id; + struct dpaa2_dpcon_dev *dpcon = priv->evq_info[ev_qid].dpcon; int i, ret; EVENTDEV_INIT_FUNC_TRACE(); for (i = 0; i < eth_dev->data->nb_rx_queues; i++) { ret = dpaa2_eth_eventq_attach(eth_dev, i, - dpcon_id, queue_conf); + dpcon, queue_conf); if (ret) { DPAA2_EVENTDEV_ERR( "Event queue attach failed: err(%d)", ret); @@ -718,7 +718,7 @@ dpaa2_eventdev_eth_queue_add(const struct rte_eventdev *dev, { struct dpaa2_eventdev *priv = dev->data->dev_private; uint8_t ev_qid = queue_conf->ev.queue_id; - uint16_t dpcon_id = priv->evq_info[ev_qid].dpcon->dpcon_id; + struct dpaa2_dpcon_dev *dpcon = priv->evq_info[ev_qid].dpcon; int ret; EVENTDEV_INIT_FUNC_TRACE(); @@ -728,7 +728,7 @@ dpaa2_eventdev_eth_queue_add(const struct rte_eventdev *dev, eth_dev, queue_conf); ret = dpaa2_eth_eventq_attach(eth_dev, rx_queue_id, - dpcon_id, queue_conf); + dpcon, queue_conf); if (ret) { DPAA2_EVENTDEV_ERR( "Event queue attach failed: err(%d)", ret); @@ -831,14 +831,13 @@ dpaa2_eventdev_crypto_queue_add_all(const struct rte_eventdev *dev, { struct dpaa2_eventdev *priv = dev->data->dev_private; uint8_t ev_qid = ev->queue_id; - uint16_t dpcon_id = priv->evq_info[ev_qid].dpcon->dpcon_id; + struct dpaa2_dpcon_dev *dpcon = priv->evq_info[ev_qid].dpcon; int i, ret; EVENTDEV_INIT_FUNC_TRACE(); for (i = 0; i < cryptodev->data->nb_queue_pairs; i++) { - ret = dpaa2_sec_eventq_attach(cryptodev, i, - dpcon_id, ev); + ret = dpaa2_sec_eventq_attach(cryptodev, i, dpcon, ev); if (ret) { DPAA2_EVENTDEV_ERR("dpaa2_sec_eventq_attach failed: ret %d\n", ret); @@ -861,7 +860,7 @@ dpaa2_eventdev_crypto_queue_add(const struct rte_eventdev *dev, { struct dpaa2_eventdev *priv = dev->data->dev_private; uint8_t ev_qid = ev->queue_id; - uint16_t dpcon_id = priv->evq_info[ev_qid].dpcon->dpcon_id; + struct dpaa2_dpcon_dev *dpcon = priv->evq_info[ev_qid].dpcon; int ret; EVENTDEV_INIT_FUNC_TRACE(); @@ -871,7 +870,7 @@ dpaa2_eventdev_crypto_queue_add(const struct rte_eventdev *dev, cryptodev, ev); ret = dpaa2_sec_eventq_attach(cryptodev, rx_queue_id, - dpcon_id, ev); + dpcon, ev); if (ret) { DPAA2_EVENTDEV_ERR( "dpaa2_sec_eventq_attach failed: ret: %d\n", ret); diff --git a/drivers/event/dpaa2/dpaa2_eventdev.h b/drivers/event/dpaa2/dpaa2_eventdev.h index abc038e49..7c5d00550 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.h +++ b/drivers/event/dpaa2/dpaa2_eventdev.h @@ -52,17 +52,6 @@ enum { * the ethdev to eventdev with DPAA2 devices. */ -struct dpaa2_dpcon_dev { - TAILQ_ENTRY(dpaa2_dpcon_dev) next; - struct fsl_mc_io dpcon; - uint16_t token; - rte_atomic16_t in_use; - uint32_t dpcon_id; - uint16_t qbman_ch_id; - uint8_t num_priorities; - uint8_t channel_index; -}; - struct dpaa2_eventq { /* DPcon device */ struct dpaa2_dpcon_dev *dpcon; diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index dd6a78f9f..7753af53d 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1800,7 +1800,7 @@ dpaa2_dev_rss_hash_conf_get(struct rte_eth_dev *dev, int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev, int eth_rx_queue_id, - uint16_t dpcon_id, + struct dpaa2_dpcon_dev *dpcon, const struct rte_event_eth_rx_adapter_queue_conf *queue_conf) { struct dpaa2_dev_priv *eth_priv = dev->data->dev_private; @@ -1808,7 +1808,7 @@ int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev, struct dpaa2_queue *dpaa2_ethq = eth_priv->rx_vq[eth_rx_queue_id]; uint8_t flow_id = dpaa2_ethq->flow_id; struct dpni_queue cfg; - uint8_t options; + uint8_t options, priority; int ret; if (queue_conf->ev.sched_type == RTE_SCHED_TYPE_PARALLEL) @@ -1820,11 +1820,14 @@ int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev, else return -EINVAL; + priority = (RTE_EVENT_DEV_PRIORITY_LOWEST / queue_conf->ev.priority) * + (dpcon->num_priorities - 1); + memset(&cfg, 0, sizeof(struct dpni_queue)); options = DPNI_QUEUE_OPT_DEST; cfg.destination.type = DPNI_DEST_DPCON; - cfg.destination.id = dpcon_id; - cfg.destination.priority = queue_conf->ev.priority; + cfg.destination.id = dpcon->dpcon_id; + cfg.destination.priority = priority; if (queue_conf->ev.sched_type == RTE_SCHED_TYPE_ATOMIC) { options |= DPNI_QUEUE_OPT_HOLD_ACTIVE; diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index 33b1506aa..9f10d3ad0 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -142,7 +142,7 @@ int dpaa2_attach_bp_list(struct dpaa2_dev_priv *priv, void *blist); int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev, int eth_rx_queue_id, - uint16_t dpcon_id, + struct dpaa2_dpcon_dev *dpcon, const struct rte_event_eth_rx_adapter_queue_conf *queue_conf); int dpaa2_eth_eventq_detach(const struct rte_eth_dev *dev,