aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorYishai Hadas <yishaih@mellanox.com>2019-12-12 13:09:25 +0200
committerLeon Romanovsky <leonro@mellanox.com>2020-01-10 20:25:32 +0200
commitca1992c62cadb6c8e1e1b47e197b550f3cd89b76 (patch)
tree04d67af7ec50c770958a9025d611dfd9193f4562 /drivers/net
parentnet/mlx5: Add Virtio Emulation related device capabilities (diff)
downloadlinux-dev-ca1992c62cadb6c8e1e1b47e197b550f3cd89b76.tar.xz
linux-dev-ca1992c62cadb6c8e1e1b47e197b550f3cd89b76.zip
net/mlx5: Expose vDPA emulation device capabilities
Expose vDPA emulation device capabilities from the core layer. It includes reading the capabilities from the firmware and exposing helper functions to access the data. Signed-off-by: Yishai Hadas <yishaih@mellanox.com> Reviewed-by: Shahaf Shuler <shahafs@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/fw.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fw.c b/drivers/net/ethernet/mellanox/mlx5/core/fw.c
index a19790dee7b2..c375edfe528c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fw.c
@@ -245,6 +245,13 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev)
return err;
}
+ if (MLX5_CAP_GEN_64(dev, general_obj_types) &
+ MLX5_GENERAL_OBJ_TYPES_CAP_VIRTIO_NET_Q) {
+ err = mlx5_core_get_caps(dev, MLX5_CAP_VDPA_EMULATION);
+ if (err)
+ return err;
+ }
+
return 0;
}