Re: [PATCH -next] vdpa: mlx5: select VHOST to fix build errors

From: Saeed Mahameed
Date: Thu Sep 17 2020 - 16:11:49 EST


On Thu, 2020-09-17 at 11:58 -0700, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
>
> drivers/vdpa/mlx5/ uses vhost_iotlb*() interfaces, so select
> VHOST to eliminate build errors.
>
> ld: drivers/vdpa/mlx5/core/mr.o: in function `add_direct_chain':
> mr.c:(.text+0x106): undefined reference to `vhost_iotlb_itree_first'
> ld: mr.c:(.text+0x1cf): undefined reference to
> `vhost_iotlb_itree_next'
> ld: mr.c:(.text+0x30d): undefined reference to
> `vhost_iotlb_itree_first'
> ld: mr.c:(.text+0x3e8): undefined reference to
> `vhost_iotlb_itree_next'
> ld: drivers/vdpa/mlx5/core/mr.o: in function `_mlx5_vdpa_create_mr':
> mr.c:(.text+0x908): undefined reference to `vhost_iotlb_itree_first'
> ld: mr.c:(.text+0x9e6): undefined reference to
> `vhost_iotlb_itree_next'
> ld: drivers/vdpa/mlx5/core/mr.o: in function
> `mlx5_vdpa_handle_set_map':
> mr.c:(.text+0xf1d): undefined reference to `vhost_iotlb_itree_first'
>
> Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
> Cc: "Michael S. Tsirkin" <mst@xxxxxxxxxx>
> Cc: Jason Wang <jasowang@xxxxxxxxxx>
> Cc: virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
> Cc: Saeed Mahameed <saeedm@xxxxxxxxxx>
> Cc: Leon Romanovsky <leonro@xxxxxxxxxx>
> Cc: netdev@xxxxxxxxxxxxxxx
> ---
> Note: This patch may not be the right thing, but it fixes the build
> errors.
>
> drivers/vdpa/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> --- linux-next-20200917.orig/drivers/vdpa/Kconfig
> +++ linux-next-20200917/drivers/vdpa/Kconfig
> @@ -32,6 +32,7 @@ config IFCVF
> config MLX5_VDPA
> bool "MLX5 VDPA support library for ConnectX devices"
> depends on MLX5_CORE
> + select VHOST

select keyword usually complicates things.
It is better if you add a dependency rather than forcing VHOST.
Just do:
depends on VHOST & MLX5_CORE

> default n
> help
> Support library for Mellanox VDPA drivers. Provides code that
> is
>