From patchwork Wed Dec 13 12:05:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121751 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5385127qgn; Wed, 13 Dec 2017 04:09:32 -0800 (PST) X-Google-Smtp-Source: ACJfBot3T3gbOpK+osbzCxsD+aOqb+KtrEOt0V5P891XV3cCcajMR4P7g9yl6GMb4yxbDDB08lsE X-Received: by 10.223.153.20 with SMTP id x20mr1963742wrb.219.1513166972475; Wed, 13 Dec 2017 04:09:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513166972; cv=none; d=google.com; s=arc-20160816; b=CdFV8I5KHPX/TNLlG4V9VB0Bw/sduVWtq38sFDAGNKQKg5Sh+/Cm/WqcTSgp+N2V9F lAoA/C3JcS/3o2oncTBa8E5MomBEN3gpbIOw+ebgAz5EK1E9c3MZrVSL4mbcdWIQ4KSz JefIXxQvk+Wu9dtbnbKx+6I3JM0AVVWTpOjciGu21/vemdzPGZ7437yLnJWd+/RGLtdo RWmg3QeYEGfeXl55xMC9+0s1p42jcSPI0R3itpUuFvnE3VQM9T+31rxIskVFdOwpVUEx zxkWBhWHGMjMxbprPr5rJns8hYMF24RMpnOTr7ueAeslyLOXTMMb/b78JGTwS0gIylaN KFbw== 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=bJdV1Foxs8FrIR3CpiLRxuoQa3BNAN6r7Id1qZXh8ro=; b=r9T0ND3SgdtfWE4piaslkqlD5e7RDlQ8DDuJD27Yk58i3u5G3hu66am2pDprTs9EpX PAHfAfzZb6fWLYk4vwBSnHpuxDAMv+tbcrna2P3WUSOdOXSwp/7qDeXN4i/YIVU/r3Tm W3kzE2hKS2whrKJXnxrXBFQ0+/beynanWBKXUO/kHj8PSPLNYZpCL6xjwO5pLHAdFlC/ vp7x2JVh9zOFkGgSA5xuQk0xU2mUvJD8QBP3CI05g4PoaOFyASltqrdrFqSPmqLnWXjJ L05Q90FDCRb6vOOpcsVjddbBacVZxtQ7oV1ObNj0xDDL1DozeJVBl2m/ncxIFTn3d8n5 7dxg== 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 j17si1256055wrb.367.2017.12.13.04.09.32; Wed, 13 Dec 2017 04:09:32 -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 8C28B1B1CE; Wed, 13 Dec 2017 13:07:26 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0067.outbound.protection.outlook.com [104.47.36.67]) by dpdk.org (Postfix) with ESMTP id C41B91B1BD for ; Wed, 13 Dec 2017 13:07:22 +0100 (CET) Received: from MWHPR03CA0014.namprd03.prod.outlook.com (10.175.133.152) by DM5PR03MB2699.namprd03.prod.outlook.com (10.168.197.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 12:07:21 +0000 Received: from BN1BFFO11FD041.protection.gbl (2a01:111:f400:7c10::1:135) by MWHPR03CA0014.outlook.office365.com (2603:10b6:300:117::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 12:07:20 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none; intel.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 BN1BFFO11FD041.mail.protection.outlook.com (10.58.144.104) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Wed, 13 Dec 2017 12:07:13 +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 vBDC6t9X008652; Wed, 13 Dec 2017 05:07:18 -0700 From: Hemant Agrawal To: CC: Date: Wed, 13 Dec 2017 17:35:54 +0530 Message-ID: <1513166759-13466-14-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131576404338362196; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(336005)(39860400002)(346002)(39380400002)(376002)(2980300002)(1109001)(1110001)(339900001)(3190300001)(199004)(189003)(5660300001)(47776003)(104016004)(97736004)(50466002)(498600001)(50226002)(8676002)(4326008)(59450400001)(105606002)(36756003)(48376002)(85426001)(106466001)(53936002)(77096006)(2351001)(51416003)(68736007)(76176011)(6666003)(81156014)(6916009)(316002)(81166006)(2950100002)(8936002)(16586007)(356003)(2906002)(305945005)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2699; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD041; 1:a8AzLUSWa8yjmV2bCjlxMcqHT8bPxuAn/oX09h8yzP54+VLnQGa6CJ3ELm0JDUCD9f/KkFCEZfWHmRn48A5xIyiU1UWA5Kzp4FvugIzRXy5ZiT19vJy3vcuHqnIoYPp1 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4994a872-19df-4d9d-4754-08d542220be0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:DM5PR03MB2699; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2699; 3:4NWfE3+ojI8iemRF+8eg6c3J1sJ7cQeZzE7vEw0rNLqqbUttBYNNC5Nr9dByw2CumoJGIQZDaLuW5DYYrrKx4yj1iNHrinS27CVBSkgkgbxN65iX80S2zVsKDDoFZWWPsz/YmfHD2WGxnp1wZZ231NvBxs+vPwcWzTgYGxch+4tGL2W2HahwFoUvX1bbc9OttI3hObrEtpbui3goEFmPNni3qw858/y434akRgLEDjJYxwZp5jynSVGMUsIR0X+OZEnVDIk8kdhm2uY4vGIATJlnukkCR1pWVvwCLCc/aIqG3ll/7dEsFc9ExRymX5/BTeQcpU+9/S1ASIlXY03A4tr+1Xzbuzh2O8PabltPdrE=; 25:jKFy7vA1rjDP1XOV7V4NAt2AggFkst2ZcUcM0RkYRkuLAHURKOkV4Jnu4PihoKSFS192shvwhHlpw7xMtK2JtYcc5/KsKYeSTtLMWmT3J8GptEzUxRioypdx9vyNIQxOOTL+H+4SdkICRPri+dQ8qXP1ucm6qMnPd6roVvrfCKA9wkiAiZmhj4Hh6VAA9Q6JEVb6oTpz1g3M5Lsgq2CUw6INmouhwZk1ps6GcmaGDsc2iV4mWX4MWx/pxkkSKt9eH/aDlWkz9qfQZbW+h7R3dWThK/tHJp8WWpQ6/LM/7tEwf9gt3GaRwf7iI06KXVbcAfOuGEWcIvDow9XbZQI9sA== X-MS-TrafficTypeDiagnostic: DM5PR03MB2699: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2699; 31:J52gWVv0jIdATH2wtyoWFlSOa4I4ia6BfZsmCCj68mmY/Acl407V91KBLd8RIHyzqdTki0nAz0x9bS5m7Cfm4hWm3ORtYg+rqvRFVdTpdejjTS2ct7Ui+k/p1xUKniq16LOBdJ92U/1cVPpsFKhCVEozJ37ZH67lWhsnBHaSGDH640mOGL1BZwELnI4GkB3X88XVo3HwLwquexRgUwU0RfWiLz3ordmZTCtl6hRY6OY=; 4:krm03hxJHbV+doM4bQnHYhmrXlz+ExCIqrnpXp/et87LAcUsxD/tGyUt5ZXRbkhBq23zeKqi3HVjEAgL33vrbTtC3yzyqlLTjf0fEEJsIyoD83aSDvmTNvbMSZI3WeT0T6r+431LOkUCPKHZOP2XuPZbfRE2lmmZbpIMymgHctfHi/wtukpgBIXT6QuJMc6Cs4MXwwMJp/r1lQaxezgAc1DxvCuskVhTptc47ZFnqB9jfg37u5FkzF4w7wCJorsS1OId2LWBgA6LHHuixULq5n2aLqmMBUUcdsgBa6nt+NDbMzuoEqLZ4aWynjt1UH7O 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)(3231023)(10201501046)(93006095)(93001095)(3002001)(6055026)(6096035)(20161123561025)(20161123565025)(20161123559100)(20161123556025)(20161123563025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(201708071742011); SRVR:DM5PR03MB2699; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:DM5PR03MB2699; X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2699; 23:pvs9ec2g+dPJiTjRMFGFRgwPQKSLzkI//x33LCCky?= t0aoXACy9z7BgEdCebpmSpW4yVM0PaAe4k3KT1BfYanDfzJrspGGPvFbvsoYOrXvzYBg1TP184roBA4EJ2J0gqxAbKmFt5H70QA4Zxdc2OG0yYvIVtRI0VbA6CCQkpo6f/QLXGWgdes2lZ+RY4Sn+P9mZqhBgcm+ss0RnP0mZQ2fjG4gOJzo5C+IosNfLLzuwHi9CxeLM7sbQoALDQ0jIYld4XoCTdpOU80oj8fiFi7o5kybxkiALp52/LRk+W3jXOG+Us0fuWoesgeLzGwOdgzvGVOeRtwQ7QLWMqyOf8oDZLyU120umFqjbRmoBPh+T3yG3j+ICVOYNOVK61yZq59exrcjU46Y8cl2SCM/040tJptpxocoBrZcyYLLnLhZF0WgXVr/8tY0KZ9fX5JH9RXjTExvnuUlCwaX49ECqj8jlfIHj3ZyfoRbaqBXH2libjpzX2KV75RbWZ/cBFXd7u6cO3QDXuqeie23ao2TYlN28boSOhrovI+6qPEohIuQeEhIIqEZ9GjkQa4K+Vb/V90jXn12rZbgh80FxJ5GXxnVb+x745utoFqpNut37TO3HDa/jDD8bRjl5Tl8imyBb71P2HrF1ZQ/x0lIcOsriiNXuEs3KwqzswipBDHmhL4xRrukF1ykvRmxB/35TT2/lB7WZumJMwT93HzwnJDenRlG9ZC7K+JOl/DWp6vsXjPfsFR58DORUQ0t6Q0F2TbHbyel/bFxrV6t8J2mW4r8C3HABXq/U+RQaiGvmjU1FC6jCQdWK5IvwvlLRX496VtextmcS/O0jEZnKfjhR85ucnK+JmDgAcRWFVuK0xZllaPGmKRHn0B6H28J9rbCZAzfqO8YfO/gbUw0wf5tGZ/STDg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vHtZxFB0+/C+Q65+px3ecRzrRvJoU1w6NCW3PLG+2sVnsSXuJR3tDeufde SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 12:07:13.6646 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4994a872-19df-4d9d-4754-08d542220be0 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: DM5PR03MB2699 Subject: [dpdk-dev] [PATCH 13/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 6ae4bb3..b2f82a3 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -1750,6 +1750,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 c5aef2d..9090b63 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -1649,6 +1649,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;