From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DA4E1A0A0C; Tue, 20 Jul 2021 18:25:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 716E94069F; Tue, 20 Jul 2021 18:25:48 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 005A040689; Tue, 20 Jul 2021 18:25:45 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10051"; a="209368303" X-IronPort-AV: E=Sophos;i="5.84,255,1620716400"; d="scan'208";a="209368303" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2021 09:25:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,255,1620716400"; d="scan'208";a="432609749" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga002.jf.intel.com with ESMTP; 20 Jul 2021 09:25:44 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Tue, 20 Jul 2021 09:25:43 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Tue, 20 Jul 2021 09:25:43 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.172) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Tue, 20 Jul 2021 09:25:43 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eQQKXVSMB0T4eyvUfx2f3lsdzq8a19tw0cDitHFD++zz1tHyaY7EnCcLXTcqKz6yN2WXYJ/sB0UcMhfK3jmca8sy+NlDccdpP3JHu1eyeM19utdp1EpDdDb29C2lmju4ivvzcrxVyL18XowORJpbqu3D2UH20Q9++veCGZl4dPzuQy9FanhLt2RXkmos6YEBWxqBDsXlSuLpYeoJeeIe6tHglCkH2rDy3bQMQyOdHl7fdw7cplJ6RCvpSrDKIsBqvRN5fg1orvVMlJ7xF/4FEcbMVyqwM0pPWaRZ7fCY+mrA2vahRcX/GFOkZTAqk7V0hcgAyZ28LCnh4HlFHA9bwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zu7dgLmxbFJgehrUWY57AJLehGmezs8CiBJ0HGgYkFM=; b=gk6SBy9y9VFdj+E6pzf1nlldNPV+3wkysLSb/G6paI5BGLLiNMDDxKxaYlFUkNS42YFFoOEy6eAwDvvSCXfSIUtKlgSBB4/uVUwuxxpn+XaJbPEJ5gduvJXrQG9fZe8HS/cUYnYf3bWDvfDCbsZo0F74hBlZSlgdriBT1Mk05fJCwO/ex1c0reXjUfpBFYW1EUNqnYWBGf24fjhcxy0zoKrLTYzjyZ5JQui4/S/w/UGB/ITiU4cTsNYvW0UuZPmFds6PmqDMdBLDaPc39cP87QHcvExEIMxrSsnE2tcZ0fhgC3n2M1HwcSTc/UpqouAtmVNjqkDWAj/4Zf/Z9NfUlg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zu7dgLmxbFJgehrUWY57AJLehGmezs8CiBJ0HGgYkFM=; b=lbl/QIXXu2gUBnl3nsbrXLeRxzI+RxcEbURRYgz/+ECkTfcnbcvacrr4JopvtL+QaOwTLmVFkx7xUTGAI/98E5m88yrVuQhDHk1wfQCry0fZy0JWLeXhRA7A7+VoFtJhXFfnv7LpQqaMxbjaXqA1UGhI640JTC0HxYEeTrDul1I= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4968.namprd11.prod.outlook.com (2603:10b6:510:39::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.23; Tue, 20 Jul 2021 16:25:42 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bde5:66de:e755:c5bb]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bde5:66de:e755:c5bb%4]) with mapi id 15.20.4331.034; Tue, 20 Jul 2021 16:25:42 +0000 To: Andrew Rybchenko , CC: Ivan Ilchenko , , "Andy Moreton" , Thomas Monjalon , "Kuba Kozak" References: <20210604144225.287678-1-andrew.rybchenko@oktetlabs.ru> <20210604144225.287678-4-andrew.rybchenko@oktetlabs.ru> From: Ferruh Yigit X-User: ferruhy Message-ID: <0a2b1c55-bcf0-de80-0baa-eb0abb97f37d@intel.com> Date: Tue, 20 Jul 2021 17:25:36 +0100 In-Reply-To: <20210604144225.287678-4-andrew.rybchenko@oktetlabs.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: PR2P264CA0011.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::23) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.206] (37.228.236.146) by PR2P264CA0011.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Tue, 20 Jul 2021 16:25:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a3c39ab6-cdb6-4ff4-e247-08d94b9b04a0 X-MS-TrafficTypeDiagnostic: PH0PR11MB4968: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Da+a9azVtdhaCAcynRbCGkkoCYLfNDHNtoHwRvcQ8rdHirg8EhKrBEd0BI/0aRC2cmG4Pfb0z78XzaMkG02pow+MVTt/Kb39or1/GQKvxxtm0dGApyO9bejlL7giMC9pvzHOI2wKNdHEJe7yqYpL+OKGUc1CRdoqshBs5FRT14aBKddkCR57FMO2VA5o96zX2XGshn2dIbSLrXM1f1MEwcZF8iwTqKVi478P3ISCx2Tou8av2pCCh8PMqCDJsq2Rskau26208AWK/yIcZsudNAtor5tmKn0SNFN3C1NZKel5e81k6UTaZcbQdQNSc4HunA1bo/tLoVomuBD3dLeY56YNRqX1VRZYwTOrxHfPKS5Uk0ZcDaYTj7FBmLMRWeNOWmSFBdmgaAjO7RZk9Qb8nfJAJ5EW93EK5M0zjVmxUxxTyba16VgiFH6xsiYYJYN1i57jlOgPL58awj8zsDmIaQbIGb/eHwBte8Ud2IXIvgsMO6vBFsgB2/RxrVNWsIcxoXdg9vNmgSy64TdcCHufq80VV7/L8UltOYCEPgaG4k4lvBgkZVRUB28VYNRWZc1bDrk93DBpT+rkBC+HNXB8nXav+M9z7wbjg8D7BfkWzSFaKYrElPEbxKkC4RWeSsW0KrzPUzBuuYTn9HrdpGHfND2KyDx2diToXpUGoUWSGTB5y4taPMyiV1smZ/xXJMMpfEcexPa5AolZuSoDrmCx/Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(136003)(396003)(376002)(39860400002)(366004)(5660300002)(478600001)(6666004)(2906002)(31686004)(53546011)(956004)(38100700002)(4326008)(8676002)(8936002)(186003)(66476007)(66946007)(66556008)(107886003)(83380400001)(6486002)(316002)(2616005)(26005)(16576012)(54906003)(86362001)(44832011)(31696002)(36756003)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WWk3bjk4NGZvQzl4SkNoaDFaUjBGUFg3VC9QS241bVNGSzdyc3llMVpzUHhV?= =?utf-8?B?ajM0NlNuZTA1N2krenQyZUY1cS9BbWlwQk9kMWVERW8wdUVNQ2RMTmZhY0w5?= =?utf-8?B?QTJJdytZL1RackFITEJUN1JXNUJmb1hoV04xSzN0RDB4amhiaEY4a1hwcVc4?= =?utf-8?B?V1pPdDQ5d2tWOGZ2WkxLemhldmZwMFMvNHRSajRDdTNDNmxmV2E3cERNNGp1?= =?utf-8?B?Qy8yNlFxOTF1OWRHb0pQakw1azFQcVV0MTV6ZkJObUhFdU9HL3pQVzZ6TjF2?= =?utf-8?B?cUhXNG9XTnVqemltZzhxTSsyNjAvZ1ZGdjZObVNtT1Y4bnFZOHNOZTFueTRC?= =?utf-8?B?d09xS3dkM0w0WjN4OVAyQk1WeVI1NXM0UFEwQXZndzBOdUFTOSttMUZkMEN2?= =?utf-8?B?Mjc5d1NNNXU4MEJYS2FGdm4xcmczYTZNcmtnQ0VGak5UUkl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JUY0VzN1Vq?= =?utf-8?B?QVVUVEdzaUV1Qy9zN0RzT1BNb1lqWmFTbVU2c2N0N0xxZEVlY1RkMXN4T040?= =?utf-8?B?OUlyWkNhcHlsSnJQdWtsZnBSZi9rZE1ZOTE4alB5NzdycXNSeGpwL01mZWE1?= =?utf-8?B?dmlMbzBITWRRUUplN2xTaTNYLzJEYjI0NFBtVjVnZmZ3bG5IUGZDZTk0VnV0?= =?utf-8?B?RmFtbWJtWkFGVXl0bkRQQXhNQVp0SDFXeERKVVFFSkJvSUdVTVZRSzVIaVJD?= =?utf-8?B?OEVONURmWFlnVXVqYU9qZ2Jlek1OU0JoS2k2MnNOZUxhREt1SXlqam5mM1gr?= =?utf-8?B?ZzVVTW1ZMVF4MTU2YlNpVmJjeXlWd1dCYzVQeTRKb2NDeDRTN2ZSNGdYTXNV?= =?utf-8?Q?Gdsm6/RJFJT+i7/hA38xQHansrwH/oM66ykhH6f?= X-MS-Exchange-CrossTenant-Network-Message-Id: a3c39ab6-cdb6-4ff4-e247-08d94b9b04a0 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2021 16:25:42.0527 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DSv/5ldG/rJRXBeOzH2myOlwOW1bhORglPb5qhyYSV0FaHzcmNhMbc66TN7wCziUVvFej1g/sQww4K+t0kB9Bw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4968 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 03/11] ethdev: fix docs of functions getting xstats by IDs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" On 6/4/2021 3:42 PM, Andrew Rybchenko wrote: > From: Ivan Ilchenko > > Document valid combinations of input arguments in accordance with > current implementation in ethdev. > > Fixes: 79c913a42f0 ("ethdev: retrieve xstats by ID") > Cc: stable@dpdk.org > > Signed-off-by: Ivan Ilchenko > Signed-off-by: Andrew Rybchenko > Reviewed-by: Andy Moreton > --- > lib/ethdev/rte_ethdev.h | 23 ++++++++++++++--------- > 1 file changed, 14 insertions(+), 9 deletions(-) > > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h > index faf3bd901d..1f63118544 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -2873,12 +2873,15 @@ int rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, > * The port identifier of the Ethernet device. > * @param xstats_names > * An rte_eth_xstat_name array of at least *size* elements to > - * be filled. If set to NULL, the function returns the required number > - * of elements. > + * be filled. Must not be NULL if @p ids are specified (not NULL). Removed part is also valid. If both 'ids' & 'xstats_names' are NULL, API returns number of all elements. Addition part looks good. > * @param ids > - * IDs array given by app to retrieve specific statistics > + * IDs array given by app to retrieve specific statistics. May be NULL > + * to retrieve all available statistics. ack > * @param size > - * The size of the xstats_names array (number of elements). > + * If @p ids is not NULL, number of elements in the array with requested IDs > + * and number of elements in @p xstats_names to put names in. If @p ids is > + * NULL, number of elements in @p xstats_names to put all available statistics > + * names in. ack > * @return > * - A positive value lower or equal to size: success. The return value > * is the number of entries filled in the stats table. > @@ -2886,7 +2889,7 @@ int rte_eth_xstats_get(uint16_t port_id, struct rte_eth_xstat *xstats, > * is too small. The return value corresponds to the size that should > * be given to succeed. The entries in the table are not valid and > * shall not be used by the caller. > - * - A negative value on error (invalid port id). > + * - A negative value on error. ack The 'eth_dev_get_xstats_count()' API is flexible but it makes API unnecessarily complex, not for this patch but for future perhaps we can update the API and it can return error if either 'ids' or 'xstats_names' is NULL. Remove support to get all elements or getting number of elements support, these already supported by non _id version of API. And as a note for future, if we ever consider updating these _by_id APIs, we can consider making the parameter order same for both, currently it is: "rte_eth_xstats_get_names_by_id(port_id, values, size, ids)" " rte_eth_xstats_get_by_id(port_id, ids, values, size)" > */ > int > rte_eth_xstats_get_names_by_id(uint16_t port_id, > @@ -2900,13 +2903,15 @@ rte_eth_xstats_get_names_by_id(uint16_t port_id, > * The port identifier of the Ethernet device. > * @param ids > * A pointer to an ids array passed by application. This tells which > - * statistics values function should retrieve. This parameter > - * can be set to NULL if size is 0. In this case function will retrieve > + * statistics values function should retrieve. May be NULL to retrieve > * all available statistics. Update is good. But what do you think to make it exact same in the both APIs ('rte_eth_xstats_get_names_by_id()' & 'rte_eth_xstats_get_by_id()')? Since it is used for same purpose and exact same way in both APIs, no need to have slightly different description. > * @param values > * A pointer to a table to be filled with device statistics values. > + * Must not be NULL if ids are specified (not NULL). Same comment on making description similar in both APIs. Also both 'ids' & 'values' being NULL returns number of all elements should be addressed. > * @param size > - * The size of the ids array (number of elements). > + * If @p ids is not NULL, number of elements in the array with requested IDs > + * and number of elements in values to put statistics in. If @p ids is NULL, > + * number of elements in values to put all available statistics in. ack > * @return > * - A positive value lower or equal to size: success. The return value > * is the number of entries filled in the stats table. > @@ -2914,7 +2919,7 @@ rte_eth_xstats_get_names_by_id(uint16_t port_id, > * is too small. The return value corresponds to the size that should > * be given to succeed. The entries in the table are not valid and > * shall not be used by the caller. > - * - A negative value on error (invalid port id). > + * - A negative value on error. ack > */ > int rte_eth_xstats_get_by_id(uint16_t port_id, const uint64_t *ids, > uint64_t *values, unsigned int size); >