From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0085.outbound.protection.outlook.com [104.47.38.85]) by dpdk.org (Postfix) with ESMTP id 769EC5599 for ; Wed, 27 Sep 2017 10:15:54 +0200 (CEST) Received: from BN6PR03CA0015.namprd03.prod.outlook.com (10.168.230.153) 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.77.7; Wed, 27 Sep 2017 08:15:53 +0000 Received: from BL2FFO11FD043.protection.gbl (2a01:111:f400:7c09::186) by BN6PR03CA0015.outlook.office365.com (2603:10b6:404:23::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11 via Frontend Transport; Wed, 27 Sep 2017 08:15:52 +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 BL2FFO11FD043.mail.protection.outlook.com (10.173.161.139) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.56.11 via Frontend Transport; Wed, 27 Sep 2017 08:15:52 +0000 Received: from [10.232.14.39] ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v8R8Fncu004964; Wed, 27 Sep 2017 01:15:50 -0700 From: Shreyansh Jain To: Ferruh Yigit CC: , References: <20170823141213.25476-1-shreyansh.jain@nxp.com> <20170909112132.13936-1-shreyansh.jain@nxp.com> <20170909112132.13936-42-shreyansh.jain@nxp.com> <3332a9da-5e28-260a-68fa-ab665f907403@intel.com> <58ffe1c0-308a-f730-a6d1-9bcf8ddb3d57@nxp.com> Message-ID: <92166552-9ab5-db9a-d7f5-8fb2f4a8a3e7@nxp.com> Date: Wed, 27 Sep 2017 13:56:44 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <58ffe1c0-308a-f730-a6d1-9bcf8ddb3d57@nxp.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131509737523137512; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(7966004)(376002)(346002)(39860400002)(39380400002)(2980300002)(1109001)(1110001)(339900001)(3190300001)(189002)(377454003)(199003)(24454002)(64126003)(8656003)(85426001)(23676002)(65806001)(65956001)(4326008)(229853002)(31686004)(68736007)(54906003)(83506001)(5660300001)(58126008)(93886005)(65826007)(53546010)(104016004)(316002)(86362001)(31696002)(8676002)(53936002)(54356999)(76176999)(2870700001)(50986999)(33646002)(6666003)(189998001)(97736004)(8936002)(47776003)(356003)(81166006)(498600001)(305945005)(6246003)(81156014)(2950100002)(6916009)(50466002)(77096006)(105606002)(106466001)(36756003)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2702; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD043; 1:Wr3FpSTWPENdwwjS8UStpw0QL914DeHpxeOkca2wnL2ipcEMHtiZYQMlV4Z18/u5ahSN5le8hbSJ4ivUwLCiTqsREqJzR9wHjlV12Hl3sCzTdwjj4kcDgiGz0YNZp/Di X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8b728d1a-6a59-4c64-ea87-08d5057ff806 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:MWHPR03MB2702; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2702; 3:1gl3eLanm2Je2HElQHp12kBtWoBjMwH9lZGWhxgtYgS8cV4EbLjVYfrbez80Lj//vT4wecE7dCzy5pQDcZlQ+Is/jTN87IEWujoa1aPC4tUBeJdfn0cR1SjF2IeotlQTVrCEghguJk0lVpRkP52ubWNsuMdMFJWQbqKFUZVgPYwWwtj7VLoGuKFh9Wrly2B5aYUdAUR8te1PpVseoHs6F3Brr00eySNnU1g/NRBkyTz7XNKsoSTW5mhwdxTtUYTvVtYeFEQXXTz2UXJqT4G+fLwa8rA4SIU5N2FceBS0fdTjLL3O81udl1BYJXvAC+3eo0j/FjRxzlDTSjm15odQwKNlysipPpk6ntQVtGUrkWU=; 25:YA8vVkgmTopFvggd2VqG4dA4BBextDKEZ5XoFLgDZGIX1N4VQyzou4FLXPUvyMQdZEZQsOkJs6uDdL/QtDBifP4Vw+svSqqhHj9twa6XoSy1fqw+2GiarVhIEwMF1B2hfsHIr0iN1aBfOUc9vO1jPQ9BbtHrVE3eiCEp9YqwetDd+NQshGpfeTas2lHIvRFyQZofnrbfLyBzBa4K3gJ8XIgvmequR3aaRUe8qK9O1LoxXpqvwydQwEfcxr5fHjojhgKz2GcLB4R2iY5BpBgVM7TN1jyC9bQSR2owt8sCAIT5V9dTt7sMstfXZmqU9Lxq4IfigQNTz+FVMZ9u+lWmCQ== X-MS-TrafficTypeDiagnostic: MWHPR03MB2702: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2702; 31:Ug+eWAsi51aJ+WGV0xCj0DveoKn5f1Cc7rkqKvwEOzFjjefe0QlVyyNwCRA4DfGDjMJO4a+Ojobcrfq9f+qgc3CJJr7QmUZvwvnNCNGvUTYAdu+91NoJTgwcLr0gucmNoR7YByPg+nIqNpxSb/wkodgkIFESxZNdlNhkHhIuaD7SJ4VIc/dGhGmkwCdJDIFYOTCxj0lKsLjJZyYLnVMC+knwQT0P13dbxQknFT/8HBQ=; 4:na38TnnjgqaGPmE0dVUxUEhCLJ4N7fEj6vlVKGo85MTirrdVZfEvPYxOop2Xvo73DjqZ2CacZd1N6OrNj0ZDN6c0L7VYZ5yii2kfYcJzrfW2x7JJjombFYWJocKXURdvIdkQLdWqyhYY0acc/4XbuTw5s4JigoTGIUVg6Yq0HISIKwjiciIhIfOHZa7LstIP8N/+KykqF4xfrV/uyFjo7HN2r4zBBG3Yaf0YzvHkpW6PQyIk9KRzuqsoFJWvt/enrZfs/F51iVgCU+4nBu/+kbp9CQHS+dZkU7Z7+5u69//xyHPokpPBYlWx60WqyxYas94lY0L1zoDyaLGEUcekFw== X-Exchange-Antispam-Report-Test: UriScan:(131327999870524)(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123561025)(20161123563025)(20161123556025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123559100)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR03MB2702; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR03MB2702; X-Forefront-PRVS: 04433051BF X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjAzTUIyNzAyOzIzOjNscS9JQ1JVd1ZkN21jOWM2R3VxYU5qTlVt?= =?utf-8?B?TzZvbzV1NjltdkJmbkxyNTF6Q3RTMnZG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ata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2017 08:15:52.1421 (UTC) 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: Re: [dpdk-dev] [PATCH v4 41/41] net/dpaa: support for extended statistics 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: Wed, 27 Sep 2017 08:15:55 -0000 On Thursday 21 September 2017 06:56 PM, Shreyansh Jain wrote: > On Monday 18 September 2017 08:27 PM, Ferruh Yigit wrote: >> On 9/9/2017 12:21 PM, Shreyansh Jain wrote: >>> From: Hemant Agrawal >>> >>> Signed-off-by: Hemant Agrawal >> >> <...> >> >>> +static int >>> +dpaa_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat >>> *xstats, >>> +            unsigned int n) >>> +{ >>> +    struct dpaa_if *dpaa_intf = dev->data->dev_private; >>> +    unsigned int i = 0, num = RTE_DIM(dpaa_xstats_strings); >>> +    uint64_t values[sizeof(struct dpaa_if_stats) / 8]; >>> + >>> +    if (xstats == NULL) >>> +        return 0; >> >> This is a little not clear from API definition, but I guess when xstats >> is NULL, it should return num of available stats, "num" for this case. I >> guess there are PMDs implements both, can you please double check? > > Ok. I will check again. I checked a number of other ethev implementations. Some like i40e/e1000 also return 0 when xstats is NULL. Others, like bnx2x and qede don't handle this situation. All return "num" when passed argument is larger than number of elements in the table. Though, I think the logic that get_xstats should return its size (num) when passed with NULL, looks good to me. How does one standardize such semantics for existing APIs? (I can add this info to the API document that you created - but only once we know if others will agree to change) > >> >>> + >>> +    if (n < num) >>> +        return num; >>> + >>> +    fman_if_stats_get_all(dpaa_intf->fif, values, >>> +                  sizeof(struct dpaa_if_stats) / 8); >>> + >>> +    for (i = 0; i < num; i++) { >>> +        xstats[i].id = i; >>> +        xstats[i].value = values[dpaa_xstats_strings[i].offset / 8]; >>> +    } >>> +    return i; >>> +} >> >> <...> >> > >