From patchwork Fri Dec 8 05:21:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 121123 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp229718qgn; Thu, 7 Dec 2017 21:23:59 -0800 (PST) X-Google-Smtp-Source: AGs4zMZJVMk2s7bhSqrhUTTQ63/8Jfqs3vXqyZl5LLfK1td0K6GjVQfwBWRUSFV7PI0L+18intwa X-Received: by 10.28.29.207 with SMTP id d198mr2850304wmd.106.1512710639456; Thu, 07 Dec 2017 21:23:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512710639; cv=none; d=google.com; s=arc-20160816; b=nzG/UnujDK+fAE+W+EHNa6RWfsFzF61rNmC6wGfm4C89mMdIWsiD4WK/LKSUV7I3fm PJvJEc/GPZ3+eeEtaN1IUmQ3TmkBACiWZ6O0aPK5B5JAFInoPbY6hTnwh/cp3uSay0qK xUjGxkGKXBsVMCLdTspjTMIyOtFKa+Dc436g3furbw9jez5Px2JhdDl9NLgLi6+pmUWd VeTctmftF11Z7ez3FF8ITWR0lqdtXpTOrlSzXz+9TBleH9hRs5GoHCLCnGiIJPO5o0zK lhOHVORx8jrErml8+sFX/1083dx4Djseyu4SFFM+UEwKqwR0vZ6XtV/vKeTDXYkoeIcq 0S1A== 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=JYffbTZwsYl7eStmKmJtPAPVGU9/4y2T4XI76I30xrQ=; b=eD1ngWdFbZsj+au6N3gqfKicWONBierBwKOvP9jsiavKw+jn/vTHvkQn/fnzbP5zlZ lEHMVhfpgbseoUYiGBz5bTrUTCLz3txpIK7ePhneBkyuadLFDCPP9d1A1ottn2jYY5Mj xz/OFSl1U4F+Mv3XuP2/xVMtLprR3I9h8etcxZ5wgG+pVsOshl2yubwr4sQ6kqd1XFs+ rkGywrUJT1JrwyszzfGAHpS9IPv6N7j2+2TR9zQ2npcWa2l4wSjP6NZpzui7wCHvyrue yCS07WqiIMXC37vivV4YdLbbyfUORQTAFrf0RO4fFkLG5tUhMtoH6hADlvjuhq+CZ8cM n9Aw== 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 s26si5304359wrb.63.2017.12.07.21.23.59; Thu, 07 Dec 2017 21:23:59 -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 F0AF31B1B2; Fri, 8 Dec 2017 06:22:44 +0100 (CET) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0059.outbound.protection.outlook.com [104.47.40.59]) by dpdk.org (Postfix) with ESMTP id 5D8211B1A8 for ; Fri, 8 Dec 2017 06:22:43 +0100 (CET) Received: from MWHPR03CA0011.namprd03.prod.outlook.com (10.175.133.149) by MWHPR03MB2702.namprd03.prod.outlook.com (10.168.207.136) 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:42 +0000 Received: from BN1AFFO11FD017.protection.gbl (2a01:111:f400:7c10::164) by MWHPR03CA0011.outlook.office365.com (2603:10b6:300:117::21) 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:42 +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 BN1AFFO11FD017.mail.protection.outlook.com (10.58.52.77) 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:39 +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 vB85MKGf013022; Thu, 7 Dec 2017 22:22:39 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 8 Dec 2017 10:51:21 +0530 Message-ID: <1512710487-32388-9-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: 131571841596016091; (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)(376002)(346002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(48376002)(498600001)(16586007)(51416003)(316002)(81156014)(86362001)(77096006)(50466002)(356003)(50226002)(76176011)(8936002)(54906003)(81166006)(68736007)(8676002)(296002)(6666003)(305945005)(47776003)(104016004)(97736004)(2950100002)(85426001)(2906002)(4326008)(8656006)(106466001)(6916009)(53936002)(33646002)(5660300001)(2351001)(36756003)(105606002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2702; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD017; 1:FriIGXrkSRRywIN+BC3lkNgGDoOBPD5MylSai9pj2TD0GXVIagZtwEuwIfyqhZvwPA8Agnpq9zicBbzErDxbVPMTc0DUGY2F5YkqJFKWeiiRpOqcU/fDpuDMiVR0muqQ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 19e883ec-bbed-4b49-45db-08d53dfbb33d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4628075)(201703131517081)(2017052603307); SRVR:MWHPR03MB2702; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2702; 3:AUBLQm2I4bxlLL9Q909Rzvu2o0MuMKmxH1Rylee7v38KET9leKUFPD3vV55RWJB83HRkftzVkTfW8/PJLgkvHTuJBXwuhY+lroNNg0ZtM4pGmtchvyGNnyACG4CaN4VK4jpipmIACTYYDr1CQAuPTC5xGw2oFr0UKiT0K+ejuiYJZ5vV0gKL9eSwK2infYL/wz27/rlgddm2xu3gJZ5Bvi78/1/Uzx/HCdH8E0YViuoSbIbXNDMDXtgBxM6Cweixmq4RLTelWP3MB3VmIt1IxS/LaNrNXNCoLO/26oTi/xBhCBWYXk+hb8TP0D0uEI+tULspXs5hlyXd2wDR7P+cpFJ0hbCghRQSkhcIr8kaqoY=; 25:RZYl7zwGboryY0ivmDcB221pa8Pm3EY1iOFaYPtGYMucebMIrOMqyRHyoyrfwxJoo4kPJCfP0v+4jWAgNatzU24sfiqUfxtvDxyUjI5RnJZsFgXCDEjwIGFbD4hwri969F8lP/52LqqOwj+DsP8M3agZiPZuYWXAsKXFzsp8T6fPpDIQ6t5pE9ei7cz/L9eaAH45HOduL9bd2uJLiozbeWQv+npKlZuuaZHpCFiZ86HansvZ8e24g7sHznodmaHe+natDl41PLrT9jH01SbabAdrmTFfLodiWzT6JUVjRdPkLJ86XPJFwr7LWCfWuENV8h9hmXJjoD5LaAKFRCFM4w== X-MS-TrafficTypeDiagnostic: MWHPR03MB2702: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2702; 31:Dxm0v6lj5hMuq22NLAcCMXfnzqxkWVxanncZbe0Z6ZxJrh8wzNpwTvt3CAQRiZsEX3ZcZWZSK/xIIo1mQ+tn57XX2KR9YV3/A06Z29uoNEFQ/J8IdauDni/9FOM2DfgVNH/exIomHsUXY7vtdAygLNhCb/4v+BbTVcpCxt+ZhzYn2TfGeou57+UmjuvhYEQ5Wi+5d9dA7z8m2ZH0O7FCovSfy2/UtvU/hWSBRlOF3ag=; 4:OBcm38sE6o5JKRZaHAFuIQSpfvQUM7JqMoTEWfVOIQ1qEjeTed4yj7AcJSYAEXtjhj27qy/kAy8Y5vHrq1MZ1guJHP+hp9W7bdj7LnsVuEmmZYOpOj0A4w2U6vRE/kgD2164jTFc3QdpT/6w+4NmR/vLBaPIi0HxGw9fVx8AHE306UzrycJgRR+oCuxeCZfbwHOYgKdrzBOohGS4zrf2OiUtYYMmOYXdT+GKnBT2b8wmJrsGawIEfDS1hujBIYw6+v2C4CET8mLq0OZVrFUOMSqJ8gE+Fz41VVQduURPVLkPAVzVnwqxFA5AiZb012gfms1K6LS/DrGPs8NV6DSuKriamwiVf36O/KvFsW5jRZA= 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)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231022)(6055026)(6096035)(201703131430075)(201703131520075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123565025)(20161123556025)(20161123561025)(20161123559100)(20161123563025)(201708071742011); SRVR:MWHPR03MB2702; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:MWHPR03MB2702; X-Forefront-PRVS: 0515208626 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2702; 23:Ig7donbYH034b/8EuYs4sdaFuAbB9Wau1pX4jKxWl?= rS+ejvMvcoy302Xj6N9sZdFJ3mSxm+xzsgKmJQnINtUcXNevZtd7iMKrqXhwAyklMIlEoJkTb8bscTJ81PHn4VRQlhsk3/QKFvp2qng0XTEaoDn/yKEoTywI6TEckjD+wQy0dEEV9YNkeZetXfEuYJ5c0l6mzvudA78Ab8kqL9p0K3VvM6wBmEIu0nOwxjydmufnA0h0L+jOaCdKLA6wzqY+RmVXicXQzhtSU+ATx3NoNlWlJDNvI1VJBA5t/Fi+JX0ltM8T4VHW1FFP6XcIN6ds/TooO6+B0c1E27s2xHWScxSOVFHgq5nsgOC03IxodPkZlgU1ZInhaFprfcfMVoWk3q627DP6BZQI1GI8fr52hkMAUFNLugkFlyws0ZSxl4AltlkbPt4xFZaNEnI3Z/W0sowNAy/O/m9xzLhN5T/BJxoAKFr2gOnF7ewakivgpUe2Cw2wbIC2wMZP0MdmN1RN6G2OjqxCeFamV8LawrmehV6qmsnr0u6mfc/r3XDTKjYvN5XSbLmNvjmtwu7TnxDqbMcOr2WCN//EcjgbZYvZ6xKS7l+20pjRcQ5n1lU2TTKws+PyvNvv1e0O1/iD7drInR6xbhgqi1oXqKFZr9tFGgGk5gHGUzEinoSUQFo+4tfMn0v1RU3GaczGQWvy4xZ6OGctMkmEfPQo4DFtrtYf4+HppmroLfnH5mC1PNG4qa9/U8ZN9/ukqK8GSzTqC8nLS/zpASOjo6+noQ5hj6MDSb1FNA7oUPAlL56wGon3evEuZUakvxGPrDWj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DhK/+D2EaItpUJoNKsgZfSopKb1dtWbZN2jzFda2IcDLmKromudOZxa8VZbAa/aH4E5q3TSVadanQZDC7wSU4AnSRToD8O5r3R6aakkmgLrutP5+YTRnYXSj6/88uSR7dIlGERRndPCF6tJeLbZdRKGucJlAQD9q/sQF8IN SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2017 05:22:39.4300 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19e883ec-bbed-4b49-45db-08d53dfbb33d 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: MWHPR03MB2702 Subject: [dpdk-dev] [PATCH 08/14] net/dpaa2: add Rx queue 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/net/dpaa2/dpaa2_ethdev.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 577bd8f..3e89d8d 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -51,6 +51,7 @@ #include #include #include "dpaa2_ethdev.h" +#include struct rte_dpaa2_xstats_name_off { char name[RTE_ETH_XSTATS_NAME_SIZE]; @@ -595,6 +596,37 @@ dpaa2_dev_tx_queue_release(void *q __rte_unused) PMD_INIT_FUNC_TRACE(); } +static uint32_t +dpaa2_dev_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id) +{ + int32_t ret; + struct dpaa2_dev_priv *priv = dev->data->dev_private; + struct dpaa2_queue *dpaa2_q; + struct qbman_swp *swp; + struct qbman_fq_query_np_rslt state; + uint32_t frame_cnt = 0; + + PMD_INIT_FUNC_TRACE(); + + if (unlikely(!DPAA2_PER_LCORE_DPIO)) { + ret = dpaa2_affine_qbman_swp(); + if (ret) { + RTE_LOG(ERR, PMD, "Failure in affining portal\n"); + return -EINVAL; + } + } + swp = DPAA2_PER_LCORE_PORTAL; + + dpaa2_q = (struct dpaa2_queue *)priv->rx_vq[rx_queue_id]; + + if (qbman_fq_query_state(swp, dpaa2_q->fqid, &state) == 0) { + frame_cnt = qbman_fq_state_frame_count(&state); + RTE_LOG(DEBUG, PMD, "RX frame count for q(%d) is %u\n", + rx_queue_id, frame_cnt); + } + return frame_cnt; +} + static const uint32_t * dpaa2_supported_ptypes_get(struct rte_eth_dev *dev) { @@ -1737,6 +1769,7 @@ static struct eth_dev_ops dpaa2_ethdev_ops = { .rx_queue_release = dpaa2_dev_rx_queue_release, .tx_queue_setup = dpaa2_dev_tx_queue_setup, .tx_queue_release = dpaa2_dev_tx_queue_release, + .rx_queue_count = dpaa2_dev_rx_queue_count, .flow_ctrl_get = dpaa2_flow_ctrl_get, .flow_ctrl_set = dpaa2_flow_ctrl_set, .mac_addr_add = dpaa2_dev_add_mac_addr,