From patchwork Wed Jan 10 10:46:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 124051 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5161607qgn; Wed, 10 Jan 2018 03:36:39 -0800 (PST) X-Google-Smtp-Source: ACJfBovvKmQkOfGJ6XoAH5AIyyzW0qAva80WndrNbQP6mZSGzKOku31Dw/zva3Qm1V58urgX7AUY X-Received: by 10.28.66.89 with SMTP id p86mr13393953wma.98.1515584199059; Wed, 10 Jan 2018 03:36:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515584199; cv=none; d=google.com; s=arc-20160816; b=csvvc2MKT5IhzMmiTUvsteZ8uUwc6fcII4gZjKyZlfbcS8K2hPu5P2vawS14z0W4Ab QYc3yHWcs9s29Q/k/J1wijBClxXCONjmFbmyVgcDkgJ3HBB+QeqA8C9k6/P/ze1utUtv /9tDB3IgfJi9XVA6ZqKAdNBHMrdYoNiVP/sPcAMQ/rUSkShq/GGY92925sroHxutV6HG db30MCHLPA30HrGY/DmGyhb4QhdUpSPiN8lCe5idFqrfOi5yhRguxq8MOVEh+0ZpfSkb KaisPfSIV2RkiXOfWNZdhfcJbsnQ/SF3+vZoL6kR6zq4h24OpGEpWgpzWrrUltZEuz20 /RAg== 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:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=i/aN1DxCet0QcetUBthysoIu5erF+FcjgsLmv3TZa0g=; b=Df+E3pS7JKvm/Rkfv1tguaHDFgo3Wm8tj9a1j1x73//g9zaeqWMxFiYuJwakvxQOqj EXe6atni+rqy2fJEwI2nPgGxoTQ2wz9QMu4l2m6i1y11xtyEDRYTsvdOU5FOq2vaUjWb 4ZDw/9uTvmQ51UBRGc6e/GV/fYTHhCHOY1d78dhcp5yRBRsic2OT3BurG8qS8ifLDTgB 4pTlqurrLwl4Ouh+QbdM5rEsj9O511bB7bOPTzUfRdCO1syLm5lNLliU5siiVxcZI/e5 2A/qfuS1dR0IoR6tbizMAyEvQyjlLuhlA4fjiUOZwEInUEmhMbeKHLKCLd6wO82Iswu5 mWVA== 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 p14si12568914wrd.48.2018.01.10.03.36.38; Wed, 10 Jan 2018 03:36:39 -0800 (PST) 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 E8FC21B1E2; Wed, 10 Jan 2018 12:36:12 +0100 (CET) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0057.outbound.protection.outlook.com [104.47.38.57]) by dpdk.org (Postfix) with ESMTP id 8857B1B1A3 for ; Wed, 10 Jan 2018 11:48:21 +0100 (CET) Received: from BN6PR03CA0021.namprd03.prod.outlook.com (10.168.230.159) by CY4PR03MB2694.namprd03.prod.outlook.com (10.173.43.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 10:48:19 +0000 Received: from BL2FFO11OLC008.protection.gbl (2a01:111:f400:7c09::125) by BN6PR03CA0021.outlook.office365.com (2603:10b6:404:23::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Wed, 10 Jan 2018 10:48:19 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11OLC008.mail.protection.outlook.com (10.173.160.143) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Wed, 10 Jan 2018 10:47:47 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w0AAljSV007124; Wed, 10 Jan 2018 03:48:16 -0700 From: Hemant Agrawal To: CC: , Date: Wed, 10 Jan 2018 16:16:35 +0530 Message-ID: <1515581201-29784-14-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> References: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131600548680862568; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(77096006)(6916009)(51416003)(5660300001)(53936002)(48376002)(305945005)(54906003)(36756003)(296002)(16586007)(356003)(498600001)(2950100002)(76176011)(316002)(59450400001)(50466002)(6666003)(85426001)(106466001)(2351001)(8656006)(97736004)(86362001)(8676002)(8936002)(105606002)(81156014)(50226002)(68736007)(4326008)(104016004)(47776003)(2906002)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2694; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC008; 1:aDOvp9riKMpwvkrLFstYXUKsxQzHr8fEBh6DYJ5xtUHNtjSOspR2pd5g9ObayXIN5J3sRYcE9SDR5Ngq93t8EgH9OM9tAGpw2ZAKAo2/Gyj3eoLH/MnLV+vNgv+dXPci MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7d4a6b17-a388-4df6-8b68-08d5581796d5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CY4PR03MB2694; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2694; 3:unPXthF1GjtU7eKLSj5oqlKmlb7KpjmAEj8zUS8Qd/R3T5KiCJxkocTiWNa6i/VhwmxRcc0p3G7v2lbNCsHOFgFgZmZwpQw2yWOjuika8QLOROvLEiZ2MBchj611wkHD4YLGt9/+D4TwC0hNnItn/aBpldANB++3ThOXP8WpkAbwsaqb8pN3DQYI4ZBImSFsSBxjGxmz71/Xp6M3dp6xOAgqUcBj84YvQuTSNU5MTTrQf8il78Nalpf4Ms2yNCoEfaVJP0TUJm6yblBdR4CKaPurjvKAfYRwP+D/VzBo2xVw+8S3prB/rgZyIPp4GTfw1vGdkkf/d8DzYu4lkxpAZ25x92ci3kDLPJFPtdIrkx0=; 25:RlcxITPFoOcHAMJ75nDyRX9HXRMAAioyqar8I76PguowniLCkcUUhdiXuT52x+zGJtmvkgNNBkDNF5BOtyvczXFwNHIGdHMoSqhdBMFvpjLRezCBCPIAOiJEYeslIfd7d2RIYDwudqn5gLB0O5wEhcw1UTLR1z69tNFkzSdCvqgD4lLJzWvRzkgeAHAGad8YrvmPp6YAz5/tAPl2V1S1Zk//h2cvubzSGF6e85WRrw6zVe/Oo/IvnGiYXOH0wqflbSmagX8oWyIhzvCoDR7AfGNL8Q90VDKR3PdXE1n2jQb6IQDyYWknzX2g3Qmhsstq/VwpKEHfpWo2wbVOwnRgyw== X-MS-TrafficTypeDiagnostic: CY4PR03MB2694: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2694; 31:jn/+D/R3SCT8HcKFqx2idYD+OKHPwGpgRQ/yjyT/p663dSD9aV7wrHmktzlD1gRlFf1HJcINjnDtk9C5SsPQ8YwSFgAXjkeerehbAJeStwJ6dkXstfnpo8JlhVRxTRwKG37iCYc36pU81gSAbl8WIKDUprnSLEyn9mRsbBwHcYQ+lXLye/meBtCi90myY6ywQoahc3T3t0G2AzqX52sEoIANcKfNKWO2EAR95h4Cg0Y=; 4:DD7dCkZtjC2+KAM7OdEhgWcJdiC1m3hZL6vzuhPFtjvjKQp+LlG/4Q0CLFAIUpjCV/4NIcbQCHlhQrJM8dE18ZZDCPeC69Vd4MvdbMgF1g4V7VIWNlftFjn2B1EF9+NGjD6krGvh2Cd8zky5qMlUzNPw2c5ML1cqoDMJVoagPdnDqLc6GMmYofmg5SSa/u5nQ953ZtXTpmx74dEcMc4MvS9wC0EyOmzPgM/XFwHTVsOQO1MgPDQu4xen4d8Z1hR+Ul5a6+pssT5S6yHMHwrN4tRIFTIKYbCiqeV3zFLkTNXArpc8n34HleB4KJmry6fr X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(6055026)(6096035)(20161123556025)(20161123565025)(20161123559100)(20161123561025)(20161123563025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(201708071742011); SRVR:CY4PR03MB2694; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY4PR03MB2694; X-Forefront-PRVS: 0548586081 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2694; 23:nzfUEb//ENxtZfAEil9uL0gzaXMnW2BwOYGFPW2Ms?= 961sg4Afz5bnCZoL+PxRIHCN0eSltBuiGqccbo/GO/k/G+NCMbCvO0RkugfSwxmky0aPxqS6RIBLAmJYKTJbms4H/PXQR1H2u7LM/xr98OP+gsiY8/DROaQwfhtRQIVDoqwI6fKWh4WLsMSc/8lsqUAXuXCzJ8WjZgDIaSYuqCE02DsRv1Fs8nIcDH2AKPZvEYnTJQ2Sk1uJt9ycOkPXvuwAgu2wh+OYmLspbPaCSREloinnS6Ldc/VM+VZHSKYq74KGfDaojW3yaQJfRtGiu9NjkqBL525jeGYjITnEnTXUXpvxvj3MtpfBWnXIarmasJhb5lqilH2UsOlc20Oe6DDp+GfVgztct+HeCRoyp8Z4Rw1++H/LxleB/ZHjzhrAZFknKkWtu/qN3/N3PKmmpieQdSXAjsSd/luYQqff/762RWiUAIGwRqc2exW6sMsEG7pYU2nR9F7T4JJlKUjf0rgy5LVgN7HG7I/a4RWAiyfTIfxtjtUi7LB++gCfHw17teCxprzk00gP08kGXCrtlcad+slTPervgriIrsWpnRvBDDnW5zl6L3E1F2EmC4Ja48WWnI38ZNAH8Ulnln+FDPqXVci44pvv1XD8If3Ie+vvEiXA5uqEBQFp9zM0/8qHjNhnzWTd8jwryRE69mZPvUVmzcbqKMD32OstDVICjpQ7kKR0pcErId/bwXO7wL95m5/9YHtzwND4AtVBURV9AHCgRZ6ev04x0Gm9zBivl8ILkBxt6t1jIixXexmeHWzQ18CMOYhzqRf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Oh9bUycM3qKM3i87tNzrdN5ALVsu5KFwYFs8yZhmjHBwfarMaf6jVFTzmHTUy1jSjL3PhXcigE+qPQlFpMAN56zZjundILElF/i/eq5NN5HBh/Fi4teEle5pjGwt35DhRLiFdCWvMM072w7o0dKIGapDbOTUqUrTSEikW SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 10:47:47.9302 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7d4a6b17-a388-4df6-8b68-08d5581796d5 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2694 Subject: [dpdk-dev] [PATCH v3 13/19] bus/dpaa: query queue frame count support 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" Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman.c | 22 ++++++++++++++++++++++ drivers/bus/dpaa/include/fsl_qman.h | 7 +++++++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 1 + 3 files changed, 30 insertions(+) -- 2.7.4 diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index d8fb25a..ffb008e 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -1722,6 +1722,28 @@ int qman_query_fq_np(struct qman_fq *fq, struct qm_mcr_queryfq_np *np) return 0; } +int qman_query_fq_frm_cnt(struct qman_fq *fq, u32 *frm_cnt) +{ + struct qm_mc_command *mcc; + struct qm_mc_result *mcr; + struct qman_portal *p = get_affine_portal(); + + mcc = qm_mc_start(&p->p); + mcc->queryfq.fqid = cpu_to_be32(fq->fqid); + qm_mc_commit(&p->p, QM_MCC_VERB_QUERYFQ_NP); + while (!(mcr = qm_mc_result(&p->p))) + cpu_relax(); + DPAA_ASSERT((mcr->verb & QM_MCR_VERB_MASK) == QM_MCR_VERB_QUERYFQ_NP); + + if (mcr->result == QM_MCR_RESULT_OK) + *frm_cnt = be24_to_cpu(mcr->queryfq_np.frm_cnt); + else if (mcr->result == QM_MCR_RESULT_ERR_FQID) + return -ERANGE; + else if (mcr->result != QM_MCR_RESULT_OK) + return -EIO; + return 0; +} + int qman_query_wq(u8 query_dedicated, struct qm_mcr_querywq *wq) { struct qm_mc_command *mcc; diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index fc00d8d..d769d50 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1616,6 +1616,13 @@ int qman_query_fq_has_pkts(struct qman_fq *fq); int qman_query_fq_np(struct qman_fq *fq, struct qm_mcr_queryfq_np *np); /** + * qman_query_fq_frmcnt - Queries fq frame count + * @fq: the frame queue object to be queried + * @frm_cnt: number of frames in the queue + */ +int qman_query_fq_frm_cnt(struct qman_fq *fq, u32 *frm_cnt); + +/** * qman_query_wq - Queries work queue lengths * @query_dedicated: If non-zero, query length of WQs in the channel dedicated * to this software portal. Otherwise, query length of WQs in a diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index 4e3afda..212c75f 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -73,6 +73,7 @@ DPDK_18.02 { qman_create_cgr; qman_delete_cgr; qman_modify_cgr; + qman_query_fq_frm_cnt; qman_release_cgrid_range; rte_dpaa_portal_fq_close; rte_dpaa_portal_fq_init;