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 F003943AA1; Wed, 7 Feb 2024 18:00:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A226840295; Wed, 7 Feb 2024 18:00:36 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2073.outbound.protection.outlook.com [40.107.94.73]) by mails.dpdk.org (Postfix) with ESMTP id 567C94026E for ; Wed, 7 Feb 2024 18:00:34 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R4mHvQRnB5d2qO5/2qMw8+Q5/Rh6TO9LVdbVpNRyMyl+X2tidzzKEWmxO0SRWN/NDYvGdrSX2kX0uVeleOTYrs9wb75QRoQWAavm28Ap+01nrd+YHbH5SyC4j+sdPsBIUX8V6P4OFt4ztS30A2zyl7OnZKndW9IC0wG2bJwWTBv8CyZMcMnIu1xK6B8i6IL6GxcKelBzD6+v941aBviId7Gjrg0rOtImELfAnhXp71FPq0+EchtWAoOf86/eFlzqO0iYpPHwGMCAYuUvr3WvGRfdnDK7fJXXWqLLBY0z8vshvj4kywgtMtUsHYb8Fdbm38+6TG4iY1SgPTXmn+QZKQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VpCC4dZwZfI9YTKT+V/TQ4PoRIIcd+Malu0Vt3coeag=; b=Xzc9+kqreCUmeWN/tRcaOrMyOxV29EuvOdszr5ib04XvRHwpuw+9UYGedR5o/ws+ylRGzkRbRNnWDsVe4KR5XL+w6ziKWbS3Y5TdzwYACcHW81H7vtajniauBi1XIlX33WFCf9M3qoekAYLvUkXG+m567Wr7heXOeSEq4V9cE22qb0dM4R4BB3+gX8mCMnVmhpX5OYSQq1JvGZZsF/yUz5yjUr5bf3m0IkLj9jOKdRbpYA7/GC0dpGl6UsWP30Yx05jgRgbtkcTJgd953RH9o9xM8CyXJl+cCtl2Rz0w9l1I38F3LI4mxRoz5t3/u3U45prleVCiZPffuEta+J26sg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VpCC4dZwZfI9YTKT+V/TQ4PoRIIcd+Malu0Vt3coeag=; b=FKiwdfcjPV9CuGXcNJA06mdBe7ie5vIs1MwIIRdUxwOQZgHCvvRolbAVe8ZGOQ9jZtneVQs6g5qvLYEESszEUye7uo5xJT9kn44P2gRtmv4U9HV3xhhhDMysdi/mDS6x3CQujWdtnaLHT4F8nW6iVMXXT5DB1sZkWeXdaqTSXRQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by CO6PR12MB5490.namprd12.prod.outlook.com (2603:10b6:303:13d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.17; Wed, 7 Feb 2024 17:00:32 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::815a:45e6:cf5e:479f]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::815a:45e6:cf5e:479f%4]) with mapi id 15.20.7270.016; Wed, 7 Feb 2024 17:00:31 +0000 Message-ID: <7884b943-376e-4c04-9b9f-ebf04515899c@amd.com> Date: Wed, 7 Feb 2024 17:00:27 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/7] ethdev: support report register names and filter Content-Language: en-US To: Jie Hai , dev@dpdk.org Cc: lihuisong@huawei.com, fengchengwen@huawei.com, liuyonglong@huawei.com, huangdengdui@huawei.com References: <20231214015650.3738578-1-haijie1@huawei.com> <20240205105151.275591-1-haijie1@huawei.com> <20240205105151.275591-2-haijie1@huawei.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZAR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H dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <20240205105151.275591-2-haijie1@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO3P123CA0010.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:ba::15) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|CO6PR12MB5490:EE_ X-MS-Office365-Filtering-Correlation-Id: c15a18dd-8122-4ecf-4e0a-08dc27fe4ac4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CCQ0Sv1bw/57zqG/2896VBXLP0nAY7cdUkl2zdkyWn9SSq2Z3oWtrt3uOH5mLoW/tW20Ysitpb9h8MVtnzfDS4o+uyBOTaIrUbmkLoOWpA7BEG01fOntTLC+qdDVDWI0lntZcT18xUSIHEkTQnlH5XQeZYSMDH5Vxns3DShqMqba5iG/vzB58yJG/WxI/f/eyOxbyOBO3Oe1T3pSZ6rI8V2xP84aw47mCLe9LwZ5eZilhuxyCEClbtBLfnHaF60pwOE/AuIVU8bC7NQfQG6O7DJJeHpmeaDzdsiai8Si3R8ZzxFq5sdu0IuiLI3XjAuaZdYDVeZ4iTkkPfZjaottC1zZQX13rLFv7F2ZvMWDW7+bo3aUhMgdpaoSTuMvfoammqJej52xWaGA3D7N8JckRmHDthBu3Yr/XbC7AdYJ8mgfCUB1FM6X2V5gaXS/duEpeBHR19oljdMUbDPrmrIK02Uouwq8rsGiU/QJVx8/Fk8bU7Jln4pq1cGo4NR5q++TvcfW/O2NJeFnuA0GvQ6Yx1IaGTBrMgxuwkVQQ3qw7iPbR+M8NaVh/vINCBhvPdi/Kwj3yNX3k+g/z2rZtLF/U7OrSb/0EPCkQg/QasYVGE8d28OGahfB4rOvPD0aXfdCwUiA72VB+QJStqkvUEq93w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(396003)(346002)(376002)(366004)(136003)(230922051799003)(451199024)(64100799003)(186009)(1800799012)(53546011)(2616005)(6666004)(26005)(6512007)(6506007)(83380400001)(5660300002)(478600001)(2906002)(44832011)(8936002)(6486002)(66556008)(66946007)(8676002)(316002)(4326008)(66476007)(31696002)(38100700002)(86362001)(36756003)(31686004)(41300700001)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TzhUM09VemxkVDJzdnM1OGtSRlpxbTAra0JzQ241ZU5VR1V1Y1BaaGg0WjZs?= =?utf-8?B?Mnk4a24wMXRUSkw4S253ZVh1TWJXbUwrTXl1aEhYU05vSEhoeUExVjNKSlgz?= =?utf-8?B?RzZ0VXBjdGFDN2ZuaWIzV0lQVm9GNUVkL0xWK0NtdytDdjNFTU42SHd2QVgv?= =?utf-8?B?akYxcjVDb3lxamR5OXgrU2RFQTJsUXJHMHlkNzBGZDJuUE0vQmN6anpZZ2Nl?= =?utf-8?B?L0FEcUtwVHhYeXlIK1M2V2EzT0hmNGxCMjY0R290SncycHkyOFhiZTM5cHRU?= =?utf-8?B?VXdNMTN0VXRvbXRMSk9zQ25UZkN3RmZDK3dqeGdzS3djQzFKbTFCcW1LOUk4?= =?utf-8?B?LzlMN1RmeGpvRE5SSDFta29PMVF4NXZ1SHFNSkhJcW82YjFKMmdjYXExUXVt?= =?utf-8?B?eFRJc3g1L2Rxa2JqRWtIL09FclJET0o5K3pRMytJOU1IVnd0b0U0Y0FjVk1S?= =?utf-8?B?UFhUcWdYR1F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8?B?NVVwWXdhSm9aalpmSGQ5OExIdk5tZHAydGhDc0pGcVU1UFlrOC9SMnJJM3lN?= =?utf-8?B?V0hJanU2QzJ1V0hUK1oyUGtlaUNVUDFZOXpJZ0xMNUxyUXdGSVJObUZjTjZV?= =?utf-8?B?VlMzYzhvdUVySnVibFF0cGpyMUxJbUR0UjNBejgyMnF2eUNlNnNqZlNBOEtR?= =?utf-8?B?WkRnZ3pmdWp3d3JEMzFSQjVuQSszNEVDSlcwZ1dLKzdneG1kaFV3dTgwdEc0?= =?utf-8?B?NzQxMmgvVzdteVk5QXJPMFI5QnJKZXAvcVNia1hLUzhmaENXTTZIVTYraTF5?= =?utf-8?B?emlaRzhReUMzQlJWTXFud3N6QWtleGZiajVOWld1TjBBUnBhbndSWWFWT1RO?= =?utf-8?B?eC93SUo1aElRMks4bFZia0ROQ1hTV0JaSE9SS2JSTzNSemZLZkVXRlJORkZB?= =?utf-8?B?ZHNFQVl3WW9VbTFzSW1pYzFXMTAvZGpUSjd5NW5zNDBHN1NRcnZNRkFmV1RK?= =?utf-8?B?Y1ZXK1hZQy93QkxGZzIxckRka0hvdmdmbEQ1RDArNXRkRXF1L3VsakxUWDR4?= =?utf-8?B?WTBCZTJlbEluM3hTN2lwWE15dkhqcXBVT216WFBOWktzOW1heHNMbEI2SGxV?= =?utf-8?B?UEFpNnBUWlJveFo4Y01WbFhxeWJaTnhkcUNBWWhXb2ZKU0xYMERINTlSRnVE?= =?utf-8?B?L1VFWEpLTkswYnBoaU5nRE5WeXhnY0ZMVHM2VWhoN3hHYWU5TGNkWlZXZXpq?= =?utf-8?Q?CUZJOvLTiRHS5GzDS6utULxA6?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: c15a18dd-8122-4ecf-4e0a-08dc27fe4ac4 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2024 17:00:31.8982 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1eZ4MJLA5QiJr0AiqFUCxvCo1icYT0jILgM1J4iqREtBve6XsIMVLwIXy0Wxp/4m X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5490 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 On 2/5/2024 10:51 AM, Jie Hai wrote: > This patch adds "filter" and "names" fields to "rte_dev_reg_info" > structure. Names of registers in data fields can be reported and > the registers can be filtered by their names. > > For compatibility, the original API rte_eth_dev_get_reg_info() > does not use the name and filter fields. The new API > rte_eth_dev_get_reg_info_ext() is added to support reporting > names and filtering by names. If the drivers does not report > the names, set them to "offset_XXX". > > Signed-off-by: Jie Hai > --- > doc/guides/rel_notes/release_24_03.rst | 8 ++++++ > lib/ethdev/rte_dev_info.h | 11 ++++++++ > lib/ethdev/rte_ethdev.c | 36 ++++++++++++++++++++++++++ > lib/ethdev/rte_ethdev.h | 22 ++++++++++++++++ > 4 files changed, 77 insertions(+) > > diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst > index 84d3144215c6..5d402341223a 100644 > --- a/doc/guides/rel_notes/release_24_03.rst > +++ b/doc/guides/rel_notes/release_24_03.rst > @@ -75,6 +75,11 @@ New Features > * Added support for Atomic Rules' TK242 packet-capture family of devices > with PCI IDs: ``0x1024, 0x1025, 0x1026``. > > +* **Added support for dumping regiters with names and filter.** > s/regiters/registers/ > + > + * Added new API functions ``rte_eth_dev_get_reg_info_ext()`` to and filter > + * the registers by their names and get the information of registers(names, > + * values and other attributes). > '*' makes a bullet, but above seems one sentences, if so please only keep the first '*'. > Removed Items > ------------- > @@ -124,6 +129,9 @@ ABI Changes > > * No ABI change that would break compatibility with 23.11. > > +* ethdev: Added ``filter`` and ``names`` fields to ``rte_dev_reg_info`` > + structure for reporting names of regiters and filtering them by names. > + > This will break the ABI. Think about a case, an application compiled with an old version of DPDK, later same application started to use this version without re-compile, application will send old version of 'struct rte_dev_reg_info', but new version of DPDK will try to access or update new fields of the 'struct rte_dev_reg_info' One option is: - to add a new 'struct rte_dev_reg_info_ext', - 'rte_eth_dev_get_reg_info()' still uses old 'struct rte_dev_reg_info' - 'get_reg()' dev_ops will use this new 'struct rte_dev_reg_info_ext' - Add deprecation notice to update 'rte_eth_dev_get_reg_info()' to use new struct in next LTS release > Known Issues > ------------ > diff --git a/lib/ethdev/rte_dev_info.h b/lib/ethdev/rte_dev_info.h > index 67cf0ae52668..2f4541bd46c8 100644 > --- a/lib/ethdev/rte_dev_info.h > +++ b/lib/ethdev/rte_dev_info.h > @@ -11,6 +11,11 @@ extern "C" { > > #include > > +#define RTE_ETH_REG_NAME_SIZE 128 > +struct rte_eth_reg_name { > + char name[RTE_ETH_REG_NAME_SIZE]; > +}; > + > /* > * Placeholder for accessing device registers > */ > @@ -20,6 +25,12 @@ struct rte_dev_reg_info { > uint32_t length; /**< Number of registers to fetch */ > uint32_t width; /**< Size of device register */ > uint32_t version; /**< Device version */ > + /** > + * Filter for target subset of registers. > + * This field could affects register selection for data/length/names. > + */ > + char *filter; > + struct rte_eth_reg_name *names; /**< Registers name saver */ > }; > > /* > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index f1c658f49e80..3e0294e49092 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -6388,8 +6388,39 @@ rte_eth_read_clock(uint16_t port_id, uint64_t *clock) > > int > rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) > +{ > + struct rte_dev_reg_info reg_info; > + int ret; > + > + if (info == NULL) { > + RTE_ETHDEV_LOG_LINE(ERR, > + "Cannot get ethdev port %u register info to NULL", > + port_id); > + return -EINVAL; > + } > + > + reg_info.length = info->length; > + reg_info.data = info->data; > + reg_info.names = NULL; > + reg_info.filter = NULL; > + > + ret = rte_eth_dev_get_reg_info_ext(port_id, ®_info); > + if (ret != 0) > + return ret; > + > + info->length = reg_info.length; > + info->width = reg_info.width; > + info->version = reg_info.version; > + info->offset = reg_info.offset; > + > + return 0; > +} > + > +int > +rte_eth_dev_get_reg_info_ext(uint16_t port_id, struct rte_dev_reg_info *info) > { > struct rte_eth_dev *dev; > + uint32_t i; > int ret; > > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > @@ -6408,6 +6439,11 @@ rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info) > > rte_ethdev_trace_get_reg_info(port_id, info, ret); > > + /* Report the default names if drivers not report. */ > + if (info->names != NULL && strlen(info->names[0].name) == 0) > + for (i = 0; i < info->length; i++) > + sprintf(info->names[i].name, "offset_%x", > + info->offset + i * info->width); > Better to use 'snprintf()' > return ret; > } > > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h > index 2687c23fa6fb..3abc2ad3f865 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -5053,6 +5053,28 @@ __rte_experimental > int rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id, > struct rte_power_monitor_cond *pmc); > > +/** > + * Retrieve the filtered device registers (values and names) and > + * register attributes (number of registers and register size) > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param info > + * Pointer to rte_dev_reg_info structure to fill in. If info->data is > + * NULL, the function fills in the width and length fields. If non-NULL, > + * the values of registers whose name contains the filter string are put > + * into the buffer pointed at by the data field. Do the same for the names > + * of registers if info->names is not NULL. > May be good to mention if info->names is not NULL, but driver doesn't support names, ehtdev fills the names automatically. As both 'rte_eth_dev_get_reg_info()' & 'rte_eth_dev_get_reg_info_ext()' use same dev_ops ('get_reg()'), it is possible that driver doesn't support filtering, so if the user provides info->filter but driver doesn't support it, I think API should return error, what do you think? And can you please make it clear above, if filtering is provided with info->data = NULL, are the returned width and length fields for filtered number of registers or all registers? > + * @return > + * - (0) if successful. > + * - (-ENOTSUP) if hardware doesn't support. > + * - (-EINVAL) if bad parameter. > + * - (-ENODEV) if *port_id* invalid. > + * - (-EIO) if device is removed. > + * - others depends on the specific operations implementation. > + */ > +int rte_eth_dev_get_reg_info_ext(uint16_t port_id, struct rte_dev_reg_info *info); > + > Can you please make the new API as experimental. That is the requirement for new APIs. Also need to add the API to version.map > /** > * Retrieve device registers and register attributes (number of registers and > * register size)