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 A6E0FA0548 for ; Wed, 29 Sep 2021 10:44:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 95265410ED; Wed, 29 Sep 2021 10:44:38 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 0EC69410D7; Wed, 29 Sep 2021 10:44:35 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10121"; a="224963840" X-IronPort-AV: E=Sophos;i="5.85,331,1624345200"; d="scan'208";a="224963840" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2021 01:44:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,331,1624345200"; d="scan'208";a="437560971" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by orsmga006.jf.intel.com with ESMTP; 29 Sep 2021 01:44:34 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 29 Sep 2021 01:44:34 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Wed, 29 Sep 2021 01:44:34 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.175) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 29 Sep 2021 01:44:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QMAJ3BIW8HFZY642MCcmPeN0++LZgEcqnRit5gjp+jMQuU3SwJY06pP4sUme0pmip5fBZpk1/OPdVlVUVEah+VPYNrRZpXrtscNYHDu6ZPEGrshbtnU/flWWeGIHBX/ie6AMmXiUFizzWaRhAyYaLquuafplsmJ+Nm8WO5+o8kop58J1w3n6UDijBi3BkqF/oOR388vIFN3BX9tvyFrx3nHnB4HTZFG91KyZ+iVXwlEmAnPUjYRqllQe6d4czjRK/6j7j1K1ucnZml2N/C2Y54/ijnDNzHKwN4942ytWmM0E8J6zhleeEijZ2zuQV3tR/j4KtekS/yiEwaUtkVYTDw== 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; bh=8AYbxKc1xgrSIyxh2FX6ihyKkRwEqzUOioZUHtkRQVY=; b=eATf/jyQbqRY0QxWJ/+ayvjijyfomSoTOkR0UkGFHvkkHrk3FVCHH/ITF7Xtg7mQMCbdSO3GKGdNJsghhxCHc2YqucQIRHKLfjk0rx1Amt/wCzZLURmAe21SJRJoiCkPjEWOe99svGos3ncY4w3uqdamufSSA2BPWdOXUiuw/LISvXW01oBgs/rkFVVa2xRvwyY/1bG5lHPBfSkxygd395DgSQLSkPpZdwdYj6cUB8+jnIutONzlTQU7rJp7eazSlHJo6pzon4lmtKpft3Zvj5bcgZa5VNgZ29nqS1o/P4/4IbNe+b/XvYW6anzQm+NAG0IlanhYL9/BI/ejE1jG9A== 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=8AYbxKc1xgrSIyxh2FX6ihyKkRwEqzUOioZUHtkRQVY=; b=Kfyd8DlOTcuBrocnyFK16aTKDdXuovFELYcMEpDLQmGOUsO4HOMq6dzpRanOoMaKIjdgqYA0xFzSagBxcLURnRFCiCA+CVXSqwbfk+tuq9nPB3NghT2dvrsDUF6x4QdNwsQUM6LmmpQbdUE6sXNQHdO4jAHOjy0N9b9nmIF6vvw= Authentication-Results: xilinx.com; dkim=none (message not signed) header.d=none;xilinx.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4997.namprd11.prod.outlook.com (2603:10b6:510:31::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.18; Wed, 29 Sep 2021 08:44:30 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::747b:3a08:d1ec:31fc]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::747b:3a08:d1ec:31fc%5]) with mapi id 15.20.4544.021; Wed, 29 Sep 2021 08:44:30 +0000 To: Andrew Rybchenko , Thomas Monjalon , Kuba Kozak CC: , Olivier Matz , Ivan Ilchenko , , Andy Moreton References: <20210604144225.287678-1-andrew.rybchenko@oktetlabs.ru> <20210928120533.834334-1-andrew.rybchenko@oktetlabs.ru> <20210928120533.834334-2-andrew.rybchenko@oktetlabs.ru> From: Ferruh Yigit X-User: ferruhy Message-ID: Date: Wed, 29 Sep 2021 09:44:24 +0100 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DU2PR04CA0295.eurprd04.prod.outlook.com (2603:10a6:10:28c::30) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 Received: from [192.168.0.206] (37.228.236.146) by DU2PR04CA0295.eurprd04.prod.outlook.com (2603:10a6:10:28c::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Wed, 29 Sep 2021 08:44:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0cf51841-9ce5-455a-7dc5-08d983255a77 X-MS-TrafficTypeDiagnostic: PH0PR11MB4997: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8tlKE48hpPLxu+7YTPgJd8NvKxQ3w6jCWxbxI1Uq7uKA8gB4lGQkaZHDMsH+1BluwjLD7Hlyn0otaRmUJxDpGMO00ZAFuv/jl5oSDut7LsCM6cUa3unRgyneHDZ52PI/c4liYPTSMwOzRUpj486yV/SLUl7j+vBfWtmqKnSFnlOI49zJmbxg3ZjSlD03ZNfytNCmeo0NKNFMjMQMtny54W5gOPkbENZgUxW/Gm8i10F/jsPQiSXCg+0nXzy6jrJuTaVuqENcnOutyhG6WLYqeaQF3jU5gsmg8Ub5dgXLLMranIqbd8GtEfPBUeJND1uL8IFukcaP4ShwNYbvRN/XmvTMcM1r3o/Yotf/MOA5nkEY037CVv9PgU2FqNdckN4F1E+BoSdFG7Qcpw0CNpuc46BXbCOINcql3alFWxCsrycgGhbShL+ElmQtSpytntKdOAJfWH2SOqPrGPptZ4D8RfPD8XdE1yESmM1SLKGRO3N93Y6DxHFmmWhNdEjhms6X//otOFPZtn1F3Yet4uv68EdFqV9KVxHXbY0XHnUZZKNXU8aKXimSPFyMODQ4WgIH9VBcKEhYz4zTE2PpsHizUS0Bdxws51AXkcdVB7uMLvGY4vw29U6KBWdNyXx+5wb0SNGyy8UBDjL6dN8g+H2yaud5NCNAWLQuZ34itK+VIv3Id6JwAiF7kORJZ7hLMGaFPX5HyMbGppHzO71Rm9cnaw== 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)(26005)(54906003)(31696002)(2906002)(31686004)(8936002)(8676002)(186003)(956004)(2616005)(6636002)(53546011)(86362001)(44832011)(4326008)(110136005)(6666004)(83380400001)(16576012)(316002)(38100700002)(66556008)(66476007)(66946007)(36756003)(5660300002)(6486002)(508600001)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?K2s5VHNKU09MaFBLM0ozT3hOdnVrNm1GMHhjdGRvR0o5SExhREVkREZ2cXhv?= =?utf-8?B?d3Fldzk0OGxUbm9kWGhCQ214aVd0UmRXUENKVkdQdzJGUHpaK2NaZ1RiWVdF?= =?utf-8?B?TjBYbFpsd0JYSzByQjlPM2xKeWlsT3I0Uldsc0o4V2F5UGExRHVSR0VwT1JL?= =?utf-8?B?LzB0YXl5Yzc3MW1qOUhlWFZkandSTUkxNGdMS3BrVXJ4V2hSdUZVWDhXR3JZ?= =?utf-8?B?U1hyMTJwb3U0eXp1blRuUGVQK1l5YTd6T0tmS3BUWE1rTks2L0xzSWVuMXRZ?= =?utf-8?B?R2pnZGp5SkZpeVNHYWZOeWpOSlE2QkNnaXRnaEVwVXpSc2IwT0ZRN1JqcFZ3?= =?utf-8?B?TFJUbHozYjZza0hYbVdEMitDZnhnbHFpV0h0c0F4L1U3SlBoWmpIRE5hUXQz?= =?utf-8?B?WlRVeUNPYUZmZ3JYalpoazZOTFJpZDROQmxZTzRGOUwwaFFQTVdobFhrRlRr?= =?utf-8?B?N2dteElZNkFNdFgxMm9ZODY0d050a3VoNG1NV05yVjRrUzVWT3hacnNtNkRa?= =?utf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aHVLRW9qYjlXdkdEOWtrMHlx?= =?utf-8?B?cTE5MWJiWTd2MUVtcFFnYjN4K0dxdUNMN3g0K3AvYkdVWHViMWI1ckdCVkpo?= =?utf-8?B?d2JrL0FHVm9BZGJ0UC9Bd3lCSldIemkvdS9raGQ2b2h4L2pZYTFKRU12UjlE?= =?utf-8?B?MFNseDZRTldFclFRQUQzcksvalY4Y3NvempzeGw0WnpLYTBjcVhwV1BXb3g4?= =?utf-8?B?Zm94KzkyWmRYTUtuVXcyRkV4Y3Q4SVVoam9tR1c2V2xPUDFWTmpnQTVTK2x0?= =?utf-8?B?VzQ2dEpXL2Q2cEI1VWtGNFY0eDBWbS9JZ2hTb0xtYnIvZ25INW9JYjdmbG1Q?= =?utf-8?Q?vhaFe7afyB2Gg75r/Mv2Nr4lm8Wpnc97XCQYxwm?= X-MS-Exchange-CrossTenant-Network-Message-Id: 0cf51841-9ce5-455a-7dc5-08d983255a77 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2021 08:44:30.6057 (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: 6V314lrG1jygsww54s/tb6RD10k3ftclyT4KtjDoF44OOxGK4RkNA4ijUMz4x10xuAi27By1jdwP0kUnmtKsQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4997 X-OriginatorOrg: intel.com Subject: Re: [dpdk-stable] [PATCH v5 2/2] 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 9/28/2021 5:53 PM, Andrew Rybchenko wrote: > On 9/28/21 7:50 PM, Ferruh Yigit wrote: >> On 9/28/2021 1:05 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 | 42 ++++++++++++++++++++++++++++++++++++-- >>> 1 file changed, 40 insertions(+), 2 deletions(-) >>> >>> diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h >>> index 40e474aa7e..c89eefcc42 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. >>> + * >>> + * @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,31 @@ 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. >>> + * For name count, set @p xstats_names and @p ids to NULL. >> >> Why limiting this behavior to 'xstats_get_names_by_id'? >> >> Internally 'xstats_get_names_by_id' is used to get the count, but I think this >> is not intentionally selected, just one of the xstats_*_by_id dev_ops used. >> >> I think it is confusing to have this support for one of the '_by_id' dev_ops but >> not for other. Why not require both to support returning 'count'? > > Simply because it is dead code. There is no point to require > from driver to have dead code. > Let me step back a little, both ethdev APIs can be used to return xstats count by providing 'values/names' & 'ids' pointers as NULL and 'size' as 0: 'rte_eth_xstats_get_names_by_id()' 'rte_eth_xstats_get_by_id()' But internally both APIs use 'xstats_get_names_by_id' dev_ops to get the count, as said above I believe this selection is done unintentionally. I am for below two options: a) Internally use 'xstats_get_names' || 'xstats_get' dev_ops to get the xstats count, and doesn't support getting xstats count for both '_by_id' dev_ops, this simplifies driver code. As far as I remember I suggested this before, still I prefer this one. b) If we will support getting xstats count from '_by_id' dev_ops, I think both should support it, to not make it more complex to figure out which one support what. As sample both 'xstats_get_names' and 'xstats_get' supports getting xstats count, not just one.