On 3/1/2024 3:20 PM, Thomas Monjalon wrote:
> 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 <tho...@monjalon.net>
>>>>> ---
>>>>>
>>>>> 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.
> 

ack, I will proceed with the patch for -rc2

Reply via email to