From patchwork Tue Jan 9 13:23:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123950 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4020681qgn; Tue, 9 Jan 2018 05:26:31 -0800 (PST) X-Google-Smtp-Source: ACJfBotsOggSSnxya5Ior+iyBDR8uP8KLRGLu3LxhoFgSEjea0xlXkq2KWiiE/skfvGertBhCock X-Received: by 10.223.169.38 with SMTP id u35mr9443623wrc.57.1515504391141; Tue, 09 Jan 2018 05:26:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504391; cv=none; d=google.com; s=arc-20160816; b=PIFKRwANE5t8M/zMX7ECWfeShmgbDbH3yCo3aW/Gs776fo6crQjUUsuTAw87JV8F/q yuO4+XXhmj6NNpoQ7BbRFMpg9to0WtbkWZjcE0tFvEBZJMUIQG6PwOH3hrjaFSTYcjfN uJLOTFJJY8zIsiX8YGzK4vUBuDfTERwq60b8uYAPUZ3AlCwo5VIV9Nwj2XPwenQXAxuB Fan+CUNAz78zkSjrfJuiw/j8Dc58K+de9ixxiRXzmkQn+AptbnxqGUlMNA26kc6ZzFVO mQA0Nzx2l2szmnWhbalg35TdsryqBSVdMfgrasD05oGoJr3LT8goPimIOs2As8us0Byh vsjg== 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=XvK/UWzB8ms0yFUM0OAPFNzGYPL1KyCuECAA98lQz4s1mXYx+EhlZ7Dn+ff+xmuysN 2Ol6G5oCCBreSvuwA9+XRQNOuDCKk9F/gMsa5seY6RXwFAJSBDkTSGCHHqemOJfkpVwe vfyQolfWo28k8xUNtklWCJ3qSKUL36uAyHfNksnNJZC+tOh9oduARQVbpbfiAt8hZA3m LPFpgMF0KB5qMeOyqqAcD4cA9VfJs4r0RNX9+xWI3itJUW6Ipt6bvcpUnesFCO5OE3qy k6YEcgJizy/r+0TgmfjciG966sU+XjI8knIdYepJP+eH/xAoBDDLVN9BjAV/q91T+NQD fsDg== 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 r60si2646250wrb.135.2018.01.09.05.26.30; Tue, 09 Jan 2018 05:26:31 -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 D33571B21E; Tue, 9 Jan 2018 14:24:43 +0100 (CET) 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 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+BxE07NADWxBRUtScCnURiCVG9dWcVCja68NzLco++PWIK+nGx2ouCIFY8lBL9Ixw9tPqQM6zkJEFWYZC4HkP/tnsdhr1bnRuwlLPGU8OlvsoulvQyLhFJaJhCHavpf1i0ZWm96tDheHINA3TARb/zAJA3tsnYKIB5aDtVzRBxBBjJbbDtPLzxnTyCZDYERHuOPuhMN/1jWTanYCYgrW0Q8Tu3jkQkhhmctGFMZlEHOnjXXbvCjeWkvpvIrVqy6GwBv1cGFgfWXzCK/74DAObP2aZy7xjI2CTROUWrY7uvC0c1fyGshXp47+9jcjuFcMUZq7BiHaMCM/JIxtAG4nMT83mcFAtw=; 25:/yAb/ZlRWT+6eKBbbTa0zINlyvAsn2n5pH4A4Pt0O8Hucq1S8Ps4Gsr7kdU+pH/tJOm0G0b1SF/H9j4L9TuNd/j+YvODp8pDtJeNhk+aKbpSd/VeVERNVA7NgdONG6AgM7+0eNCdaRhkLPZj/0LBPlpYsj8ruqU+4UJT4d9S1UE0tYiUEeG7161qyY28Xf/+XpIGXgeR3K/afnGZKYHm3BpPZ6HHRBPDyCiTKYLFfRZpq3CFiYOlZph4woSXQWAaU9KwoTN8+ckwf+0UScPldzpVQvbmzGb02shPT7lVSZKQfVZWtU6ly8p7/hAtDjukcsms4Z75UJOvy9GNIqi2Vw== X-MS-TrafficTypeDiagnostic: CY1PR03MB2364: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2364; 31:LAMlzO6kZjxuZLgnr47UgLltJeYT4hHzBXq3P5vsBgkinHC5gc827ucTez25BkXS2/3kNS4DUFDSVWGxtn2KTNL6OMwA6Rae3wF4/3Ve2zxd7tPjSMAW4bgBu/cPHWzFkTS0iqEQnSlkrnJ1CDPWRtIQNTBuV05P8JKSOmO9BMMItUXuREM6MHl976e1RoJUFQkx5ussr7R7rs1ZMhFDJWO1t5gWyNLkx00TGGijrkM=; 4:Hl5hUJjhZZtVj8bOd2v9FGu00YHWtdYxlroFvaN955fXIo2j9Wb/ltBSZOfWMhuhdPdOs0+qvoBKMENglYixtBGRqtlB3rFMjPa9PQfv3OL7PdLMpcM3aDEPeJwlU31u6Me8C2RAV1vdIrx2kFidRgCUEeLTeSbkaorShboYRtSzBAZ6X8psUZeP9QASg4prMTAtEQyMYpAtWlIjBuAa7GKhAAi15f/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?= 66+e1Omo0FNkETRi0NsbSPNzrejYpfXWobr+XPR3KfEIOBjnbHDo50Typk6WvBCaQA2fIBJ5o2YoEzuYFbfVpCllBx4hEsTADJRxHEhVzqBgx9HAmheotDkKRgtSNVDrwBPhf7YpHPOyG+kvR3cMEmdGYQfEVmGAshZlBBnmOoMhdyTz1ZWD0vZvs9BBS112oAj5fHjE8hLzwttCdiNnp2sfB1PmBIrGG1Hrc/mmDkVY+uhyCYBrIsupRMRINsQ3mrrNOazLnKAZ7qKe63r1X5epKkL8qAY53G9CkdH5D11/if0n6BIbqugUpAMepwsnN9NzmMeXKb/41YrzIA0GR1KNYFy2hi8RvvACaCzTCkUUri82aBS3XhfHJRdGdi8F4D0iEinwlhRG42sXf9/gGTwteXpHx8s/YXX4NMZ8hJE1c+JsaA1dcXJBQcrMgMQXiHOAA46smE/JaMD2X8/O4QSlNrlk1RYHpgF1RHXWows9yMD4ChpApo+s9VlYCQhjPhFbEmqShKBFX0k0Ns0AgG+xYJ23kTsaPpbGT2gp0Rq8FURP4PxFoaOktjjbMIA3KT1vaJUhupu831QlCriFOOYX1E9QGyHi897rKJ5crz7ST9URm38Pkvnqrrxc5HSMYlY3jqtPwqYMz2dAVUOQR43DYNfXtcIrjeQigs95hODee8PW0FiKTbN/824TN5cn/QM7FbSHMOrszN8AiaAd3BD2BjsjMc5zTvJxjS+EM39RdZN9x9Ei8PNCf5mCh3lv/wCPetuLviLoRB0uoX09HtMEFzVfuCzNvNi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GzdrEfw9qZwvz4Rt/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: , 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;