diff options
author | Jiri Pirko <jiri@nvidia.com> | 2023-05-31 13:34:19 +0200 |
---|---|---|
committer | Saeed Mahameed <saeedm@nvidia.com> | 2023-08-22 21:34:17 -0700 |
commit | 2c5f33f6b9406cc092998cdc96ed015e73cb581b (patch) | |
tree | dc8e0ec58ea4cdc7615f28dbc8249d0d44c18e39 /drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | |
parent | 13f878a22c20d1c0e1d8ffa7aa97c33519b5bd7c (diff) |
net/mlx5: Embed struct devlink_port into driver structure
Struct devlink_port is usually embedded in a driver-specific struct
which allows to carry driver context to devlink port ops.
Introduce a container struct to include devlink_port struct
in preparation to also include driver context for devlink port ops.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Shay Drory <shayd@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/eswitch.h')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h index ad2ebd843ed2..b45013465738 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h @@ -172,6 +172,10 @@ enum mlx5_eswitch_vport_event { MLX5_VPORT_PROMISC_CHANGE = BIT(3), }; +struct mlx5_devlink_port { + struct devlink_port dl_port; +}; + struct mlx5_vport { struct mlx5_core_dev *dev; struct hlist_head uc_list[MLX5_L2_ADDR_HASH_SIZE]; @@ -200,7 +204,7 @@ struct mlx5_vport { bool enabled; enum mlx5_eswitch_vport_event enabled_events; int index; - struct devlink_port *dl_port; + struct mlx5_devlink_port *dl_port; }; struct mlx5_esw_indir_table; @@ -734,7 +738,7 @@ int mlx5_esw_offloads_init_pf_vf_rep(struct mlx5_eswitch *esw, u16 vport_num); void mlx5_esw_offloads_cleanup_pf_vf_rep(struct mlx5_eswitch *esw, u16 vport_num); int mlx5_esw_offloads_init_sf_rep(struct mlx5_eswitch *esw, u16 vport_num, - struct devlink_port *dl_port, + struct mlx5_devlink_port *dl_port, u32 controller, u32 sfnum); void mlx5_esw_offloads_cleanup_sf_rep(struct mlx5_eswitch *esw, u16 vport_num); @@ -743,7 +747,7 @@ void mlx5_esw_offloads_unload_rep(struct mlx5_eswitch *esw, u16 vport_num); int mlx5_eswitch_load_sf_vport(struct mlx5_eswitch *esw, u16 vport_num, enum mlx5_eswitch_vport_event enabled_events, - struct devlink_port *dl_port, u32 controller, u32 sfnum); + struct mlx5_devlink_port *dl_port, u32 controller, u32 sfnum); void mlx5_eswitch_unload_sf_vport(struct mlx5_eswitch *esw, u16 vport_num); int mlx5_eswitch_load_vf_vports(struct mlx5_eswitch *esw, u16 num_vfs, @@ -754,7 +758,7 @@ int mlx5_esw_offloads_pf_vf_devlink_port_init(struct mlx5_eswitch *esw, u16 vpor void mlx5_esw_offloads_pf_vf_devlink_port_cleanup(struct mlx5_eswitch *esw, u16 vport_num); int mlx5_esw_offloads_sf_devlink_port_init(struct mlx5_eswitch *esw, u16 vport_num, - struct devlink_port *dl_port, + struct mlx5_devlink_port *dl_port, u32 controller, u32 sfnum); void mlx5_esw_offloads_sf_devlink_port_cleanup(struct mlx5_eswitch *esw, u16 vport_num); |