From patchwork Fri Sep 21 11:05:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 147230 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp671114ljw; Fri, 21 Sep 2018 04:08:13 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbHPK9DNUGLk670eXs5rHI72Me0dRLcdvVJvtFkwOxnVkP64taAxku1SF9YgYf62Upn+1ID X-Received: by 2002:a1c:c14:: with SMTP id 20-v6mr7013578wmm.117.1537528093589; Fri, 21 Sep 2018 04:08:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537528093; cv=none; d=google.com; s=arc-20160816; b=X0d/U/omZQTIeMPAI6r1UnrGvOv4YZbGwsvcR7xqo2EjE+RwEpVlAQomnrjlc2uIz7 8cq+GI/0PiTv3KQGejKnE2hAInUTPfDOTsyPIG7CcB7RyftLTqr54Qd65tZUBvd1D1Io foRnoa7CXbBZsrd2X0eA+iOWRyC20brUBmi2OtWQze4ZJDSnYhETENnBQ4JOFEiJA4Ty 5GH8m76v34WNu97vetwp1gb1ftWImpuFkAu9FXe37vWBtUG/sSA+nN/2bKOW3VeXZKsy I4W+xzWiCP2VY+HqhNqufKXBFsIETbgx0l48cqzlieChRqRBCGnWhdUHsVZ0W8ypS9Hw d9AA== 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:to:from; bh=23A8U2bevsambgQCtE2cfAU5Mp7K2MzF12/ZbOoOHB8=; b=mXH4IcFpljqjQNBB4EGHRsOwjPKQoca6jSP7WoSjhADPzJ0KXlg7Diu7iPdueAqRHH 87bK0ULPJr8yu7O/7iW6iXufPsUHoiHaZFwGOqf89cu3vSCWlevcQV1OwEVCsUxT4HFh HTOC2YR/q1NjskV8JvPz7/wnLrBN7beQjPSz4SSSMp0VxH6DVECoxzspuqz7U8mC9dSN wx4eRhPpZnOpAntSflzdb0nloVO68QBoWsn1s+dgbAVe3BqUOzl1Y/DXMZoW0SjWzXCe JSpI43KLkpZG5uEYCWoFbQCRibUqGxZOdcLtP5N9ikQz9xTqpas9ul7JqLVgjpz05/Kl rFIg== 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 j7-v6si1627664wmd.131.2018.09.21.04.08.13; Fri, 21 Sep 2018 04:08:13 -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 482B14CC5; Fri, 21 Sep 2018 13:08:10 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 8B1604C9F for ; Fri, 21 Sep 2018 13:08:06 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 4AFA01A02B4; Fri, 21 Sep 2018 13:08:06 +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 6AED91A0039; Fri, 21 Sep 2018 13:08:04 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 2F23C402DD; Fri, 21 Sep 2018 19:08:01 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, thomas@monjalon.net, ferruh.yigit@intel.com Date: Fri, 21 Sep 2018 16:35:50 +0530 Message-Id: <1537527962-25757-2-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537527962-25757-1-git-send-email-hemant.agrawal@nxp.com> References: <1537277516-8876-2-git-send-email-hemant.agrawal@nxp.com> <1537527962-25757-1-git-send-email-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v3 01/13] net/dpaa: configure frame queue on MAC ID basis 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" The current code has the hardcoded seq for fq allocation. It require multiple changes, when some of the interfaces are assigned to kernel stack. Changing it on the mac id basis provide the flexibility to assign any interface to kernel. Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.c | 25 ++++++++++++++----------- drivers/net/dpaa/dpaa_ethdev.h | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 30eff65..b9bd557 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -1011,7 +1011,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, { struct qm_mcc_initfq opts = {0}; int ret; - u32 flags = 0; + u32 flags = QMAN_FQ_FLAG_NO_ENQUEUE; struct qm_mcc_initcgr cgr_opts = { .we_mask = QM_CGR_WE_CS_THRES | QM_CGR_WE_CSTD_EN | @@ -1024,15 +1024,18 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, PMD_INIT_FUNC_TRACE(); - ret = qman_reserve_fqid(fqid); - if (ret) { - DPAA_PMD_ERR("reserve rx fqid 0x%x failed with ret: %d", - fqid, ret); - return -EINVAL; + if (fqid) { + ret = qman_reserve_fqid(fqid); + if (ret) { + DPAA_PMD_ERR("reserve rx fqid 0x%x failed with ret: %d", + fqid, ret); + return -EINVAL; + } + } else { + flags |= QMAN_FQ_FLAG_DYNAMIC_FQID; } - DPAA_PMD_DEBUG("creating rx fq %p, fqid 0x%x", fq, fqid); - ret = qman_create_fq(fqid, QMAN_FQ_FLAG_NO_ENQUEUE, fq); + ret = qman_create_fq(fqid, flags, fq); if (ret) { DPAA_PMD_ERR("create rx fqid 0x%x failed with ret: %d", fqid, ret); @@ -1051,7 +1054,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, if (ret) { DPAA_PMD_WARN( "rx taildrop init fail on rx fqid 0x%x(ret=%d)", - fqid, ret); + fq->fqid, ret); goto without_cgr; } opts.we_mask |= QM_INITFQ_WE_CGID; @@ -1059,7 +1062,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, opts.fqd.fq_ctrl |= QM_FQCTRL_CGE; } without_cgr: - ret = qman_init_fq(fq, flags, &opts); + ret = qman_init_fq(fq, 0, &opts); if (ret) DPAA_PMD_ERR("init rx fqid 0x%x failed with ret:%d", fqid, ret); return ret; @@ -1212,7 +1215,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) if (default_q) fqid = cfg->rx_def; else - fqid = DPAA_PCD_FQID_START + dpaa_intf->ifid * + fqid = DPAA_PCD_FQID_START + dpaa_intf->fif->mac_idx * DPAA_PCD_FQID_MULTIPLIER + loop; if (dpaa_intf->cgr_rx) diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index c79b9f8..2c38c34 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -63,7 +63,7 @@ #define DPAA_PCD_FQID_START 0x400 #define DPAA_PCD_FQID_MULTIPLIER 0x100 #define DPAA_DEFAULT_NUM_PCD_QUEUES 1 -#define DPAA_MAX_NUM_PCD_QUEUES 32 +#define DPAA_MAX_NUM_PCD_QUEUES 4 #define DPAA_IF_TX_PRIORITY 3 #define DPAA_IF_RX_PRIORITY 0