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 4B064A318B for ; Fri, 18 Oct 2019 08:21:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 33D0A1C0C1; Fri, 18 Oct 2019 08:21:21 +0200 (CEST) Received: from mail-il1-f196.google.com (mail-il1-f196.google.com [209.85.166.196]) by dpdk.org (Postfix) with ESMTP id DB5201C035 for ; Fri, 18 Oct 2019 08:21:19 +0200 (CEST) Received: by mail-il1-f196.google.com with SMTP id o18so4482017ilo.9 for ; Thu, 17 Oct 2019 23:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=u3ZXlheWheLezoJPAIpsfqy72ApV0CCxRFLuol4EnX4=; b=AAekNiN1cNmpd4wFimgw0fpiK0f55LdN0RR3bf8EqkXOi+OufYlc3pGFed0dG4SvrN bo8nf0s+J2fqiNzK9cSQE9s/4TYZQX9RQGloGwWT6u8K9D6xVOAA+TqlDW63cYDHfXTS oQlZhcQEFeBHZa5GHYjeAfnzhvclN1Vjff5O7Bh83vVYJTzf436fVY9RWZLApBGImB8o OTc8RRj1+y3xhAu/XW5z9iS6yuvhufmA7sxg6mMX52ByTAZEa2KXhF79eLdvP4rft8yv CsQEZQyT6+pTrO1FSUXhKX+7nnoqH3U3tITiEl5oZEA0MvgUXzMDvEBJt/LyKFWM0anr rTHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=u3ZXlheWheLezoJPAIpsfqy72ApV0CCxRFLuol4EnX4=; b=p1SCl3y4yiI8cBF4QcHayNLFYKt3bSZCCDix3Wwjsyqe80Z6fSUns/OaM83vOmFruq IY4qIji/Om820rKMQKn9p87YFPP+HyN4FhX5PHrECNxupWDEOF+2asGa9UD9W2RNXcnL H2RSMzRFDu8bIjS5B3D1eRYqtCi8HHLVu+cfDGLQ/LT9eFo411Bv7C+oxnlDl0vlxnC+ lvXC4EYmCGHiczuwlBUP0KJopm805smnp+hZ6lMcw5Hm1lk+JIQCoQlivP8v5ZSqAQJC dgVNPa+Tw840xIhdsJqesICbU6addL/3CYKbQH24ByDeGst484wKCWQSKifipjFxVI+4 8gpw== X-Gm-Message-State: APjAAAVkGkzrU57puSR8FPRirHWhdASyjN74cmPJueIGsiNdAJ3WNywD ZEpPckn0XBecNiIlbtdsyMvufb+OPjUH3syVMPY= X-Google-Smtp-Source: APXvYqxXjZNvTpUkwuXw7VynwM4tdofMe3tC+J2vuXbbzHjvHXZn8cXs75EZbyIIZqffLyAD0W0NMhf/wm549/vz1Ns= X-Received: by 2002:a92:2c03:: with SMTP id t3mr8512202ile.271.1571379678768; Thu, 17 Oct 2019 23:21:18 -0700 (PDT) MIME-Version: 1.0 References: <20191004115725.1915-1-nipun.gupta@nxp.com> <20191017082904.17543-1-nipun.gupta@nxp.com> In-Reply-To: From: Jerin Jacob Date: Fri, 18 Oct 2019 11:51:07 +0530 Message-ID: To: Nipun Gupta Cc: "dev@dpdk.org" , "jerinj@marvell.com" , Hemant Agrawal Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 1/2 v2] 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" On Thu, Oct 17, 2019 at 2:17 PM Nipun Gupta wrote: > > Forgot to add in patch: > > Acked-by: Hemant Agrawal Series applied to dpdk-next-eventdev/master. Thanks. > > > -----Original Message----- > > From: Nipun Gupta > > Sent: Thursday, October 17, 2019 1:59 PM > > To: dev@dpdk.org > > Cc: jerinj@marvell.com; Hemant Agrawal ; > > Nipun Gupta > > Subject: [PATCH 1/2 v2] event/dpaa2: set priority as per the dpcon device > > > > 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(-) > > > > diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h > > b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h > > index 5087f68c6..db6dad544 100644 > > --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h > > +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h > > @@ -185,6 +185,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 2ab34a00f..5db3f9540 100644 > > --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > > +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c > > @@ -3487,13 +3487,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) > > @@ -3503,11 +3504,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 848bb421e..d241643d8 100644 > > --- a/drivers/net/dpaa2/dpaa2_ethdev.c > > +++ b/drivers/net/dpaa2/dpaa2_ethdev.c > > @@ -2006,7 +2006,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; > > @@ -2014,7 +2014,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) > > @@ -2026,11 +2026,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 823f9e97c..95674b26b 100644 > > --- a/drivers/net/dpaa2/dpaa2_ethdev.h > > +++ b/drivers/net/dpaa2/dpaa2_ethdev.h > > @@ -164,7 +164,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, > > -- > > 2.17.1 >