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 5209A4241E; Thu, 19 Jan 2023 17:46:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 43E3440223; Thu, 19 Jan 2023 17:46:03 +0100 (CET) Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by mails.dpdk.org (Postfix) with ESMTP id 2497E400D5 for ; Thu, 19 Jan 2023 17:46:02 +0100 (CET) Received: by mail-pj1-f43.google.com with SMTP id z9-20020a17090a468900b00226b6e7aeeaso2343838pjf.1 for ; Thu, 19 Jan 2023 08:46:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=Lps0yIeniaF9mvX4Hq0jPSkNmKsEVy9GvCT84UC2t4M=; b=ik9dhOIRQ+r5kx4ZrMlcsPyk3lG6UAgHxA8BFT4p/PYsUm6IAqlXYUysjNdGZk2jFc zHNI2sz67svudwxveGf2EDfJCPisRH3vMD07ayTsgEhQWgU3RD7szSM0/2n8lKZy4pv7 16dUbidhSJptV50if/499Uvv3SvAcBLIQ7mH/cujHsJPsuE+sUWziAPap8649VsXZSZk Xoj1CnywZZfpIx3s7Vfv3znNE0a0A8STFCGid7yfpFUgqqj97Z0ACfTPmFGwVTixy5NA BrWbvclj1FYoaaHp3m2L/OaUxiFLwc0NOmFiKvVkUsy//DiB+b2k+8rzmm5VDBQ49P64 yQiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Lps0yIeniaF9mvX4Hq0jPSkNmKsEVy9GvCT84UC2t4M=; b=WE1sf06o+fuw6MjkIJQgPYXk+Zd6ho63b1/geqAx8NHOHq9Z92NSnfWbJzrlil18k9 RTgzJtphCBIaPTjsHzHZc4u6hByefDixEtbp91I9jLGMymNlr7mMYzRWS2j8CCNuQYMx Gq9FT1cfnIKDrwwlsxe3Mn9ZpK9VYPkvrInIvI3Mgw04+6y9NBfBmjjzN23IU5NTY7gS L2g4ez4rofhMdj4YEJi9JW7qva+mbvWkmNwH97adG+3mry0hZIxKU22jrLcdJPBoOHGn PgDGJmuk+cvOTOiC9EAWVdOrFL0NaMWSpmoIIS/2IZ+J1+0P3WgpEWDSD083DvH2Egc4 A56Q== X-Gm-Message-State: AFqh2kqbcGdjzysd998Z2I4zv0wmuNZFkPGQMZETEPcAEM+R8dNxZG5O eOjRzt3Td8BIlZMHlZunVSmxcw== X-Google-Smtp-Source: AMrXdXtx3u+yfEmgljikUiFz0BGOwxsq5VNl/rv+3gk7h1pNHPwwM9Bi/ZM6+CvpbFb20YgjuCORTw== X-Received: by 2002:a17:903:428b:b0:192:feeb:b06d with SMTP id ju11-20020a170903428b00b00192feebb06dmr32058800plb.62.1674146761355; Thu, 19 Jan 2023 08:46:01 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id a4-20020a655c84000000b004d1ac8e31fbsm1761122pgt.55.2023.01.19.08.46.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 08:46:01 -0800 (PST) Date: Thu, 19 Jan 2023 08:45:59 -0800 From: Stephen Hemminger To: Ferruh Yigit Cc: "Min Hu (Connor)" , Andrew Rybchenko , thomas@monjalon.net, dev@dpdk.org Subject: Re: [dpdk-dev] [RFC] ethdev: improve link speed to string Message-ID: <20230119084559.4828123c@hermes.local> In-Reply-To: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 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.