From patchwork Wed May 27 13:23:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 187266 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1126880ilb; Wed, 27 May 2020 06:34:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpOXWHNtjuRtQZWI40CIoTQKtgJ/Ob50emtYcfO9UM73CSa+t0jGZ8mW5Kq6j8yxIQHjA3 X-Received: by 2002:adf:ec45:: with SMTP id w5mr25609549wrn.96.1590586460466; Wed, 27 May 2020 06:34:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590586460; cv=none; d=google.com; s=arc-20160816; b=NxYWGplF3SmTNIVzdPKLD2avfAVq7pKyoCc1khky8N42hn7BxXmb6Qafyufr+tQGtz zETxYdFooJCXkZwXVkYJhJ09n1HwbOd2wrtZdN5pU+0FG/OeLpI1k4Caj9D1VwH2MF2I Ja2bcJL7LseFh7lKMTLH/5+xuWXzjK3gn2Z3tNuGYwI+4BL1Kf/SlGYLl78lE0mULQBI O7vNUWNl/QcpyvMZlcPaYMcgXP4lWttSZZ9sgi5pK04tSNaJS2QYzxEznyXmrvqwfg3K LBLhyR1ef0RmIBHg/nRXPvVo2wWnZWMyKIcBVDRlzFBAwLMrkBpuNUNzMuJmQKOZZGY3 Z+0A== 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=ByZFrVW33m+QuyjXS3JXbKq+lewi1bPtt/EwzJSBtyz2cqGTf7OQ+25e7lMcz426Jm aFskUl8OpriDsaP8Dxfwql4fmZ1zt3h62XMvCOJANTU2pIdu2tmmZ2A6v5BPdjfuxbGl HgwbF6xeKYBivDLtcq1GzLjU95/p1KtKRQfF6FHDjXZasXufyvzUZvHkb0ZdMpggzTSQ FYONchVDu4iQW+/f99GZC3Qk7P6WhuCjzvjB4U1qZSLHt9BjCDfSirSY2P/EKNjCcnW8 GOkZsMhnmj4VYT5ELdJLCrBHE7MBKSiXFXbYIIxbagBbjjtIvRZe7gZ7wtPiqXGWOHkf GVrw== 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 n10si2897869wrs.120.2020.05.27.06.34.20; Wed, 27 May 2020 06:34:20 -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 147001DB0A; Wed, 27 May 2020 15:27:28 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id CA3451DA59 for ; Wed, 27 May 2020 15:26:47 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id AEA121A07D2; Wed, 27 May 2020 15:26:47 +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 0E4061A07F2; Wed, 27 May 2020 15:26:46 +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 E08794031F; Wed, 27 May 2020 21:26:43 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, ferruh.yigit@intel.com Cc: Jun Yang Date: Wed, 27 May 2020 18:53:25 +0530 Message-Id: <20200527132326.1382-37-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 36/37] 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;