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 C5677A04AE; Tue, 8 Feb 2022 11:22:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F028410FD; Tue, 8 Feb 2022 11:22:03 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 1387B410FC for ; Tue, 8 Feb 2022 11:22:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644315722; x=1675851722; h=message-id:date:to:cc:references:from:subject: in-reply-to:content-transfer-encoding:mime-version; bh=DJLiIUYhmk65icwNr65IEtxVP6/Ld1V+Wv+49+s9IBM=; b=Trzd1jgDZv2pA5/rYjZ+qbgPIvcXGHIb0z4JO0rM3AO25ELRdw9PrF1B PeNlszBM89mMJWUR+A+AFhePs7SBdP64JeWhTkkRh0+BRZPekBo/j5NFI TQS6ywqz/JOoS7JQr56kYBCfWPheyyPJOyB3/V7dO241WjmojiAwq8443 5Ao6kkgJDpdYJTculqDM5SkJAlUEWHIhY1PV9S6w8q/w5/fynxjSlooKI URuofdFFZkZlOoRlwfciuRil1pRObs4jvjjYub25ogD/RGzsccRS/GKfL e3z3P7GEwXBNhI/bDLiV4Hh+iFpstn1sOZ3KFCJ+ImKTh8LFOUhfkahos A==; X-IronPort-AV: E=McAfee;i="6200,9189,10251"; a="229568861" X-IronPort-AV: E=Sophos;i="5.88,352,1635231600"; d="scan'208";a="229568861" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2022 02:22:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,352,1635231600"; d="scan'208";a="770943709" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga006.fm.intel.com with ESMTP; 08 Feb 2022 02:22:00 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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.2308.20; Tue, 8 Feb 2022 02:22:00 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Tue, 8 Feb 2022 02:22:00 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.44) 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.2308.20; Tue, 8 Feb 2022 02:22:00 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fwy9Uf48wO0YaLP10G9Ac8k4SZy9Ou7/cv6hpJD8WCgedHtVcjOBW4m7hcZR70MKp2o+MFGFJJRPiGh7CYUJa56fhnj1af3BJwW+8YOhDwm5kmEwOj4basAdA9oUmkP/dJeUvMCdSSiVvu1QWoGLk77/8QDnKzFHLQRo0FR0IBPKwcBZwDB2ioRvVGypB2wMRbDgGhk6NjrLmKrNx8VtqK8ueR+IWIpvF89mJPnIf60kFtW3+DSGlYDS+tgFASdSFqO8DpLvOzybIvD4F796Hj/rlTSPyQMQy+9q+qdEV/DHrG5hHNK56/tva2duqG1NdHcPZxy9NfAy2K/nbewDjw== 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=mfTTRzeOLQHVoMBDHWGLLT0UjSr8LaA+CEnIkfSxTO8=; b=QjjhJucVBi8X/Ez+NImsYs2kWUIi1eA3ArfTqolczdP6sa9OS6ANFH8sPNKh+uimpqvVVOPABY1TAkno7er+edIGUrnXF4NcgPVgYZDhdTMR3pEGrBKd5H0uU+JwgGZuLnr9qFFn1wPBW1wGCB5vWDwYRfbJGYcWjLg0pvIRXbWWBEkiwLKne6i/9QXhfCqvFtHLk3ZZqLCeliv2ZQCCwVu52q9fYvN6vjiYH8fimc6xv130BPoSPVAcX9xtxXu72/H2wzZ30doAMCfw5cZ28HwTaBFeVyvVzV8H5oFbW4XH0wRuo8eTytpwRBSAHTuKp2VH6Svhouet/3ON2KfMWA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by CO6PR11MB5618.namprd11.prod.outlook.com (2603:10b6:303:13f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.11; Tue, 8 Feb 2022 10:21:58 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e%7]) with mapi id 15.20.4951.019; Tue, 8 Feb 2022 10:21:58 +0000 Message-ID: <0c63906d-3979-f8ce-4c32-2ddfcceaf3b6@intel.com> Date: Tue, 8 Feb 2022 10:21:53 +0000 Content-Language: en-US To: "Min Hu (Connor)" , =?UTF-8?Q?Morten_Br=c3=b8rup?= , CC: Ray Kinsella , Ajit Khaparde , Thomas Monjalon , Andrew Rybchenko References: <20220111115437.32855-1-humin29@huawei.com> <20220207014719.16611-1-humin29@huawei.com> <8b129213-8d64-0b9e-8bb3-5faa8bfdd2d4@intel.com> <98CBD80474FA8B44BF855DF32C47DC35D86E79@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35D86E7A@smartserver.smartshare.dk> <8a8fbfae-7547-67e0-08ff-4faa7e9d8a50@huawei.com> From: Ferruh Yigit Subject: Re: [PATCH] ethdev: introduce ethdev dump API X-User: ferruhy In-Reply-To: <8a8fbfae-7547-67e0-08ff-4faa7e9d8a50@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P265CA0100.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2bc::12) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1735c849-f1d2-442e-5be4-08d9eaecd68b X-MS-TrafficTypeDiagnostic: CO6PR11MB5618:EE_ 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: vyz/2YNY2K+qS0nEUgrkkTEY/2fx64ilUKt7GIDzpF6ltLwZc797/g7AeWKNyoWkss0+msLCQzjmLdIasX/AzGsjUICzyfn4RRFoN3p4M8Ka26LquARywN5tU0MlTHGF2K9pFMRk9KGApZ2AgLUKA9w8kVWGROdXJwZUULVESb4H0pUBCFIQTCDcvRb4rno59oWOrPy120SNovLcAYkooBwxm+v8fu6Hp6FbYtth7A10/aeiwN6dNe0mM3/zk5ecVtOcihe0sCsNKbCgl5/TVXiMWuJG5MpZkt68vJJp1xSutyyzYu6b+I1uTiTe9cWaJ/l99wJWofXD0tyBAe0intMiD4EI8E0esQtM1TNZdNHMZJh3FS6BvagunuHMhas6D2iJ8Uy/cmVue9pTEcGiZlyOYoFSmE2ToxcQHUY66f5msbDk4lXOTBjVkCXcx0shV9A2fC8I4YXtYF7vU2T6fETmsWukymTgxKCEYN7uvoxHsMY6V/I1SqePDDUOTNUAAGmQ7dmWShloaM63W2/QMQRz9PIN8S1I7BYoZ7l0Wft4i6nf7l0Et24A8jumtuzmdSfZGYZ4Ve3V/qI0nkI7KZDOxsVAbzz8ef5XoYIl79CJkmaXO2bSc1LHCqM/RPmdeEw0fAhlqX8jy9VUkSXF522ttbDbh7E2pnbt119qVP6znJVW0Fj6aDDb78Pdes0AQvwd9+UKcHMaQh0H+3gCFA== 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:(13230001)(366004)(8676002)(8936002)(6666004)(53546011)(55236004)(508600001)(6486002)(66946007)(186003)(26005)(4326008)(66476007)(6506007)(110136005)(6512007)(316002)(2616005)(54906003)(31696002)(36756003)(31686004)(2906002)(82960400001)(86362001)(5660300002)(66574015)(38100700002)(66556008)(83380400001)(44832011)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?U1lnRkV1WWd2UE15MVpDdHNiSmJleHhZSGhydmRYOVFSWWNnVHEzeHNKZHlQ?= =?utf-8?B?cWlyTkwxekMvZmtLTWk5bE0vNERYTTl3cTNVaTA1a1V1MEI3ZFJxSjhJU2RP?= =?utf-8?B?ZWNCSjg2Z1pVWjEvVkZ0WFQ0bkRzaUZlS1RqV2RiUTZvWm5Ba0xiNTVQeUJZ?= =?utf-8?B?UzNGNU4xTDBWSG0rcXB3RXZDNkcxYVE2anZwSjBTNlQ0R0J5SGNJanBwZXZO?= =?utf-8?B?SWhoV0Z3TVNWeU9PcVlwSk9JZHhYeVNNdTdPOGt0cXY5Z3hheS9vVGJ3QTBY?= =?utf-8?B?UWoxZFYxZH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N0WHkxdzU3VTli?= =?utf-8?B?ZWZMQnh0RVdLaXQvOXc4SnJKbVRwOWhOSlhMQVd0cmIwaGFrQkZkeXV2VjB4?= =?utf-8?Q?PStXWWludsrWOYqO7MDmrvw=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 1735c849-f1d2-442e-5be4-08d9eaecd68b X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2022 10:21:58.5242 (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: /qyk5GdqfWB1W4pVeD/hlBOyH+U8o+6A6BHJbLJ6zjqpLir/sCOCeoVzaI2uhqrxKf2iD4jncyjgg8BgOsyIJw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR11MB5618 X-OriginatorOrg: intel.com 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/8/2022 12:39 AM, Min Hu (Connor) wrote: > Hi, Ferruh, > > 在 2022/2/7 23:35, Ferruh Yigit 写道: >> On 2/7/2022 12:56 PM, Morten Brørup wrote: >>>> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com] >>>> Sent: Monday, 7 February 2022 13.36 >>>> >>>> On 2/7/2022 12:18 PM, Morten Brørup wrote: >>>>>> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com] >>>>>> Sent: Monday, 7 February 2022 12.46 >>>>>> >>>>>> On 2/7/2022 1:47 AM, Min Hu (Connor) wrote: >>>>>>> Added the ethdev dump API which provides functions for query >>>> private >>>>>> info >>>>>> >>>>>> Isn't API and function are same thing in this contexts? >>>>>> >>>>>>> from device. There exists many private properties in different PMD >>>>>> drivers, >>>>>>> such as adapter state, Rx/Tx func algorithm in hns3 PMD. The >>>>>> information of >>>>>>> these properties is important for debug. As the information is >>>>>> private, >>>>>>> the new API is introduced.> >>>>>> >>>>>> In the patch title 'ethdev' is duplicated, can you fix it? >>>>>> >>>>>> >>>>>>> Signed-off-by: Min Hu (Connor) >>>>>>> Acked-by: Morten Brørup >>>>>>> Acked-by: Ray Kinsella >>>>>>> Acked-by: Ajit Khaparde >>>>> >>>>> [...] >>>>> >>>>>>> @@ -990,6 +990,20 @@ typedef int >>>> (*eth_representor_info_get_t)(struct >>>>>> rte_eth_dev *dev, >>>>>>>     typedef int (*eth_rx_metadata_negotiate_t)(struct rte_eth_dev >>>> *dev, >>>>>>>                            uint64_t *features); >>>>>>> >>>>>>> +/** >>>>>>> + * @internal >>>>>>> + * Dump ethdev private info to a file. >>>>>>> + * >>>>>> >>>>>> It doesn't dump the 'ethdev' private info, it dumps the private info >>>>>> from device. >>>>> >>>>> It seems perfectly clear to me. How would you prefer it phrased >>>> instead? >>>>> >>>> >>>> What described in the document is more accurate, >>>> "query private info from device". >>>> >>>> What we are dumping here is not ethdev private info, it is device >>>> private info, > > what is the difference between ethdev and device? It is not very clear, but for me 'ethdev' is refers to device abstract layer (ethdev library) specific private data and device refers to ethdev device (PMD) private data. ethdev is common for all drivers. >>>> and we really don't know what that data may be in the ethdev layer. >>>> >>>> Also there is a chance that 'ethdev private info' can be confused with >>>> 'ethdev->data->dev_private' > what I want to dump is exactly the 'ethdev->data->dev_private'. > 'ethdev private info' means 'ethdev->data->dev_private'. > why confused? What I understand was this API can return any device private information, it is not limited to 'ethdev->data->dev_private', (although most of the data is represented in this struct), like if you want to dump queue state, this is out of 'ethdev->data->dev_private'. >>> >>> OK. Now I got your point! The difference is very subtle. >>> >>>> >>>>> [...] >>>>> >>>>>> >>>>>>> + */ >>>>>>> +__rte_experimental >>>>>>> +int rte_eth_dev_priv_dump(FILE *file, uint16_t port_id); >>>>>>> + >>>>>> >>>>>> What do you think to have the 'port_id' as first argument to be >>>>>> consistent >>>>>> with the other APIs? >>>>> >>>>> The _dump APIs in other libraries have the file pointer as the first >>>> parameter, so let's follow that convention here too. No need to move >>>> the port_id parameter here. >>>>> >>>> >>>> Yes, for most of the _dump() APIs, file pointer seems is the first >>>> argument, >>>> bu they are from various libraries. >>>> >>>> Within the ethdev APIs, I think it makes sense that all APIs start with >>>> 'port_id' parameter for consistency, like done in: >>>> rte_flow_dev_dump(uint16_t port_id, ...) >>>> >>>>> Only rte_dma_dump() has the file pointer last, and I didn't catch it >>>> when the function was defined. >>>>> >>> >>> OK. Then I agree with you about following the convention like rte_flow_dev_dump() with the port_id first. >>> >>> I even think Connor got it right the first time, and I proposed following the other convention. >>> >> >> Ahh, may bad I missed that, sorry for not commenting on time. >> >> >>> It's not easy when there are two opposite conventions. :-) >>> >> >> Yep, that is the main issue. >> >> .