From patchwork Wed May 27 13:23:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 187262 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1126239ilb; Wed, 27 May 2020 06:33:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytQmS8QsyppraT18HFDP2h3b3NnRCQ3sN0JIQoxjPbv3+xudqqdP+sG6ype6xjBZZbkuSo X-Received: by 2002:a1c:96c3:: with SMTP id y186mr4254404wmd.60.1590586406285; Wed, 27 May 2020 06:33:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590586406; cv=none; d=google.com; s=arc-20160816; b=lHeYL+Vez+ofqfTBzNDXQELH68SRrigZcBUjuIWNspjo5ED9LEhQKeQowXgkv7k7WO 7lCWs2MfRToStLSrcpuD1HPsBODtnASTt0hvKRqOer3onYoUGKVAFmdld5D2GHVGmihO vIJ6xcWSyAcJJylDOTx5p3gV+c2LUddz/mbNaLsyedAAfj+ipA4ydf7bjLWQ0vDRAjLm vLO8c+gotww11BDiPegJozugvT9F992dChp7rx+07A9fIXT89Z17YnF08Tp4c4DxVPct 0IQdo/p2wId1TmfwKEW0Vfoj+3HH9Cm/+AQtYBVj0lBLhu7JT47F51PfQyLuCt2MV7pi rhaQ== 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=ySOi1njfj1DfXxqOCZI6QRmqQQkTfnv7GX24s55LKL8=; b=FZnPc0kI6pePtbociGdiVOiPwaPk45aZzKvYzgNavOi8CzYmHYdo16MQc2m/Yt0veE ZRgz6fKuUG/mo0F229Oxq4uw6oVS/4lMaKU6NBhKBJyFynIHzD48d6ssFRptfWiSnWH2 dVM+nsdUrW0eeALZlUg23ixRrwBa78hXBDbZV2wSogVznHCyuehr9Yu12Q6gFf2nt+4X hmJzAr6nZvQbfUiP7bH7sMXh9SXn5CzyD8imzHZQIvhp4nq2gcNMncUZgmBjjg8nVc7u 2x4mbp7pyZRm1PDO77T6wC+om0sS6WL6w/BwZJcdFpermoUBDEoS/iME6E4ISK8UMlyf iC5g== 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 v3si2613562wmj.168.2020.05.27.06.33.26; Wed, 27 May 2020 06:33:26 -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 6624E1DAD5; Wed, 27 May 2020 15:27:23 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 04AB71DA53 for ; Wed, 27 May 2020 15:26:46 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D4D75200775; Wed, 27 May 2020 15:26:45 +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 323F120077A; Wed, 27 May 2020 15:26:44 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 7FE7B402BF; Wed, 27 May 2020 21:26:41 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, ferruh.yigit@intel.com Cc: Jun Yang Date: Wed, 27 May 2020 18:53:21 +0530 Message-Id: <20200527132326.1382-33-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200527132326.1382-1-hemant.agrawal@nxp.com> References: <20200527132326.1382-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 32/37] net/dpaa2: index of queue action for flow 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" From: Jun Yang Make more sense to use RXQ index for queue distribution instead of flow ID. Signed-off-by: Jun Yang --- drivers/net/dpaa2/dpaa2_flow.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/dpaa2_flow.c b/drivers/net/dpaa2/dpaa2_flow.c index 6f3139f86..76f68b903 100644 --- a/drivers/net/dpaa2/dpaa2_flow.c +++ b/drivers/net/dpaa2/dpaa2_flow.c @@ -56,7 +56,6 @@ struct rte_flow { uint8_t tc_id; /** Traffic Class ID. */ uint8_t tc_index; /** index within this Traffic Class. */ enum rte_flow_action_type action; - uint16_t flow_id; /* Special for IP address to specify the offset * in key/mask. */ @@ -3141,6 +3140,7 @@ dpaa2_generic_flow_set(struct rte_flow *flow, struct dpni_qos_tbl_cfg qos_cfg; struct dpni_fs_action_cfg action; struct dpaa2_dev_priv *priv = dev->data->dev_private; + struct dpaa2_queue *rxq; struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; size_t param; struct rte_flow *curr = LIST_FIRST(&priv->flows); @@ -3244,10 +3244,10 @@ dpaa2_generic_flow_set(struct rte_flow *flow, case RTE_FLOW_ACTION_TYPE_QUEUE: dest_queue = (const struct rte_flow_action_queue *)(actions[j].conf); - flow->flow_id = dest_queue->index; + rxq = priv->rx_vq[dest_queue->index]; flow->action = RTE_FLOW_ACTION_TYPE_QUEUE; memset(&action, 0, sizeof(struct dpni_fs_action_cfg)); - action.flow_id = flow->flow_id; + action.flow_id = rxq->flow_id; if (is_keycfg_configured & DPAA2_QOS_TABLE_RECONFIGURE) { dpaa2_flow_qos_table_extracts_log(priv); if (dpkg_prepare_key_cfg( @@ -3303,8 +3303,6 @@ dpaa2_generic_flow_set(struct rte_flow *flow, } /* Configure QoS table first */ - action.flow_id = action.flow_id % priv->num_rx_tc; - qos_index = flow->tc_id * priv->fs_entries + flow->tc_index; @@ -3407,13 +3405,22 @@ dpaa2_generic_flow_set(struct rte_flow *flow, break; case RTE_FLOW_ACTION_TYPE_RSS: rss_conf = (const struct rte_flow_action_rss *)(actions[j].conf); + if (rss_conf->queue_num > priv->dist_queues) { + DPAA2_PMD_ERR( + "RSS number exceeds the distrbution size"); + return -ENOTSUP; + } + for (i = 0; i < (int)rss_conf->queue_num; i++) { - if (rss_conf->queue[i] < - (attr->group * priv->dist_queues) || - rss_conf->queue[i] >= - ((attr->group + 1) * priv->dist_queues)) { + if (rss_conf->queue[i] >= priv->nb_rx_queues) { + DPAA2_PMD_ERR( + "RSS RXQ number exceeds the total number"); + return -ENOTSUP; + } + rxq = priv->rx_vq[rss_conf->queue[i]]; + if (rxq->tc_index != attr->group) { DPAA2_PMD_ERR( - "Queue/Group combination are not supported\n"); + "RSS RXQ distributed is not in current group"); return -ENOTSUP; } }