| #
6285aa6a |
| 03-Mar-2024 |
Thomas Monjalon <thomas@monjalon.net> |
ethdev: add Linux ethtool link mode conversion
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 du
ethdev: add Linux ethtool link mode conversion
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 <thomas@monjalon.net> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
show more ...
|