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