From patchwork Mon Apr 9 10:22:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 133017 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp109483ljb; Mon, 9 Apr 2018 03:26:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx48FZo6qWpfNvDaEakjx71xaI9ch492nLH/IIQcHM9JzbdfSb2Q0g9usQ2hR6oVf0C234q3R X-Received: by 10.28.148.129 with SMTP id w123mr16841260wmd.116.1523269615720; Mon, 09 Apr 2018 03:26:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523269615; cv=none; d=google.com; s=arc-20160816; b=ffROJhy3oGRo6/lG+4/VGiHz6XAMIRfJBkiy+o/cZdKD+Tc7pG8LW2cfuwWhsRB8qO G6SPt2j0R6I4UNz/UdRbIzUeGu8nqioXL+sxlLcA28A3FmOJp+h1DeI1i1Kd0LtcHLUi 5jTN2lxmbvpnkthV/SpF/xKZPsEvX+bDPxh4P0AoywxVrfRMdazzRNzgkXvIEbL5/vld L+3aXmJeRYj3JAl2sZHAAcXjiEPDo+i/0IsFAVKNZbzEfptFlOrYv7xFeLo9+Pzpqi8v 2DHA/2X9sX0mNWn2BU+s5myHhRLpp2uuacWCbYQCwUr/p/s0C9NU+MbcEbDTQKbXffqj cfsg== 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:dkim-signature:arc-authentication-results; bh=BkDs9XPh6FRPan5s01WlhaEbkXPYea/YMmvk4tB6vGw=; b=L9Chld61V4jLrs4F9ojDvknIDypieTMPYucR7jhX10O9My2WjE6DSZoAc45twMXnVb w5Velk0LqFphYmhZHUWRBbGnOAfh2vHpCr8f/TERWgYt5UkhphVLASrH4mHmnz2D2Su1 bl0Vd+cQ8hxf4X4cMXxJA0mz19KAhTAQmQuWThy+9nT/HwWjfa1LxVmlp6Z+JNIoyk4a 4y4KcxscKJL8qeN9l9H7EHUwjYRY8OEyEFwptY1u4wCNTTqYQRHJ5KR+EFaZoxGB85+8 1lnQu1dC1OIkF8wPzk2MhjqbY+wS9VbPRrxcl4LqhKOTQMiHZdy10gT2SXlW78blKQzw wFIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=SrJmim9R; 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 d18si24762wri.97.2018.04.09.03.26.55; Mon, 09 Apr 2018 03:26:55 -0700 (PDT) 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; dkim=fail header.i=@nxp.com header.s=selector1 header.b=SrJmim9R; 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 DA1101B7F5; Mon, 9 Apr 2018 12:26:07 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0088.outbound.protection.outlook.com [104.47.1.88]) by dpdk.org (Postfix) with ESMTP id DBD821B7CE; Mon, 9 Apr 2018 12:25:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=BkDs9XPh6FRPan5s01WlhaEbkXPYea/YMmvk4tB6vGw=; b=SrJmim9RZlhk90YRCc1283CAzzKTtH0d80FJ0bOQLwcolJp1MjNRJGXugaOCjVhD7FhgIZ897f/jYLUwBveYM5I12IpzmdDbHB+vIwGEKnaCG8YApsEpN0rS4nEyKdz2jLtAp64VrwnYWdler/nrlJkBRBBKHoxeDkw4O7HhazQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (14.142.187.166) by AM2PR04MB0756.eurprd04.prod.outlook.com (2a01:111:e400:8411::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.653.12; Mon, 9 Apr 2018 10:25:56 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, stable@dpdk.org Date: Mon, 9 Apr 2018 15:52:50 +0530 Message-Id: <1523269371-28799-7-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523269371-28799-1-git-send-email-hemant.agrawal@nxp.com> References: <1522918464-4586-1-git-send-email-hemant.agrawal@nxp.com> <1523269371-28799-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0067.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:d::29) To AM2PR04MB0756.eurprd04.prod.outlook.com (2a01:111:e400:8411::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c844fcd3-dbce-4186-e75c-08d59e044826 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM2PR04MB0756; X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0756; 3:1ik4ihdSGYsvblYyje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ZSAZ2BQ4zUw3e5Fk3unNCt8yN1xpT8vIRkcng0RzQI+X0CVv+vi7gdUSD04wfZxPnpXCLKelqo+vcZz/fX7nG31dARa6w8pSjRYg/MrviSL9ngsBHyoDMi0wIeqHohTul7Pl+BCO39pXi2ppTtmNX4+Cv32Sp/Ianci6OZgB1G88rYogPTwm479kUw0akduCMD87tTCDC/xJ3hfc4MryA6fke5oDcjfJbN6PQlRiFxztohgWAEhYn8bHUl5s0QMtTZdGoKgzIrTQnU3LIVHApgLzhgWqnOIcHdr6udTDJXF7Vboq9R4fNREByIQ2h4/jUHVR15IIP0j7rrYT; 4:2vOwVMOfbBwHyg0a21WpASc/tz+044bfq0P5vpave1cIE0wgnASgmklttKQmsGmnywfh92P/fOb7k1sHaTZaM2JFYCJFXQVRmWdqHJezdL48h88O/ozfadkqqzkzp7hi3RDDQqR0B0ucas0sPenbLk/02Nx2ZcsufuryeNzjA++exKbimREOqdTxKMILSvGw2WcYXjSxutoXlQtc+gtjbQbdpVg6a33mh0hBJPDj0ZMABZ9Q/RlP78OxKmBKXc5xbqoMy+Nykc/oS44+JKaFJWF3yQNiYIGKie2o2ulTXPLYTP0A0wwHV8unyq9wG0zg X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231221)(944501327)(52105095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:AM2PR04MB0756; BCL:0; PCL:0; RULEID:; SRVR:AM2PR04MB0756; X-Forefront-PRVS: 0637FCE711 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(346002)(39380400002)(39860400002)(396003)(366004)(199004)(189003)(36756003)(48376002)(50466002)(8936002)(6486002)(6916009)(81156014)(50226002)(6666003)(81166006)(8676002)(106356001)(68736007)(316002)(16526019)(3846002)(16586007)(2351001)(2361001)(47776003)(2616005)(26005)(6506007)(386003)(59450400001)(55236004)(66066001)(6116002)(305945005)(97736004)(76176011)(7736002)(956004)(52116002)(51416003)(476003)(486006)(53936002)(186003)(2906002)(86362001)(4326008)(6512007)(25786009)(446003)(5660300001)(478600001)(105586002)(5009440100003)(11346002)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR04MB0756; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR04MB0756; 23:K4yL4OXHhex/ECylhqZfXwY4X6HxHSXcQo4N7+JrG?= C9kjIgMa1HC4JyZm5dMzumCNupnRtayqFq7fW5EG2EC/REHTq6nyZAd0APhNrPUl2yBVILluD3DOj67jq7X6ACdfPBsU5QzCdjIwpBiYMDzr4zphNzl11Zuq4l7v6ZFDVQe+VffgUV/YuX2dL4QtQAkjlr4t4hn9EjvqbLW0GYyJ3D+xFTZjnCOW4aT+jcy07F1lS+XiKKpOU9RKpH7NzdNLjMUOqCc5+pinhjjrhWH3DDuaHKrSWoagC5RpMfOqYg53An7iZhS/m4EkP7rluvu91xYrJKIoVxKrKsWwmnyAMCkUTwP9ZsCc7cJLzcvM4EJAe1nbH2+/fd3Z+EhVJdsbMB1kmDUw+Su7X7yFkzDRvx8hJSNeR7B04Q5/T3uwVwMuQR3qAD+uTkKWf1fo5WOyG8GZdDLZ0tFsL9XvMCnbCrRQLTUo3RvLGK6fsYNvw7UnRkJ17ADxMSNuSwbsAhnJzP5tcwAlohIEKqSs+7+af+OlCY/2crxFJQqR3uU2H/+2GvpkU4lOy+TqDTAVEVuQEiZmeZecRU6DUm8iHAisAPY2VMUgaC1GxGMSA3pFzu9NdQ2n1CE1lcEaAejK3kCEO0hdnef1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pYVItjThAiacJU8BodadurzYVmhku2NLt2RwGjfWNqOGshTNdaVI/eWQcpHB8A/qNOrHzY9RaCFClpFwll6Y3bLK6eMsQpGaScLuANDnBFgBQdUcvYIVCgq63F8NzXnxAOpZBPpS9RO6hjHP09L1tCyFrYCqs6FwA7kzW2Ns68sppuUt3mcEu5nF2kNmXXVh/mtT26OToq5mbyQEUxWWrBtBw7ly5qGJYtgaBVFxofs/dMV8HddFGVbQhCQvIufnnREnR6w8ODEa2+2gKtulyf163dW70M80toTNxVFnJzO1/H2xir77YF03nFZBg8ZKPkQzzg==; 5:lxBMVXCPwpGQNwODudp78AqKNJTM3PZ5ScMlakxNb/eNByBM2lolJ49599W8bCQMBLGqQMFMD3eKLkx48F1nzhkZ7ypuKKngkGBcNVV+pXQ0kKrrIIYvrWmuO/MJtIwscVTqlbdmdPbh1pzVD6gnfeB90b5CKMrQg30DyaS20Us=; 24:XDQcVOG60by+3QZ1M2eiM1vNNVJyYALrnFpgGpOecG5oN1+fBL7E1nh497ohZ+7Ci2XYwGEU4d8Eq745n13THFizQcKg7dsvIoRJ1nTXzRU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0756; 7:DoPs6Hab4A1tkOBHWKGMKY0tMUqQYQWFY2appleUv8crwQnDFAGFF0ov60A3IJf1KvCPCaP5domuqS3UsSLWgszTc4QmnbAvlBhSQy16JhmhOIneBbYZmtD50W3f5U9TAZxyDBlCPf4o6oHRpqczHpvSg0anAGtwTQnPClnW8dOtg5cvbyU9SX0Z9KXFbjOTFfcmV1IRam+HJJY620+1g55Nxlr5FXN3utZOEPt1x8YfMuJOVUvMxxJgu+DPvDME X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2018 10:25:56.2547 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c844fcd3-dbce-4186-e75c-08d59e044826 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR04MB0756 Subject: [dpdk-dev] [PATCH v2 7/8] net/dpaa2: fix the implementation of xstats 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" Fixes: 1d6329b2fc1f ("net/dpaa2: support extra stats") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 281483d..eed6dc9 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1115,12 +1115,12 @@ dpaa2_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, union dpni_statistics value[3] = {}; unsigned int i = 0, num = RTE_DIM(dpaa2_xstats_strings); - if (xstats == NULL) - return 0; - if (n < num) return num; + if (xstats == NULL) + return 0; + /* Get Counters from page_0*/ retcode = dpni_get_statistics(dpni, CMD_PRI_LOW, priv->token, 0, 0, &value[0]); @@ -1153,10 +1153,13 @@ dpaa2_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats, static int dpaa2_xstats_get_names(__rte_unused struct rte_eth_dev *dev, struct rte_eth_xstat_name *xstats_names, - __rte_unused unsigned int limit) + unsigned int limit) { unsigned int i, stat_cnt = RTE_DIM(dpaa2_xstats_strings); + if (limit < stat_cnt) + return stat_cnt; + if (xstats_names != NULL) for (i = 0; i < stat_cnt; i++) snprintf(xstats_names[i].name,