From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0043.outbound.protection.outlook.com [104.47.38.43]) by dpdk.org (Postfix) with ESMTP id 5718D1B1C5 for ; Tue, 9 Jan 2018 14:24:42 +0100 (CET) Received: from BN6PR03CA0004.namprd03.prod.outlook.com (10.168.230.142) by CY1PR03MB2364.namprd03.prod.outlook.com (10.166.207.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Tue, 9 Jan 2018 13:24:41 +0000 Received: from BN1BFFO11FD011.protection.gbl (2a01:111:f400:7c10::1:117) by BN6PR03CA0004.outlook.office365.com (2603:10b6:404:23::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Tue, 9 Jan 2018 13:24:40 +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 BN1BFFO11FD011.mail.protection.outlook.com (10.58.144.74) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:24:10 +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 w09DOAVu017638; Tue, 9 Jan 2018 06:24:38 -0700 From: Hemant Agrawal To: CC: , Date: Tue, 9 Jan 2018 18:53:00 +0530 Message-ID: <1515504186-13587-13-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778501892970; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(396003)(346002)(376002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(16586007)(8936002)(296002)(316002)(104016004)(68736007)(97736004)(305945005)(51416003)(50466002)(48376002)(50226002)(36756003)(54906003)(85426001)(4326008)(8676002)(53936002)(2906002)(81166006)(81156014)(76176011)(2950100002)(47776003)(356003)(106466001)(59450400001)(6916009)(8656006)(5660300001)(6666003)(77096006)(86362001)(105606002)(2351001)(498600001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2364; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD011; 1:kl3h0Xt+pei/Cgl5UvKBqmlsU0cteV5NmzIisqc7KL3zuVB08wiKHwfX3DT5WMNCtIadvZsMBX9+X666tI/APocugxCaCJUXBV17tNh5fx5Z0Jm3OBSQyyczKLI9YOl+ MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d3067f54-1f3e-46c8-1b6a-08d557644497 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CY1PR03MB2364; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2364; 3:1m1Q4bJidtHws+BxE07NADWxBRUtScCnURiCVG9dWcVC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B3rFMjPa9PQfv3OL7PdLMpcM3aDEPeJwlU31u6Me8C2RAV1vdIrx2kFidRgCUEeLTeSbkaorShboYRtSzBAZ6X8psUZeP9QASg4prMTAtEQyMYpAtWlIjBuAa7GKhAAi15f/s+AZSqR+4dBf4g6JaupqgihtVoCE87xUm1WYYgmywFKKHh9uj4eBXHCjWKPUne16eDQ6T8SMGGPd+hcd9rA67nYHUle163Bwm X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3231023)(944510075)(944921075)(946801075)(946901075)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123556025)(20161123563025)(20161123565025)(20161123559100)(20161123561025)(201708071742011); SRVR:CY1PR03MB2364; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR03MB2364; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2364; 23:HuLhq4WsFTA/W87KIYKZq5D++Yai5h3om7YPaduNK?= =?us-ascii?Q?66+e1Omo0FNkETRi0NsbSPNzrejYpfXWobr+XPR3KfEIOBjnbHDo50Typk6W?= =?us-ascii?Q?vBCaQA2fIBJ5o2YoEzuYFbfVpCllBx4hEsTADJRxHEhVzqBgx9HAmheotDkK?= =?us-ascii?Q?RgtSNVDrwBPhf7YpHPOyG+kvR3cMEmdGYQfEVmGAshZlBBnmOoMhdyTz1ZWD?= =?us-ascii?Q?0vZvs9BBS112oAj5fHjE8hLzwttCdiNnp2sfB1PmBIrGG1Hrc/mmDkVY+uhy?= =?us-ascii?Q?CYBrIsupRMRINsQ3mrrNOazLnKAZ7qKe63r1X5epKkL8qAY53G9CkdH5D11/?= =?us-ascii?Q?if0n6BIbqugUpAMepwsnN9NzmMeXKb/41YrzI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5ZRLdhCKUjHEAneeEKDkeSvQcZ7zhs+qEONO4PyYKsJ1PEklnQrnsO3jFSu7i/VNarLF4m1kUH1+ZD2RGTIl7y+eLrLLA07Emy6tqZwt6uVxTKaITeyoPo7AtSULSZPslqgyGFWzhapDnqJRg8aXigN3EaCPfL8T+4vMKZMFpTIU9VLq5R+c9y8mBJbbc7zykBBaQqPg28GEdwafvx9p1xHG6+DeoXXFIU5BLj0hyz29Ge14/29bfZd9xIiBc1J/HOU2Vvow=; 5:5kaGm7Q/KPshydbafck63RWQNVNfV8HgUClXJakBbSAA6o7dq3eCz1/biecOsaVHMgUr/B9BSlNXOMy7zmjLCHcz2oJHfaZyqQhjUJ2EdBNL3YNofLyiLAvF7P0tm6Revexz+ueYW4Lf6DfmnlUdYe73075gly0f3IdqrHxXIXY=; 24:Srj59MhZk2e+TM9PzoQk2IgQjJ9BfSUGPQLrwn5RoLVKEgZcUeAxJMI9QNK8cX4HXT4DsMmG6bA7I9igRnbzJxXlyCfNG2B6E7MXfo77fCQ=; 7:nkCH0JF9qbQAJGVT92NNrkOIlKJUyhWJryFC5MUnqdEVJkHMYV6q0gi8leFju2cisudevAPsguhztp9VMZIYfHgIHrGzdrEfw9qZwvz4Rt/dJIwAlO20gwKR1/nvMu30zkcll5XT/vXbE6RgyxbaCosmwMndt6CXlGqgcHfTI2f8cfOwzQ+ZZvOjQXtk5ALDPUSV9EkJ9bahR59K8XqHT/59mQ3f42p1zD1pFa/v9C+k19DC0+ZnpuJKXeG5AW/x SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:24:10.0176 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d3067f54-1f3e-46c8-1b6a-08d557644497 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: CY1PR03MB2364 Subject: [dpdk-dev] [PATCH v2 12/18] 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: , X-List-Received-Date: Tue, 09 Jan 2018 13:24:42 -0000 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(+) 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; -- 2.7.4