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 407B643C0C; Fri, 1 Mar 2024 16:21:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 30FF742830; Fri, 1 Mar 2024 16:21:02 +0100 (CET) Received: from fout1-smtp.messagingengine.com (fout1-smtp.messagingengine.com [103.168.172.144]) by mails.dpdk.org (Postfix) with ESMTP id 53302427D8 for ; Fri, 1 Mar 2024 16:21:00 +0100 (CET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfout.nyi.internal (Postfix) with ESMTP id 9B0611380104; Fri, 1 Mar 2024 10:20:59 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 01 Mar 2024 10:20:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1709306459; x=1709392859; bh=cukyxjq9tW92umAWXaSn20rSxZ3iKC86HoMSaOpbZX4=; b= Kl0JfPl2QnCi9efAfYg6Zc5K4yq8tkXqrZPprcjD5Z5R5KuhWhgHaUWMeoFH7Rup RtS5tdSbVpTZQWmfnawXGzLzkcgKE524kYcWfD6riFETNIT03VIqwDNcCB1iInAG p3cR4nGIQcBNV22hfP5o9BNuhp3W4sToftZmL/2x63K1yNqIgkyKbF7HRSgsetGj oavK5x2+r5g92DYdXBQrKA1u6qZjjWa+3PHowytfgFZ94wDo/AWjhxW4y5C1bw6C CBvEJ4kfchcMZXis/E/dYv7LWhWomSeFvJKWSnjzHY4gbzgidHjwYB81/Q4U7Q4e 49CBfcoR/b15CIwOnUEjgQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1709306459; x= 1709392859; bh=cukyxjq9tW92umAWXaSn20rSxZ3iKC86HoMSaOpbZX4=; b=c MsEMEbhXJQ6e4UtQtgIVAHsrtr06PEwvDS6sEINv+bZSD+8+7cNxc56aB5pI72Ek mZRINcRgfLk4oDHQrkcBiyPqCm622St/fZOtSUop1vYoGV8tegAqMe/j48a4AoUp mip8hTQXA36RpOO4deQvJP7fqVZs1bwbUxAn/qReJZPQOjet/VYMV3D7ZDbKvTS+ s2AHzQ8GD3+svt+GTvp93i9FQnifCUYQZeK/attCLmhDEfyfoBvzlV1HCX4kaENd i2Y7ukll4geiWHL3YcD0TCvigJNw5UhzjoNDcPFvw3TkUlOTC8SQhuEmS4QAuUGA wv1E+uusZ20jNDCpuA2Dg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrhedugdejgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnheptdejieeifeehtdffgfdvleetueeffeehueejgfeuteeftddtieek gfekudehtdfgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Mar 2024 10:20:58 -0500 (EST) From: Thomas Monjalon To: Ferruh Yigit Cc: dev@dpdk.org, Andrew Rybchenko Subject: Re: [PATCH v2] ethdev: add Linux ethtool link mode conversion Date: Fri, 01 Mar 2024 16:20:56 +0100 Message-ID: <1743963.yIU609i1g2@thomas> In-Reply-To: <14dcf7c4-2e9d-459e-b701-5f26ab4174a1@amd.com> References: <20240229123653.1379466-1-thomas@monjalon.net> <3271586.N7aMVyhfb1@thomas> <14dcf7c4-2e9d-459e-b701-5f26ab4174a1@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 01/03/2024 16:08, Ferruh Yigit: > On 3/1/2024 1:37 PM, Thomas Monjalon wrote: > > 01/03/2024 14:12, Ferruh Yigit: > >> On 2/29/2024 3:42 PM, Thomas Monjalon wrote: > >>> Speed capabilities of a NIC may be discovered through its Linux > >>> kernel driver. It is especially useful for bifurcated drivers, > >>> so they don't have to duplicate the same logic in the DPDK driver. > >>> > >>> Parsing ethtool speed capabilities is made easy thanks to > >>> the functions added in ethdev for internal usage only. > >>> Of course these functions work only on Linux, > >>> so they are not compiled in other environments. > >>> > >>> In order to ease parsing, the ethtool macro names are parsed > >>> externally in a shell command which generates a C array > >>> included in this patch. > >>> It also avoids to depend on a kernel version. > >>> This C array should be updated in future to get latest ethtool bits. > >>> Note it is easier to update this array than adding new cases > >>> in a parsing code. > >>> > >>> The types in the functions are following the ethtool type: > >>> uint32_t for bitmaps, and int8_t for the number of 32-bitmaps. > >>> > >>> Signed-off-by: Thomas Monjalon > >>> --- > >>> > >>> A follow-up patch will be sent to use these functions in mlx5. > >>> I suspect mana could use this parsing as well. > >>> > >> > >> Is the usecase driver get link info via ibverbs and convert it to DPDK > >> link info? > > > > The use case is to get capabilities from the kernel driver via ethtool ioctl. > > > > Sure, as it is adding kernel ethtool conversion, DPDK driver will get > link from kernel driver, thanks for clarification. Yes the PMD uses ethtool API to get device capabilies. > >> How complex or duplicated effort to get link info directly via DPDK > >> functions? > > > > This is done by the driver. > > This is how mlx5 driver is getting speed capabilities. > > > >> Because this approach is can be applied to only limited devices in DPDK > >> and solving an issue DPDK already has a solution, does it worth to the > >> code it adds? > > > > It is going to replace code in mlx5 driver. > > I could add this code in mlx5 driver, > > but it could help other drivers in future like mana. > > Why replace, is there anything to fix in the DPDK link get code? There is nothing to fix in ethdev layer. I want to replace PMD code doing ethtool queries with something cleaner and easier to update.