From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0059.outbound.protection.outlook.com [104.47.36.59]) by dpdk.org (Postfix) with ESMTP id D63501B19D for ; Fri, 8 Dec 2017 06:22:41 +0100 (CET) Received: from BN3PR03CA0090.namprd03.prod.outlook.com (2a01:111:e400:7a4d::50) by SN2PR03MB2366.namprd03.prod.outlook.com (2603:10b6:804:e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Fri, 8 Dec 2017 05:22:40 +0000 Received: from BY2FFO11FD017.protection.gbl (2a01:111:f400:7c0c::146) by BN3PR03CA0090.outlook.office365.com (2a01:111:e400:7a4d::50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Fri, 8 Dec 2017 05:22: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 BY2FFO11FD017.mail.protection.outlook.com (10.1.14.105) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.282.5 via Frontend Transport; Fri, 8 Dec 2017 05:22:37 +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 vB85MKGe013022; Thu, 7 Dec 2017 22:22:37 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Dec 2017 10:51:20 +0530 Message-ID: <1512710487-32388-8-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1512710487-32388-1-git-send-email-hemant.agrawal@nxp.com> References: <1512710487-32388-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131571841575407832; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(7966004)(336005)(346002)(39380400002)(39860400002)(376002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(86362001)(50226002)(8936002)(6666003)(2950100002)(104016004)(5660300001)(85426001)(8656006)(6916009)(2906002)(68736007)(48376002)(81156014)(33646002)(50466002)(81166006)(51416003)(8676002)(97736004)(77096006)(76176011)(305945005)(16586007)(2351001)(296002)(316002)(356003)(47776003)(53936002)(54906003)(106466001)(4326008)(105606002)(36756003)(498600001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2366; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD017; 1:ZLHii/nk0KVJicVVdxYjUfIWOWbPq91Arb6Tz9vhjXv5wjeugdc2A2X22ONoAWWQMsVkUR/Mwe9VpSgyLRyihd4oX2oHYUrX7VVHI+tKI6BqxKc25+qH4fqsqcpxgcgJ MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4674496f-21a6-44e4-d0d8-08d53dfbb202 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:SN2PR03MB2366; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2366; 3:lmYpY6L7lhGviNpsH3P+rXNUDZaTU1+BmPVbV1vQvAamw3w2Z4Ab9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RRPxQPYvjKh/syPpgSPX8H+098rwAgsXAGfukVtRRuj2ubMyQgjDnPRIDHVLmL0ViQG62JfXgWFCKJyTGbd7YTWKtcJ/iUEC1jbhovwypSIyt+9jIb6DbDPm6e00t8kUFVQii+9VEUJVVpxYlUnrrkVgeISJkFAKT/YCoP6Cv2vnCAMiAUFEvCmsFr/ufB4JcYAqZ19//KJndzAQyq06m5g3rAZqN5mvqmBXqz7ktk4X5N4mzw8mFAujR0SsnPJ/BnKv7g= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3231022)(10201501046)(93006095)(93001095)(3002001)(6055026)(6096035)(20161123565025)(20161123561025)(20161123559100)(20161123556025)(20161123563025)(201703131430075)(201703131520075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(201708071742011); SRVR:SN2PR03MB2366; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:SN2PR03MB2366; X-Forefront-PRVS: 0515208626 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2366; 23:161MfmkggDX+ts9ytftM6KdavFLkLIejqnnI3YE3L?= =?us-ascii?Q?h4EVnGeiZiz2tzw3fEspQU1NGRduJi6HbrBuv8j8Mp2wXJuNu+jn6XB4ZvqF?= =?us-ascii?Q?EOrXW6Ng313/sdfU58zl4qKJoGFQzHxeLmTwc7YC9AEIochomxS7PFIbkVf8?= =?us-ascii?Q?W+uEw0FqJG/oHgAnw7eSZb23LNBx4JbDiut8Vop+6jtA8zNltENXvyUEflmC?= =?us-ascii?Q?A3fqmvHBYPOgtHBbxZNDnhUtytloUx071cmsUWlCfHIAciTfUADswx1AfvgT?= =?us-ascii?Q?tL1aulr7XzCLNc/C8TPmzxEYgElu/VMFx9/u/dy7UeBsZTrUVwYuJjPQL0qY?= =?us-ascii?Q?q3vqcij2R9nHEH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ktGMc1zmPFHqC9zz8l0/nu7kQoI/+i+YZ6zv3fysgLOKLhhXvpqLM5ypMvXCnHkt0KNZE/Dh8Hgyf1EK0f0BlJpiLmEn1WjxPbVMwJZ0bJ1j3gyog0ttT9Ifu4wGa001M6DajNXsYV01ykKRF6ViAdc7f8IMSmT2VChQr21LnT4fQ/oJvcmzjrtVNshDAA8JXd8685orfnz3lhwq6wfVTrpPSuvMWRcjSOKwAW4aHGTu9n7TxFh7o30FEuEZMTS28wLzaNpZRM1KdxMN1juwU6sMWcnHQTsrUTRfw=; 5:2DP0r7FLJI8U+UPZaz0Bu1FRETg5Hrb/KxDFl1QPOexLbr+rzlTa+9aVbpJnshaYM6H4BZOTi3Dxgfq2MSJVw69SQXTwUZrSw74ENJKLOuznFTb7jmMlYSU7sC2+PbnVC+6rM9rdDxjex+kwkY1Cn096euNPGxc1eoTG20xWdkE=; 24:8gCAcGN0pgzRLNxFpmcrAqyuJJZFxuULxd4dyh/xx9qd3qjKRtSG5vpitugKl+HeYIKZii2aMCIWWlSVvGaK9epNTpE+lpy0R7P1NRU+ErI=; 7:lk2UEB5ru3lKc6nYjZoiqQfF4DrstoRK1zSeZEfnAsoJ8cYiI0fl2tSclMkk1cw1oN/+s7UI0IjinNKIdeiGN6i0ePc8e0qUWDNJ1fNnmFjwg9sNrjsDh+JfFGOsIyGjAImkUIJY+8cxIii1Uf92V9tSvCREoe3cEG94gL2qyA368GVoAAkjAUU9Absld62mERW8Qv17GaKDw0X6zu4VywECJK1DteCQ7MaZ5CJHQczrVDH+VJxvxT0ECbzLKHvK SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2017 05:22:37.3379 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4674496f-21a6-44e4-d0d8-08d53dfbb202 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: SN2PR03MB2366 Subject: [dpdk-dev] [PATCH 07/14] bus/fslmc: add qman HW fq query count API 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: Fri, 08 Dec 2017 05:22:42 -0000 This patch add support for rx query debug API. Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/Makefile | 3 +- drivers/bus/fslmc/qbman/include/fsl_qbman_debug.h | 30 +++++++++++ drivers/bus/fslmc/qbman/qbman_debug.c | 66 +++++++++++++++++++++++ drivers/bus/fslmc/rte_bus_fslmc_version.map | 2 + 4 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 drivers/bus/fslmc/qbman/include/fsl_qbman_debug.h create mode 100644 drivers/bus/fslmc/qbman/qbman_debug.c diff --git a/drivers/bus/fslmc/Makefile b/drivers/bus/fslmc/Makefile index c08b2af..7ab39cb 100644 --- a/drivers/bus/fslmc/Makefile +++ b/drivers/bus/fslmc/Makefile @@ -62,7 +62,8 @@ EXPORT_MAP := rte_bus_fslmc_version.map LIBABIVER := 1 SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += \ - qbman/qbman_portal.c + qbman/qbman_portal.c \ + qbman/qbman_debug.c SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += \ mc/dpmng.c \ diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_debug.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_debug.h new file mode 100644 index 0000000..072ad55 --- /dev/null +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_debug.h @@ -0,0 +1,30 @@ +/* Copyright (C) 2015 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: BSD-3-Clause + */ +struct qbman_swp; + +struct qbman_fq_query_np_rslt { +uint8_t verb; + uint8_t rslt; + uint8_t st1; + uint8_t st2; + uint8_t reserved[2]; + uint16_t od1_sfdr; + uint16_t od2_sfdr; + uint16_t od3_sfdr; + uint16_t ra1_sfdr; + uint16_t ra2_sfdr; + uint32_t pfdr_hptr; + uint32_t pfdr_tptr; + uint32_t frm_cnt; + uint32_t byte_cnt; + uint16_t ics_surp; + uint8_t is; + uint8_t reserved2[29]; +}; + +int qbman_fq_query_state(struct qbman_swp *s, uint32_t fqid, + struct qbman_fq_query_np_rslt *r); +uint32_t qbman_fq_state_frame_count(const struct qbman_fq_query_np_rslt *r); +uint32_t qbman_fq_state_byte_count(const struct qbman_fq_query_np_rslt *r); diff --git a/drivers/bus/fslmc/qbman/qbman_debug.c b/drivers/bus/fslmc/qbman/qbman_debug.c new file mode 100644 index 0000000..591673a --- /dev/null +++ b/drivers/bus/fslmc/qbman/qbman_debug.c @@ -0,0 +1,66 @@ +/* Copyright (C) 2015 Freescale Semiconductor, Inc. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "compat.h" +#include +#include "qbman_portal.h" + +/* QBMan portal management command code */ +#define QBMAN_BP_QUERY 0x32 +#define QBMAN_FQ_QUERY 0x44 +#define QBMAN_FQ_QUERY_NP 0x45 +#define QBMAN_WQ_QUERY 0x47 +#define QBMAN_CGR_QUERY 0x51 +#define QBMAN_WRED_QUERY 0x54 +#define QBMAN_CGR_STAT_QUERY 0x55 +#define QBMAN_CGR_STAT_QUERY_CLR 0x56 + +struct qbman_fq_query_desc { + uint8_t verb; + uint8_t reserved[3]; + uint32_t fqid; + uint8_t reserved2[57]; +}; + +int qbman_fq_query_state(struct qbman_swp *s, uint32_t fqid, + struct qbman_fq_query_np_rslt *r) +{ + struct qbman_fq_query_desc *p; + + p = (struct qbman_fq_query_desc *)qbman_swp_mc_start(s); + if (!p) + return -EBUSY; + + p->fqid = fqid; + *r = *(struct qbman_fq_query_np_rslt *)qbman_swp_mc_complete(s, p, + QBMAN_FQ_QUERY_NP); + if (!r) { + pr_err("qbman: Query FQID %d NP fields failed, no response\n", + fqid); + return -EIO; + } + + /* Decode the outcome */ + QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_FQ_QUERY_NP); + + /* Determine success or failure */ + if (r->rslt != QBMAN_MC_RSLT_OK) { + pr_err("Query NP fields of FQID 0x%x failed, code=0x%02x\n", + fqid, r->rslt); + return -EIO; + } + + return 0; +} + +uint32_t qbman_fq_state_frame_count(const struct qbman_fq_query_np_rslt *r) +{ + return (r->frm_cnt & 0x00FFFFFF); +} + +uint32_t qbman_fq_state_byte_count(const struct qbman_fq_query_np_rslt *r) +{ + return r->byte_cnt; +} diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index f266d6d..f59fc67 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -95,5 +95,7 @@ DPDK_18.02 { dpaa2_svr_family; dpaa2_virt_mode; + qbman_fq_query_state; + qbman_fq_state_frame_count; } DPDK_17.11; -- 2.7.4