From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0056.outbound.protection.outlook.com [104.47.0.56]) by dpdk.org (Postfix) with ESMTP id E3A971CA0D for ; Thu, 5 Apr 2018 10:56:28 +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=Jo/TVjWl3ieiKBpAuYLEL5DV7ChkRxVtmxZO+ZfGJbxGLJ2l0x9SoCMbhQdth8UWC33FGZ5cJ/QdNyUi1+Rr9stYjsut7eYKO/WhpaaITKinzRv71lKF9w09gl/nwFIAq0Hd7NeaahFJ7wg9/Vh5oeMJ36nq/NOQVYxf67q6sxI= 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 DB3PR04MB0762.eurprd04.prod.outlook.com (2a01:111:e400:9440::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.631.10; Thu, 5 Apr 2018 08:56:26 +0000 From: Hemant Agrawal To: ferruh.yigit@intel.com Cc: dev@dpdk.org, shreyansh.jain@nxp.com Date: Thu, 5 Apr 2018 14:24:23 +0530 Message-Id: <1522918464-4586-7-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522918464-4586-1-git-send-email-hemant.agrawal@nxp.com> References: <1522918464-4586-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: MA1PR0101CA0043.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::29) To DB3PR04MB0762.eurprd04.prod.outlook.com (2a01:111:e400:9440::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8371a83d-4bff-49ba-5caa-08d59ad31dc7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB3PR04MB0762; X-Microsoft-Exchange-Diagnostics: 1; DB3PR04MB0762; 3:qzc9aLRYVbdI9cUkBqUMUOrMWOtDWEoiWuPtAICXyCzZF6HSdgiCWJnx1xICoFwM2oW5VbATsGeZiWyX5urybg/zq8O5u4ZuWDutbOWnnvGBIWfCtT4KmWM/cbdklrfQgM34kLGXCv8Shq9FGtZ/j4L7uVHY28W6Y7HMZDnq/0lI5o3XAV5G4TLNacUFCjIgzbs+mo9PNeMzhqqbSmLGqAQUDo/xNCdV7HcFuP0q2q2E4Ns3nvIBCsvMfs2JFebX; 25:mjLCDB365vhfCdNjJ6d6+uO0EolYG7VEzJDxFXjSNyQqz7mYAarL+3AmcE0v6kZGHCZdck5oouDCtsGtuOEI0ANUUJWa9y7nZhx4kL9DPrq2SVmqTAZeqYnCSW6h2GlpQZs8ktVCRLs9c7/Jv3DAVRxaUP+KN6mTh6k/71oqBw/UDVTYdOoyG2fX5FeaLPbtW8v46B253802F+DhdntL17VM4d0C6hljVw6b8L5OCsOXvMvwEMsv1UF/6qWqeFzJHdclZEVmVrYyx70YRe5uQewyGR8TLAIRu41puy2OqpFNXNGEahoe0vJTRgAN6aR9F0kCThj6SyOVFRg+QgVxLQ==; 31:bCXrqe2vDxp0U0jnMboY9QVTK1m0gJaq1lwNZAsd8EWQgrRpr7pflInld26Mh+6dnDG2+hoCveOMdAYK6roSF7fM7WJ51D/ZLHicQrViOpmLGYFMJ/A/gbZZiHsac9/C03rkckmY4mWhxQMM9OF0jBkCEBQpaZ/qHyqONQWHI/W1+1pf2rd+nY7Z5GchtpIXzu+NZly8R3EWdT0KbmY/Z8iSDPOeiMpB0waE1MN4ueY= X-MS-TrafficTypeDiagnostic: DB3PR04MB0762: X-Microsoft-Exchange-Diagnostics: 1; DB3PR04MB0762; 20:3q9pcgPsLOEem03x3CDxu2d/qjDP6OuOAyOhMYBAknpcmdu2GvnOwNm3gWkyunh6Kkp7w6UrMHLfncRIUZm5bqpBTO0zq7lFSptxQ5zBSdYN7ZGzGjOMWowg5jCgGR981tBI9YlTSqKo1t/vyMBUAydvLGxPQ/xva15cITP+RR1r2QPuVRrRK4dyILxkPIy3vZQgj1zzno+Y0hKOahWpFMpgFNUV12DxOWehgFHyvmYE8Jl/iCBCv7j5B2aDD2r0PnTI4AiBxQw7OLlhjftF2QNGmQuLS8WjYBeghsLyZI67uwh9y3pLvrwvpw+15xKo64dnGuzo2v3RED18p0i8vLpH1y3qFKDPrlKVK3CITHJiYdsqgSdA5h2dqG0ktfmfL86XnGImn4/H3iUNVy1KBxQcJOKBvUQaqY21cIlgyhx+IX3mdE4m1TBR5U+0pSY3tfM/WQfwMPr4/9+OGK9hnVHNn7Y4ZAxcQO3J2gRoGamh4OO46pidu5DKh5rohR0Q; 4:fEMJCbCd3vCljgvLEK7JxSpQuBFHB6c+Qn6T1lGDem8oRmxPFe6RzFum4gCkZuvO5tmkI7OKO+GjKPkOVBL2mFwkmnUqlkiDIGTyGQAfzYpPiOIN+YIP6Z9WjA732dD3DZ3Bedmd0cj8KvRP8eeT4MNmbEHcAXwm1Zr41sCMZzgJOG77dTspX1z9HFyp/ceDZpkHAf0C3bHFq201kiyudE1ohTcwqYJ6Qpi9ASBTR4HbEfHmPmfMTE8Q4f82vZP1vNERfLoFJGgLcNjHVgvCai+U4n2lQ7LEVFlsZnsOEv+ITYt94M+02YdnZlTpY5Qe 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)(3002001)(3231221)(944501327)(52105095)(93006095)(93001095)(10201501046)(6055026)(6041310)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB3PR04MB0762; BCL:0; PCL:0; RULEID:; SRVR:DB3PR04MB0762; X-Forefront-PRVS: 06339BAE63 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(366004)(376002)(346002)(39860400002)(39380400002)(189003)(199004)(76176011)(81166006)(53936002)(6666003)(2361001)(2351001)(6916009)(25786009)(7736002)(476003)(50226002)(86362001)(81156014)(486006)(97736004)(105586002)(26005)(6512007)(52116002)(3846002)(11346002)(8936002)(446003)(16526019)(106356001)(51416003)(8676002)(386003)(48376002)(6486002)(47776003)(66066001)(68736007)(5660300001)(956004)(55236004)(478600001)(36756003)(6506007)(2906002)(2616005)(5009440100003)(59450400001)(305945005)(4326008)(6116002)(50466002)(186003)(316002)(16586007)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR04MB0762; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB3PR04MB0762; 23:WY3iryc1dc1GRx6fQogl1E5OeKHhUrVtXYK3d0C69?= =?us-ascii?Q?eyLwZ+80i9FJRf44AFw4GG7jub2286Ko+knYMsbhUyZ1xCxUDIlW3u9wFAi/?= =?us-ascii?Q?oMkFV8UbVPsWaZUqQWOKyAuyR/xyjLmDLiyVwI15eVkeVxmEeEZ3KoZb1G20?= =?us-ascii?Q?UZ5iJD+lhFtu+b7p0mykQG+GjkHy3YyiwTO8kE0oJAOFRMqHVrY4Phcv2CUh?= =?us-ascii?Q?lUEEW3Yxeos5UoGSbykz8dv7wvHgXML05yYTqup7iVm7jwJcVtqiqRkRVQff?= =?us-ascii?Q?ZYurgYsuG982+cU9UmW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yrBPprjSOr/A=; 24:kMEPMhbiRDIm38kHCZoQd9MagDi/zxz3l7AcrdqoEMz2TsplCrMKriM63Fq+N0WB0obVpCSKjYX5js8gMv+2dxxT1ciRuca++diYZyaIKkQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB3PR04MB0762; 7:3tkRhf1o9OabTNEZEUW5jnZbzkzqvPLfsv2hbOVcvoh41WfX7eBQc/y2EzlmlC5rjuka1fvJeyBDXJo7/Tk2dpO3cGLnaP+YBO+uycySXeXrVAhAfGB4sOfD2RipCn+Z1uAqbVDhV0M4f1R3KBwOgR+9TFfIBTMuAfKKwak9iBEKCHXcFkazxMU94OkxS7MDhmxN6yWx2b7QE7z7cihW4uR9WYqQ/kUa1FS/j5uL381B9YLFOUhIEpFTjhjrWKT6 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2018 08:56:26.1643 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8371a83d-4bff-49ba-5caa-08d59ad31dc7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR04MB0762 Subject: [dpdk-dev] [PATCH 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: , X-List-Received-Date: Thu, 05 Apr 2018 08:56:29 -0000 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(-) 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, -- 2.7.4