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 4BC2141C62; Fri, 10 Feb 2023 15:42:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 395A742686; Fri, 10 Feb 2023 15:42:01 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2081.outbound.protection.outlook.com [40.107.95.81]) by mails.dpdk.org (Postfix) with ESMTP id C0BA6410D0 for ; Fri, 10 Feb 2023 15:41:59 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Us8y6L03xIpr7L5JkBKB8GNL85EsSLJ5IwCIRhKjJqQIGSHGfF847sTmcVIzhG5HDPdoC+HQVi5cie2R0K1Uuyb4btXgt10MeJbMgJpHNRrVp6rn8sb+71buz4dZpl2BdEXMPbzHJCK8ih0N8mQajKdZxaeAdCd1iD0RsGdEL9abqJI7nz3r5ldQYmscmHRRZ70MZCT9KKA904ZhdYHF+BIDJ94Lk/NXWqYKE9SWxiz1PBUBkkMQoF6+nX+1iLvTcuuOwCicUjq8J9Ot5RFQOpwQklLZCHv4ZCSnQrJL3WTqaTEo+UKqKk2Cs+mPSKSbTLiwR7zL0T66lqcgkQKBkg== 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=3MlsvSov3uoQZfzOd1x7kdIW24ulLsyQcfJEz+0d6hY=; b=PCt4Tiz3Rg/+cr7qxyCfnMdnUTN6kJ7FzVch2RU4NMZgfAH6Ekp+zRNP/GINCWVd0ByCVG+V6rLnTBPe2f3n6xcpGQbZDCMgwdNKJBuEESOh1IyxRfG621QR6E4ip0zJQu6NreFDEU4DJXJ7QeAi6EC5SXuIL1mNEz3a6cT5E6f0gibxOHbEdAWsa3F58ZBfNs/0LHwGyee0m9yDetJRmumtkLFHelh13uM+DRHtPN8BQkOP4iVYyw5TVw7kIQK9fHh6vPW8+L4pEAVYMueenyeHCbOtNEhH6+yVEascQRxzdaOpY91ysy1dJSjJm4amqAEJ4flSKHlPn1P1BgmACg== 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=3MlsvSov3uoQZfzOd1x7kdIW24ulLsyQcfJEz+0d6hY=; b=pegtTybY/5WymcGRdmO/moD+tOsKC25qT3BPcXBj8GkqgFRsukwKqleruj9S4XovA1KID5YsnNVVWijuyoaJJ2Ckt5Gg2+EehBKBEJ+vaUjCmGazynab4vcEfXUSxw9Y7tTo26Rxmd3ZehjFCfXd3fnxyPsI4RVbObLAlPXJltQ= 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 SJ2PR12MB7944.namprd12.prod.outlook.com (2603:10b6:a03:4c5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Fri, 10 Feb 2023 14:41:55 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48%8]) with mapi id 15.20.6086.021; Fri, 10 Feb 2023 14:41:55 +0000 Message-ID: <5f765461-2728-a768-8519-7c91676efd51@amd.com> Date: Fri, 10 Feb 2023 14:41:50 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [dpdk-dev] [RFC] ethdev: improve link speed to string Content-Language: en-US To: Stephen Hemminger Cc: "Min Hu (Connor)" , Andrew Rybchenko , thomas@monjalon.net, dev@dpdk.org References: <29b75903-d212-c6e6-eedf-e3bc92ab816a@huawei.com> <20210916025636.48024-1-humin29@huawei.com> <080fa0c3-c518-0e7f-f6d5-146dc9430d27@oktetlabs.ru> <7de60ca1-b652-e102-01c6-ec069ac00baa@huawei.com> <4c7d3345-1957-c85a-bf82-4c3df19f2ca8@oktetlabs.ru> <20230119084559.4828123c@hermes.local> From: Ferruh Yigit In-Reply-To: <20230119084559.4828123c@hermes.local> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0210.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:33a::13) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SJ2PR12MB7944:EE_ X-MS-Office365-Filtering-Correlation-Id: 75105fb2-c5a8-4fab-e66c-08db0b74f4bb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QXkmuydNtkmdhkbOIHgOxr125tdHiERHFvtk/VnoVz6IoS9+r1a20lDpQgRIlWS0tn21vpQ6WKrGBgbTyJw+WlsLWy17oBDgBoeOvy6HACfgk7tY8DfxRVIOv0hrV6jFE1GCXj9LapPHbXnmoczHDlJYknWXR9B3FCTI0JoQEW/VJABn/8PO3WuX7nPrmRDPXQ7IbfX4zO1ZJFLYH1FMc8lHX8bCCimW+Qo/j80vawZbXu55AlQf+TKy1rZkLNqS1M8gThRw/MzBb56Y7vwbnHCAfQrVqXcRXxpLyQsCQHAH/N4yTpIqocNsLeApQLNDhUFP/IVhCs/lw8JbK0+dWWtHxe5g5Ij0lyhZYNfYfjqZO4XrxCGmj4dnS04ksYSavaLoWpWPGrMCuWpgfad1gfKsns15ul+Pxr1SD3BFcclZLfds64ebQAJuGxpP0KGU98VTdZVFL0hD48741pm0FdoHvm9shUoFva/lOLBjXTKENWAQnMxvLejIJVZjrRhM1yRegBveDBCVje48H/VJ9FPym3X0XljmJ6KLXY6XXBkiL13nAAO+WkCbZJtlngJkb+8/dlURm5x7Le5psJV2OjOqnzyRkDU2DzyzFmWzpJHi2J1XYaG0k/up7AYDdDet4G04DFCYOGOx3jr7g7Bi+soDNfo5bqOeWgE7bf77LL87F7d8lx6UoLYry0gH8s5wJj74DiSA9JkXLQbs1GkvjbxvE2+c94pjHyU1GtKgQAQ= 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)(346002)(376002)(39860400002)(396003)(136003)(366004)(451199018)(31686004)(31696002)(26005)(6506007)(186003)(53546011)(6512007)(86362001)(6666004)(36756003)(316002)(66556008)(66476007)(66946007)(38100700002)(44832011)(54906003)(8676002)(6486002)(2616005)(478600001)(4326008)(2906002)(6916009)(83380400001)(8936002)(5660300002)(41300700001)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bmtndzZ2K0dKMEcxM0Q5bGdNSFVYUlZmaTB6bk93OFZkdTJwc0xqSmZQL1l0?= =?utf-8?B?YXpLam9vYkkyd2JtTXUzNGlZQy90RDlvZ25YallGeHNSck4xN2dKVXlpVUh4?= =?utf-8?B?NWFvWlUxckhCWnlaSkVYbnVyOG50TEJkTHY5YWxMWHpzZ3FaY3kzTFNkMGVt?= =?utf-8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TluK2VLNVZlSEU0WkwwVFVKWDJiMUVy?= =?utf-8?B?LzMvMit0cStwcTQrSHNkKy9qbi9IMUhhV2NtZFdaWTZmaHV6YXdFWVQvWGlJ?= =?utf-8?B?bW5kc2IrRnJ4S2F0Qm00b01IVmRSR0ZnUmZpdFVmcWE5OElNWTFWZFV1U2li?= =?utf-8?Q?PyU8vOr45CJkISfuYaUR/Q4WC?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 75105fb2-c5a8-4fab-e66c-08db0b74f4bb X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2023 14:41:55.6103 (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: 0gsDDRRO1xL7CF2Zv62SP6kbLp6i6HNJRasIZ7vh2phwuOc9kLkmlzxSNx3hpr89 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7944 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 1/19/2023 4:45 PM, Stephen Hemminger wrote: > On Thu, 19 Jan 2023 11:41:12 +0000 > Ferruh Yigit wrote: > >>>>>> Nothing good will happen if you try to use the function to >>>>>> print two different link speeds in one log message. >>>>> You are right. >>>>> And use malloc for "name" will result in memory leakage, which is also >>>>> not a good option. >>>>> >>>>> BTW, do you think if we need to modify the function >>>>> "rte_eth_link_speed_to_str"? >>>> >>>> IMHO it would be more pain than gain in this case. >>>> >>>> . >>>> >>> Agree with you. Thanks Andrew >>> >> >> It can be option to update the API as following in next ABI break release: >> >> const char * >> rte_eth_link_speed_to_str(uint32_t link_speed, char *buf, size_t buf_size); >> >> For this a deprecation notice needs to be sent and approved, not sure >> though if it worth. >> >> >> Meanwhile, what do you think to update string 'Invalid' to something >> like 'Irregular' or 'Erratic', does this help to convey the right message? > > > API versioning is possible here. Agree, ABI versioning can be used here. @Connor, what do you think?