From patchwork Tue Jul 7 09:22:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 234981 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp740172ilg; Tue, 7 Jul 2020 02:33:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxe7ld2rGvinYv5z3UwtlrAr50B2d13Fs/YMJ2BgsKY97n2Z4IUKRPjq0CGx0jwWLAsECZT X-Received: by 2002:a25:850b:: with SMTP id w11mr82024193ybk.291.1594114390330; Tue, 07 Jul 2020 02:33:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594114390; cv=none; d=google.com; s=arc-20160816; b=mgTizOaQG9vUj2tjy6eQGxYuhnDpAiYRIY82O1EM17QczjaWB/wfAxzfNuvQz/5LF4 BtnWLrJi4XAlC0Yl9WQn+5UdmINfFUdapIFicWqz4aJctHSGBjGVuGNTAgY9eojtORyW vsgwGAqoATQ/rtcp1vmL1vNliZifSqA8H+59z6TcmyzYhu7OhmYNxhjSzr7wvNWk0oyR w5MxmwXSU4A5EB/+Ijnr5g+oB1vujA48GGWMk3jh+S2Volrh4LPA8lnw+tPeU6MfPvUa lm5q9D6L7X1foHzTNc+S3mCP3RtvDJpuloyx4HJLupgTWavc1gkeqgiH+ajKzTp9m8qq 17wA== 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=C0OdTga3G+J7Kj692cPMMv+CmzJwrJuxC38VqEegXdA=; b=JYB5NUZTAiC9SxqIqET5m09lLXkq6wtNBvnTpAeOTVj1os/dvm20VRBIlleAJVBLVB Nybn15qvlkDzvwN74Ee+s5pZs8EdGHhwBBR6eEHsBP7liblMAE7rFbspIKBN6NsnjJHp clW64+HFG75pUIe7O5KuWOg6h61Ec3dA7TKFMDGVRQJ0jWDj6g8ey/4ak7PN+DcBAkNn eZwfCsJabTY4/4Zjh1Lyf4bdjZ1ukL2bbnLNO3p02Mea9a237SwHko2LKLKNRe9WAb99 iDNE99QcSQD8SvcXukv6RYY7mxPZgIs6dSPwql3fmgKL0aowRuFsi8PfLUWKsyPa3bg5 bFRA== 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 b74si14795880ybg.398.2020.07.07.02.33.10; Tue, 07 Jul 2020 02:33:10 -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 74A611DE2F; Tue, 7 Jul 2020 11:27:41 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id F10241DD6E for ; Tue, 7 Jul 2020 11:27:17 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D61532008DD; Tue, 7 Jul 2020 11:27:17 +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 29CB02008E1; Tue, 7 Jul 2020 11:27:16 +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 DC336402F0; Tue, 7 Jul 2020 17:27:13 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Jun Yang Date: Tue, 7 Jul 2020 14:52:43 +0530 Message-Id: <20200707092244.12791-29-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200707092244.12791-1-hemant.agrawal@nxp.com> References: <20200527132326.1382-1-hemant.agrawal@nxp.com> <20200707092244.12791-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 28/29] net/dpaa2: configure per class distribution size 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 TC distribution size is set with dist_queues or nb_rx_queues % dist_queues in order of TC priority. Signed-off-by: Jun Yang --- drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c index d69156bcc..25b1d2bb6 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c @@ -88,7 +88,21 @@ dpaa2_setup_flow_dist(struct rte_eth_dev *eth_dev, struct dpni_rx_dist_cfg tc_cfg; struct dpkg_profile_cfg kg_cfg; void *p_params; - int ret; + int ret, tc_dist_queues; + + /*TC distribution size is set with dist_queues or + * nb_rx_queues % dist_queues in order of TC priority index. + * Calculating dist size for this tc_index:- + */ + tc_dist_queues = eth_dev->data->nb_rx_queues - + tc_index * priv->dist_queues; + if (tc_dist_queues <= 0) { + DPAA2_PMD_INFO("No distribution on TC%d", tc_index); + return 0; + } + + if (tc_dist_queues > priv->dist_queues) + tc_dist_queues = priv->dist_queues; p_params = rte_malloc( NULL, DIST_PARAM_IOVA_SIZE, RTE_CACHE_LINE_SIZE); @@ -109,7 +123,7 @@ dpaa2_setup_flow_dist(struct rte_eth_dev *eth_dev, } tc_cfg.key_cfg_iova = (uint64_t)(DPAA2_VADDR_TO_IOVA(p_params)); - tc_cfg.dist_size = priv->dist_queues; + tc_cfg.dist_size = tc_dist_queues; tc_cfg.enable = true; tc_cfg.tc = tc_index;