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 BE5F441EAF; Thu, 16 Mar 2023 11:50:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 59A1A40FDF; Thu, 16 Mar 2023 11:50:01 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2056.outbound.protection.outlook.com [40.107.220.56]) by mails.dpdk.org (Postfix) with ESMTP id BC31240DF6; Thu, 16 Mar 2023 11:49:59 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZJ7R8Qm+Xm3X9H5NgnDrWNDxU1TRIBAkDDYDxE1am7j5CvAOqsCWQKxuIrRHGxJpLEMFI0mcmbQABwdEx4Ug/pE7gpp3TL9rltFoCAPOk+kD3ZRo+vC9TuL3rWa1u1vPsgieR4BG6CG73Gegi7X2F8+eIMTImF1cKdF7Tc1+adA7Htbr1FqFSVcfiM6GXjt025gaC1Uj6kH4hTSLXesx0Rvq/I5+1HSHMBjKPvMuVLss1G6XTld80SFWWHtKNp38bT0spK7hnxMV5ltgTu1JHfNxaMK9dDhYEP5+JFmfjzhd+vvOxPmzQksV+T4pacCcSN839jME0SE2Q/WHnQfSlw== 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=9ekUTMKdRHadKuc/EymEoxJS4Tj2s6ujKT5PajZ/EiA=; b=KppFprlE6OKfzQ8x+9HdNGk6Hvr/vDsTu5XYBVYYaOmQ91svsd22dXB0PdDHH3iloFLwOv4ZPu6dyyoisTD15v2o3+czRJeaOiLmqISej3grHQ4i3yKeSRdsQh1PFvoueDclSp7HZwB8WZ0YNAyoaoAXVow0Kt+ccCHgl3MwUo50GPz02eSi5jsLA/AOmL0+KtejbDTzTTrKb2AWqrd3Cd9phC5p0eRkvLsPhFP1WbJrHiQoflpiHgqGriUpKoJwWSIEVCnCaw2c9YW4LIS2dx2LUjZctET1/cLj3GR5kT3yNkAcbT4N/kdnGxl2tkX7xmvNIlY+t1evFti3eZFFeQ== 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=9ekUTMKdRHadKuc/EymEoxJS4Tj2s6ujKT5PajZ/EiA=; b=HKsfsnYfYRJ5WDqoEaXHZ7eAZRDiyyQPmmz5581v32g8oBeOlpLfGUfF/zwheOxaSdGxQVmibAI95iIwrwjevdW4WUkbxx8pvvQI9jdbX3FVE2sAcGQCnu9Nt31azSJ5ytH2ZMGQasl2dPJIc8wYNX+B6dn810ucKxYDXa8n7hg= 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 IA0PR12MB7650.namprd12.prod.outlook.com (2603:10b6:208:436::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.31; Thu, 16 Mar 2023 10:49:55 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640%5]) with mapi id 15.20.6178.026; Thu, 16 Mar 2023 10:49:55 +0000 Message-ID: <130d8ac9-967f-16b0-103f-84d4bcaa81f0@amd.com> Date: Thu, 16 Mar 2023 10:46:04 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US To: Dmitry Kozlyuk , fengchengwen Cc: thomas@monjalon.net, Aman Singh , Yuying Zhang , dev@dpdk.org, "techboard@dpdk.org" , Andrew Rybchenko , David Marchand , Akhil Goyal References: <20230314115035.33356-1-fengchengwen@huawei.com> <20230315023328.35980-1-fengchengwen@huawei.com> <33a601b7-8e44-6dc7-923a-27d9a74c6993@amd.com> From: Ferruh Yigit Subject: Re: [PATCH] app/testpmd: dump private info in 'show port info' In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO2P123CA0084.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:138::17) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|IA0PR12MB7650:EE_ X-MS-Office365-Filtering-Correlation-Id: d749dbdf-3e44-42c7-557e-08db260c2ddd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PnuVYx0lbjxp8FADczesbQuaPp9Wf/mX0p/Ux438Ro3kEC1SwqQnE5wu8MgZSxRUNIA4JXnDiTtJEqiQpf5H3Ftt4v80ujSFsPhijZVkkLa0TPWQh1MfAXNgJ87uZ2QtO3lry7LYeDT5a69PT2Ahwdf2ZYiLIUWw9NNMhZqLrktfF5TP/QBEd1Qb/dzyUvnnS/rsumwDQyHJHzhrczSUlPa65yBGMpXTJ4/5m/luDYIXjN0ze4PwECJeSVrlvwxd/n4lYdnGLt4HoH7xl8yX1p+HCCtc7NlWVVRtdsBla9mQ0DyewUDKoOG0vXvF71tCG/1ozOdYcA1z8kEcEan7KtKvZJ3GHEXTBa0rja+NJ+ik6OR3byk4AAEVR9IslQ3ghSXU9imPzB9GN40X0gzWpkXIiL3TuZDiDEtVHAQbHcYW8rKTaQLZXSWm3sD2JUEOBNFetoYLq56pVXuoiISCsOf3IylE+V4WObBpC+KKyk8E808WRnHWkw9o3f1LsGpQz3hRnKOa7U4frPXDoi5dZ+SksSicPR/LuSJOqZRkHtYEoem74JKsJ3wlg34hR2Q/Dahp7Su2CtyqyPkYRNyApUHo4u8NLomeqwNXykK0l1PtkEfsssKIBfheZVxUPSjS7iACxXR/VuSDzmYAirPAenrB4PcasvGBAGZWqIJEn63P+9Bz2GVaXHrAXay3k3HpHP4eU5P5hPYjDDbM47DO1znMcnctVSqxD/1Nt9js0CADsQJ3y99Wt6nvGfP5+G9k 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:(13230025)(4636009)(366004)(136003)(376002)(346002)(39860400002)(396003)(451199018)(31686004)(36756003)(5660300002)(41300700001)(7416002)(8936002)(2906002)(44832011)(31696002)(38100700002)(86362001)(478600001)(66556008)(6486002)(66476007)(8676002)(66946007)(4326008)(6506007)(6666004)(2616005)(54906003)(316002)(110136005)(83380400001)(186003)(6512007)(26005)(53546011)(21314003)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bUxmYjAwNFp3dEJ1dERRUTBIVTZKazdCQkF1OEcyc3Foa2lOYnU2L1I0WnEr?= =?utf-8?B?R3hXM2NQNFhtRWd4bzQwdUJEN0FDVDYzK1FpOUNwWEx5ckkwNldza3Fwd3V6?= =?utf-8?B?aTFmZlNqL2JEYk9Pc0VVVy84VG4xV20yS2xNU1pOek14eWlSQytIdEpvS3RQ?= =?utf-8?B?ZjlyUGlSMzljdVRWa2YzVmxqMUV0UHhCdFV4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V2JHWDBheVlrcG9wbmlCM1Mzb0NNc3JqNXlLQU40?= =?utf-8?B?YTA2WXUvUWo4ZGhWUndwZVBvYkxvRVgrODQxa3JwWk1pcVFBYzdZb0R4RW1x?= =?utf-8?Q?slgsisbyBhQ8tc6dsRlu4eNQW?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: d749dbdf-3e44-42c7-557e-08db260c2ddd X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Mar 2023 10:49:55.6343 (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: /6pU3fEbXMFCs3I8lkd9BHUcUTXnr2TGlfMmqWgLbuwFBfx1/uZAfAeKdDV+IxQ8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7650 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 3/16/2023I 9:19 AM, Dmitry Kozlyuk wrote: > On Thu, Mar 16, 2023 at 4:11 AM fengchengwen wrote: >> Because we have no API to know the PMD whether impl specific ops, we could only knowed by invoking. >> Except above impl, I also consider the other two: >> 1. just invoke rte_eth_dev_priv_dump without previous printf("Device private info") and later error printf. >> and I think people may curious about the extra output without a prompt just like "Device private info". >> 2. use fmemopen (the below code), this way will perfect process the PMD which not imp ops. >> FILE *f = fmemopen(buf, max-size(e.g. 128KB)); >> ret = rte_eth_dev_priv_dump(port_id, f); >> if (ret == 0) { >> printf("Device private info:\n"); >> printf("%s", buf); >> } >> But the windows platform don't support fmemopen. >> >> Hope for more feedback. > > What if rte_eth_dev_priv_dump() was a documented no-op when "f == NULL"? > This can be implemented in ethdev layer: > 1) if not implemented, return ENOTSUP > 2) if f == NULL, return 0 > 3) else call PMD > Technically, even now a null device handle can be used, but this is > cumbersome and wastes resources for running the API twice. Not sure about to overload "f == NULL" condition to detect the feature support. It may be good to have a generic way to detect the support. One way is to add new set of APIs just to test the dev_ops, and return boolean like: 'bool rte_eth_dev_is_priv_dump(uint16_t port_id);' Another option can be introducing an enum, each enum item can represent a dev_ops and a single API can be used to detect the support. This requires more maintenance for long term, as app needs to know more, not sure if I like this. If there is no objection to add new APIs, I can own the task, to have APIs like: 'bool rte_eth_dev_is_xxx(uint16_t port_id);'