[PATCH v1] net/axgbe: use CPUID to identify cpu

Ferruh Yigit ferruh.yigit at amd.com
Fri Sep 15 12:54:10 CEST 2023


On 8/31/2023 1:31 PM, Selwin Sebastian wrote:
> Using root complex to identify cpu will not work for vm passthrough.
> CPUID is used to get family and modelid to identify cpu
> 
> Fixes: b0db927b5eba ("net/axgbe: use PCI root complex device to distinguish device")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Selwin Sebastian <selwin.sebastian at amd.com>
> ---
>  drivers/net/axgbe/axgbe_ethdev.c | 102 ++++++++++++++++++-------------
>  1 file changed, 59 insertions(+), 43 deletions(-)
> 
> diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c
> index 48714eebe6..59f5d713d0 100644
> --- a/drivers/net/axgbe/axgbe_ethdev.c
> +++ b/drivers/net/axgbe/axgbe_ethdev.c
> @@ -12,6 +12,8 @@
>  
>  #include "eal_filesystem.h"
>  
> +#include <cpuid.h>
> +
>

This patch cause build errors for some non x86 architecture, because of
'cpuid.h'.

There is already a 'rte_cpuid.h' file that includes 'cpuid.h' and it is
x86 only file.

@Selwin, does it makes sense to implement the feature you are trying to
get in eal/x86 level and use that API in the driver?


For those eal/x86 APIs, they will be missing in other architectures,

@David which one is better, to implement APIs for other architectures
but those just return error, or restrict driver build to x86?



More information about the stable mailing list