-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vdpa/mlx5: Move some definitions to a new header file
Move some definitions from mlx5_vnet.c to newly added header file mlx5_vnet.h. We need these definitions for the following patches that add debugfs tree to expose information vital for debug. Reviewed-by: Si-Wei Liu <si-wei.liu@oracle.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Eli Cohen <elic@nvidia.com> Message-Id: <20221114131759.57883-7-elic@nvidia.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
- Loading branch information
Eli Cohen
authored and
Michael S. Tsirkin
committed
Feb 21, 2023
1 parent
b16a175
commit 72c67e9
Showing
2 changed files
with
56 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ | ||
/* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */ | ||
|
||
#ifndef __MLX5_VNET_H__ | ||
#define __MLX5_VNET_H__ | ||
|
||
#include "mlx5_vdpa.h" | ||
|
||
#define to_mlx5_vdpa_ndev(__mvdev) \ | ||
container_of(__mvdev, struct mlx5_vdpa_net, mvdev) | ||
#define to_mvdev(__vdev) container_of((__vdev), struct mlx5_vdpa_dev, vdev) | ||
|
||
struct mlx5_vdpa_net_resources { | ||
u32 tisn; | ||
u32 tdn; | ||
u32 tirn; | ||
u32 rqtn; | ||
bool valid; | ||
}; | ||
|
||
#define MLX5V_MACVLAN_SIZE 256 | ||
|
||
struct mlx5_vdpa_net { | ||
struct mlx5_vdpa_dev mvdev; | ||
struct mlx5_vdpa_net_resources res; | ||
struct virtio_net_config config; | ||
struct mlx5_vdpa_virtqueue *vqs; | ||
struct vdpa_callback *event_cbs; | ||
|
||
/* Serialize vq resources creation and destruction. This is required | ||
* since memory map might change and we need to destroy and create | ||
* resources while driver in operational. | ||
*/ | ||
struct rw_semaphore reslock; | ||
struct mlx5_flow_table *rxft; | ||
struct dentry *rx_dent; | ||
struct dentry *rx_table_dent; | ||
bool setup; | ||
u32 cur_num_vqs; | ||
u32 rqt_size; | ||
bool nb_registered; | ||
struct notifier_block nb; | ||
struct vdpa_callback config_cb; | ||
struct mlx5_vdpa_wq_ent cvq_ent; | ||
struct hlist_head macvlan_hash[MLX5V_MACVLAN_SIZE]; | ||
}; | ||
|
||
struct macvlan_node { | ||
struct hlist_node hlist; | ||
struct mlx5_flow_handle *ucast_rule; | ||
struct mlx5_flow_handle *mcast_rule; | ||
u64 macvlan; | ||
}; | ||
|
||
#endif /* __MLX5_VNET_H__ */ |