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 4C5FFA0C51 for ; Fri, 23 Jul 2021 16:31:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3D41740DDA; Fri, 23 Jul 2021 16:31:58 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 20DFF4003C; Fri, 23 Jul 2021 16:31:55 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10053"; a="297459956" X-IronPort-AV: E=Sophos;i="5.84,264,1620716400"; d="scan'208";a="297459956" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jul 2021 07:31:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,264,1620716400"; d="scan'208";a="415861190" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga006.jf.intel.com with ESMTP; 23 Jul 2021 07:31:54 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Fri, 23 Jul 2021 07:31:53 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Fri, 23 Jul 2021 07:31:53 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Fri, 23 Jul 2021 07:31:53 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.46) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Fri, 23 Jul 2021 07:31:53 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YaIc96MzyDdsL94RaFSKoYrNhUGbGopeVrJYH6ZTe1XcylwUn2R6DNnGGqi///C3aGNVQ+1ichbV5zwKqBYmDq4/2Wr0xmxCV9eYnNqNmPdmcChd+zksJtMoyqeN4bfTwJi0Z2XCHf3I++nQYXaVwBYoXlpW0t3BNzgtLUaY9Jh/uZ2LxUwOAVyw+2O876bIgMMIYx/+v5fNL0shtL4MLFoDNVm1WYRvaVH9NeFTMUU32td4GPMpJFEQ+dOu5VdVQAj0woxzN+NPwXnSkWaOKETfwz3jaknKlxmrUf78F4BO2XOi9EsnQDHoCrPfPPmNYBwvAuCX5xJESc2x19z3Rw== 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=owlRLSTuDWjuITVvb8LV8F8tvDlcdyQJcGi7ap8c/Vc=; b=DjfN95gQm7T/xnbyGd+XIcpjXDi20gLMfiAS0SZlbWdB6Sx8O6nzfJFS84vcqja085xZnTO/uczF7WS+VTaepdmoPspV1/ro0UB2azNsBj57mUgUXXTIfu8wNzpx6Y5cbJmjyRfSPJwo2IoFJbPJkK4drX/Z3PjWCrsS6rbULqgA/Y4jCIWFkkjh8Nl4BPJwukppklzDwVZe9rVGaRkdB/jlCWfGt2Ii4V8vysUW7m64U/sCqOiDUpProwz8HojzvDxWH2pAP2lvdSNowtYw7ZmoGzsrOtVH64O4ZbWwRP+ccqhtSOi4Qfem/jq9LF+tjlXqjHI7xBf5te4n8Zg03w== 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=owlRLSTuDWjuITVvb8LV8F8tvDlcdyQJcGi7ap8c/Vc=; b=TAD1vi2wJaAH0PlxK6PfzsHAR2nAtyy6uaarCTHah7PexbmWMNhDwAdIf+r+Gy57E79/SlyuHXtdotCeLmxdNe5r8lNSjdaNrKZrdfQ8nzIkJaoSaddbvJEQKWY6woo71Y8TJu94bXz5Wp8J1LQXIrgIMvNhA4BYhCGJfgBCuKw= 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 PH0PR11MB5029.namprd11.prod.outlook.com (2603:10b6:510:30::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.26; Fri, 23 Jul 2021 14:31:51 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bde5:66de:e755:c5bb]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bde5:66de:e755:c5bb%5]) with mapi id 15.20.4352.029; Fri, 23 Jul 2021 14:31:51 +0000 To: Andrew Rybchenko , CC: Ivan Ilchenko , , "Andy Moreton" , Thomas Monjalon , "Kuba Kozak" References: <20210604144225.287678-1-andrew.rybchenko@oktetlabs.ru> <20210604144225.287678-5-andrew.rybchenko@oktetlabs.ru> <16f738a7-28b7-bd41-cfd2-60f35f868c32@intel.com> <7b25c75c-6a4a-fd51-09e9-af9ecac1a7cf@oktetlabs.ru> From: Ferruh Yigit X-User: ferruhy Message-ID: <2601474d-1cc7-c819-e950-43bcbbf548b7@intel.com> Date: Fri, 23 Jul 2021 15:31:45 +0100 In-Reply-To: <7b25c75c-6a4a-fd51-09e9-af9ecac1a7cf@oktetlabs.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: MR2P264CA0169.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501::8) 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 MR2P264CA0169.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.28 via Frontend Transport; Fri, 23 Jul 2021 14:31:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 04d3c5ce-26b2-4636-d589-08d94de69c84 X-MS-TrafficTypeDiagnostic: PH0PR11MB5029: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UeJEim/6pnvDL09oATfxaeGDFJxiBdusGvCgu0i9/dU/S317Qdixaxst2xlsXxWSm8tVtU+E5Ykg+bC1pXH1E1AZhIqdvyUcU1LFo3wgrNwrnH+Fo/G1sRE8wsG3WHsWapxkuaGDKmTSM0+4b6pAhXHpyzNEPKPvsxdn/+B/rTh7fqPiRVjMF3LwFo6ufqZ7g5MQJZmIkgu4O0Dbq7+CMKpJc4QW5f7on5sRNYaRv1W+SICXZnc78ZGyuw+WxhstjeUkVTslPwJ+boSPhIS8lS/uBjAn9LcVJqMyuKJMqObfTyv9l8KLIlHazTF3/Mp6p0qyhH+88jLPm5z2Sb3uPOReL9RQ0c2eiVBmaoaw0ez0phSqJ8XtzDD0k4+/6b5k/QZYDQEwSB46HovfHS6dggPcbCWYyi0+8z9EXX3yw1Cy20U6HxotR0MKx2s5ElFAC8Ska2Mz2mavyUsb2zjWCuPPTMVuq7L9/bABaDHgFStKRpZ5oWl3PD/7sllvK0lV0hS88+7TosgSv5N3+87hhkmVYg60ekkAlZQ9d+nyoK66HCkHJMwZmorsbrt5Mg7JIxcUk2TNu+FmSzUzCsqIsWkxuJ9lU8P+z/ferrPNKMUhK6UX+ShfXr95pZ6+AH5mLfFSGv1iluJIUIMDvjvGZC7/m8NyyW0jPBf7nc1ZLwCMlMdVDDQr2BeivPnfahIhtytU8IUL6wsDPRt+ffrR9A== 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)(366004)(5660300002)(956004)(44832011)(107886003)(54906003)(38100700002)(316002)(8676002)(2906002)(86362001)(2616005)(8936002)(16576012)(6666004)(36756003)(31686004)(66476007)(186003)(26005)(83380400001)(53546011)(4326008)(31696002)(6486002)(66946007)(508600001)(66556008)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WXMxVTB1dklvM0d3c3NoV2Yzc3VGZVBGbDFidGIyZmlLVmViZXh1VW1tOEN2?= =?utf-8?B?MTlSZm1BVk9TWWpxL1YwWmNMcDlxQTkxUEVPQUdNR0p0UzFYVTU3aFVhZC9Q?= =?utf-8?B?QkJGT2d1Z2pwbDZ2TDZGVTlJK01WV3hTMDExdmFHWGNBWkRxQURQT2RTTDQ1?= =?utf-8?B?clBtLzZZWkhISnczZ0NZZml0ZEI3b1RIUWYrbmxNY0ZHRy80aVUvRDk0ZEJ6?= =?utf-8?B?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pI?= =?utf-8?B?R0J0SjlVdXJ1akVyRThmeEtrbktjK1Yybkh2djA5cUkrZFdzUGxLTWV1aGxl?= =?utf-8?B?dXpyS0ZuMVlhVllCZVJXcmJZRmNmLzUvTDVKMVJ0U1dvMHoxd3BWY005L3dC?= =?utf-8?B?b3ZWRVN2ZHordnZhdWtYNU9xTjZMMy9rVXNWejdFc3EyTit6cUFsL01PUVBo?= =?utf-8?B?NmFHNDlYLzZqQUxPNjVsZ0tJOVNMaEgrS2UrR0E5TDg5dW9yeTdWeUxJdzVr?= =?utf-8?B?MXZiejEwL1FXUGZqbkNSY3hFZ0d1SnhVZDJaVGd6YkZSTFk4SWdtaVVzcWNi?= =?utf-8?B?VTFCMkRUVXhZQkwxT2dzMVo3VHZMbkJ3YkRSMUtremgzZnY4K3pMUlRZckI2?= =?utf-8?B?M1d6RlczNW5GcGdoWmp0RmRJUU1CZmd4Z0c1TCthQTFqWUx1emVvdG5Rekxl?= =?utf-8?B?aTc0Y3JpOUFJemh0eXZQampKL1lHZUVkdm9TY2I5ZEdyd00vemxYTGFqL1FV?= =?utf-8?B?dUpqTkR5VDRCR0Nza3REajU1V3M1UkRZcnFPQ2pUOUJubDFNM3JXUWduU1BP?= =?utf-8?B?MmMwTERBUEtRT3FWZW5UbGV2UVA1ZjluOHlXSFpVVTRabUJkRm5vUjEyUEhm?= =?utf-8?Q?WF8zqbAnOYhn11OZwbq9SJUOyUHe87vN5nL3DYm?= X-MS-Exchange-CrossTenant-Network-Message-Id: 04d3c5ce-26b2-4636-d589-08d94de69c84 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2021 14:31:51.5922 (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: 9bA32Wf5yplw+RliVh53Ma+aKSRqotKneIPTWZOV6z/1xtF7UBxowFfNga3XWRfrKF70avAbcqMcwz/2b+ok6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5029 X-OriginatorOrg: intel.com Subject: Re: [dpdk-stable] [PATCH 04/11] ethdev: fix docs of drivers callbacks getting xstats by IDs X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On 7/22/2021 10:33 AM, Andrew Rybchenko wrote: > On 7/20/21 7:51 PM, Ferruh Yigit wrote: >> On 6/4/2021 3:42 PM, Andrew Rybchenko wrote: >>> From: Ivan Ilchenko >>> >>> Update xstats by IDs callbacks documentation in accordance with >>> ethdev usage of these callbacks. Document valid combinations of >>> input arguments to make driver implementation simpler. >>> >>> 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/ethdev_driver.h | 43 ++++++++++++++++++++++++++++++++++++-- >>>   1 file changed, 41 insertions(+), 2 deletions(-) >>> >>> diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h >>> index 40e474aa7e..fd5b7ca550 100644 >>> --- a/lib/ethdev/ethdev_driver.h >>> +++ b/lib/ethdev/ethdev_driver.h >>> @@ -187,11 +187,28 @@ typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev, >>>       struct rte_eth_xstat *stats, unsigned int n); >>>   /**< @internal Get extended stats of an Ethernet device. */ >>>   +/** >>> + * @internal >>> + * Get extended stats of an Ethernet device. >> >> Should it mention _by_id detail? > > Yes, will fix in v2. > >>> + * >>> + * @param dev >>> + *   ethdev handle of port. >>> + * @param ids >>> + *   IDs array to retrieve specific statistics. Must not be NULL. >>> + * @param values >>> + *   A pointer to a table to be filled with device statistics values. >>> + *   Must not be NULL. >>> + * @param n >>> + *   Element count in @p ids and @p values >>> + * >>> + * @return >>> + *   - A number of filled in stats. >>> + *   - A negative value on error. >>> + */ >>>   typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev, >>>                         const uint64_t *ids, >>>                         uint64_t *values, >>>                         unsigned int n); >>> -/**< @internal Get extended stats of an Ethernet device. */ >>>     /** >>>    * @internal >>> @@ -218,10 +235,32 @@ typedef int (*eth_xstats_get_names_t)(struct >>> rte_eth_dev *dev, >>>       struct rte_eth_xstat_name *xstats_names, unsigned int size); >>>   /**< @internal Get names of extended stats of an Ethernet device. */ >>>   +/** >>> + * @internal >>> + * Get names of extended stats of an Ethernet device. >> >> Should it mention _by_id detail? > > Yes, will fix in v2. > >>> + * For name count, set @p xstats_names and @p ids to NULL. >>> + * >> >> isn't the 'count' part handled in the API? I think in the devops both should not >> be NULL. > > No, eth_dev_get_xstats_count() uses the callback with NULL, NULL, 0. > Right, I missed it, xstats_get_names_by_id() seems used outside of the ethdev _by_id() APIs. >> >>> + * @param dev >>> + *   ethdev handle of port. >>> + * @param xstats_names >>> + *   An rte_eth_xstat_name array of at least *size* elements to >>> + *   be filled. Can be NULL together with @p ids to retrieve number of >>> + *   available statistics. >> >> As far as I understand both _by_id APIs and devops behave same, so argument >> descriptions/behavior should be same. > > In fact no, it is slightly different. For example, devops is never > called with NULL ids and not NULL names or non-zero size. It allows to > check less in drivers. > I am not sure if this difference is intentional. 'eth_dev_get_xstats_count()' is ethdev internal function, what do you think removing 'xstats_get_names_by_id()' call from it. And make both _by_id() dev_ops doesn't accept NULL ids and NULL values/names, so simplifies PMD implementations. >>> + * @param ids >>> + *   IDs array to retrieve specific statistics. Can be NULL together >>> + *   with @p xstats_names to retrieve number of available statistics. >>> + * @param size >>> + *   Size of ids and xstats_names arrays. >>> + *   Element count in @p ids and @p xstats_names >>> + * >>> + * @return >>> + *   - A number of filled in stats if both xstats_names and ids are not NULL. >>> + *   - A number of available stats if both xstats_names and ids are NULL. >> >> Again as far as I can see these covered by API, not devops, am I missing >> something. > > See eth_dev_get_xstats_count() > >> >>> + *   - A negative value on error. >>> + */ >>>   typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev, >>>       struct rte_eth_xstat_name *xstats_names, const uint64_t *ids, >>>       unsigned int size); >>> -/**< @internal Get names of extended stats of an Ethernet device. */ >>>     typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev, >>>                            uint16_t queue_id, >>> >