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 56505A0C47; Mon, 13 Sep 2021 12:26:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E427040151; Mon, 13 Sep 2021 12:26:54 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id BDBB94014F for ; Mon, 13 Sep 2021 12:26:52 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 616B85C0092; Mon, 13 Sep 2021 06:26:51 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 13 Sep 2021 06:26:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= i7CE8dID7KiHMg4GHFvPyH90xTyTjXFezuxq2lCdUT8=; b=e11T3GJyB/52xNaN 3of48YBJIsj9PlUnvpmEHmUFsXA0qIhKeL4dzy9hFtYWe/kQHM0M+qVdpzJvmeq0 noNP8Lm184/bd5yNrA8Amo5HJln9xrCW9p05EZ9nR/Gcxj99n3Sl7E2z+47r/y3w E2BZZEwzVj+5s6L5ANawvq4XkwILDVLVQhLaUlnupY8cj0DgXjuFbVkRDMOnNkd6 8nRk7zQUxh6utHAL7N2GKkNzhY6HhWbJWnr5ILNrDDKk+fg7qwPjYKtIL62AZrte Eyvt2zoaac3pHhyZjoTl4J/7XsMXA0eK8sLGixeZIwAIVgzXmp5giYqQm6N1EbF6 DM2xbQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=i7CE8dID7KiHMg4GHFvPyH90xTyTjXFezuxq2lCdU T8=; b=Yuepw5fcw1NINAzZGhx71MyxEIwVTXuqP4fv1WojQZNa3Xssa1dMvagVl G9siQ73xTMbVq/9B7paniEOxT+TDtpu55s0w/ffhh+JHJaT+WdkmQ2C8fzEtRqKE Dkhovrq1DJvhq63FLqIyVIO1RaKbg2cxsFpFEwyHiLrHuUeiHOD3CTzyCksj/ZP5 6EUv6y9x34UsIOYoyY6mLJkWEqW6sgR3tn68VLWvkBfXsYX+D7XThyhalyqh8aGH pPTPIh+Wuh6oI/o1foUTLysBhNHJ3nzamK1DCpzOvfixDDfuKb4f1EM19qoc3ztd a8qktcnR5NWbqbpE1bkjXjnVXVh4g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudegjedgvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtqhertddttdejnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepkeethedtieevhfeigeejleegudefjeehkeekteeuveeiuedvveeu tdejveehveetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Sep 2021 06:26:49 -0400 (EDT) From: Thomas Monjalon To: "Min Hu (Connor)" Cc: "dev@dpdk.org" , Ferruh Yigit , Declan Doherty , Keith Wiles Date: Mon, 13 Sep 2021 12:26:47 +0200 Message-ID: <3787620.G55ntfxAi9@thomas> In-Reply-To: <29b75903-d212-c6e6-eedf-e3bc92ab816a@huawei.com> References: <29b75903-d212-c6e6-eedf-e3bc92ab816a@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] Questions about rte_eth_link_speed_to_str API 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 Sender: "dev" 13/09/2021 10:45, Min Hu (Connor): > Hi all, > I have questions about rte_eth_link_speed_to_str API. > The API converts link speed to string for display, But it only > supports the following speeds, like that: > case ETH_SPEED_NUM_NONE: return "None"; > case ETH_SPEED_NUM_10M: return "10 Mbps"; > case ETH_SPEED_NUM_100M: return "100 Mbps"; > case ETH_SPEED_NUM_1G: return "1 Gbps"; > case ETH_SPEED_NUM_2_5G: return "2.5 Gbps"; > case ETH_SPEED_NUM_5G: return "5 Gbps"; > case ETH_SPEED_NUM_10G: return "10 Gbps"; > case ETH_SPEED_NUM_20G: return "20 Gbps"; > case ETH_SPEED_NUM_25G: return "25 Gbps"; > case ETH_SPEED_NUM_40G: return "40 Gbps"; > case ETH_SPEED_NUM_50G: return "50 Gbps"; > case ETH_SPEED_NUM_56G: return "56 Gbps"; > case ETH_SPEED_NUM_100G: return "100 Gbps"; > case ETH_SPEED_NUM_200G: return "200 Gbps"; > case ETH_SPEED_NUM_UNKNOWN: return "Unknown"; > default: return "Invalid"; >=20 > In some cases, like bonding, for example, three slaves which > link speed are 10Gbps, so link speed of bonding port will be > 30Gbps, but it shows "Invalid". >=20 > Is this reasonable=EF=BC=9F any comments will be welcome. Is it meaningful to print combined slaves speed? If yes, we can do better then this fixed switch/case logic, it shouldn't be too hard given it is a standard uint32_t value.