xref: /openbmc/linux/drivers/vdpa/mlx5/net/mlx5_vnet.h (revision 29c37341)
1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2020 Mellanox Technologies Ltd. */
3 
4 #ifndef __MLX5_VNET_H_
5 #define __MLX5_VNET_H_
6 
7 #include <linux/vdpa.h>
8 #include <linux/virtio_net.h>
9 #include <linux/vringh.h>
10 #include <linux/mlx5/driver.h>
11 #include <linux/mlx5/cq.h>
12 #include <linux/mlx5/qp.h>
13 #include "mlx5_vdpa.h"
14 
15 static inline u32 mlx5_vdpa_max_qps(int max_vqs)
16 {
17 	return max_vqs / 2;
18 }
19 
20 #define to_mlx5_vdpa_ndev(__mvdev) container_of(__mvdev, struct mlx5_vdpa_net, mvdev)
21 void *mlx5_vdpa_add_dev(struct mlx5_core_dev *mdev);
22 void mlx5_vdpa_remove_dev(struct mlx5_vdpa_dev *mvdev);
23 
24 #endif /* __MLX5_VNET_H_ */
25