Commit da2f660b authored by Moshe Shemesh's avatar Moshe Shemesh Committed by Jakub Kicinski

net/mlx5: fs, make get_root_namespace API function

As preparation for HW Steering support, where the function
get_root_namespace() is needed to get root FDB, make it an API function
and rename it to mlx5_get_root_namespace().
Reviewed-by: default avatarYevgeny Kliteynik <kliteyn@nvidia.com>
Signed-off-by: default avatarMoshe Shemesh <moshe@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Reviewed-by: default avatarKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Link: https://patch.msgid.link/20240911201757.1505453-5-saeed@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 48eb74e8
...@@ -3590,8 +3590,8 @@ int mlx5_fs_remove_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn) ...@@ -3590,8 +3590,8 @@ int mlx5_fs_remove_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn)
} }
EXPORT_SYMBOL(mlx5_fs_remove_rx_underlay_qpn); EXPORT_SYMBOL(mlx5_fs_remove_rx_underlay_qpn);
static struct mlx5_flow_root_namespace struct mlx5_flow_root_namespace *
*get_root_namespace(struct mlx5_core_dev *dev, enum mlx5_flow_namespace_type ns_type) mlx5_get_root_namespace(struct mlx5_core_dev *dev, enum mlx5_flow_namespace_type ns_type)
{ {
struct mlx5_flow_namespace *ns; struct mlx5_flow_namespace *ns;
...@@ -3614,7 +3614,7 @@ struct mlx5_modify_hdr *mlx5_modify_header_alloc(struct mlx5_core_dev *dev, ...@@ -3614,7 +3614,7 @@ struct mlx5_modify_hdr *mlx5_modify_header_alloc(struct mlx5_core_dev *dev,
struct mlx5_modify_hdr *modify_hdr; struct mlx5_modify_hdr *modify_hdr;
int err; int err;
root = get_root_namespace(dev, ns_type); root = mlx5_get_root_namespace(dev, ns_type);
if (!root) if (!root)
return ERR_PTR(-EOPNOTSUPP); return ERR_PTR(-EOPNOTSUPP);
...@@ -3639,7 +3639,7 @@ void mlx5_modify_header_dealloc(struct mlx5_core_dev *dev, ...@@ -3639,7 +3639,7 @@ void mlx5_modify_header_dealloc(struct mlx5_core_dev *dev,
{ {
struct mlx5_flow_root_namespace *root; struct mlx5_flow_root_namespace *root;
root = get_root_namespace(dev, modify_hdr->ns_type); root = mlx5_get_root_namespace(dev, modify_hdr->ns_type);
if (WARN_ON(!root)) if (WARN_ON(!root))
return; return;
root->cmds->modify_header_dealloc(root, modify_hdr); root->cmds->modify_header_dealloc(root, modify_hdr);
...@@ -3655,7 +3655,7 @@ struct mlx5_pkt_reformat *mlx5_packet_reformat_alloc(struct mlx5_core_dev *dev, ...@@ -3655,7 +3655,7 @@ struct mlx5_pkt_reformat *mlx5_packet_reformat_alloc(struct mlx5_core_dev *dev,
struct mlx5_flow_root_namespace *root; struct mlx5_flow_root_namespace *root;
int err; int err;
root = get_root_namespace(dev, ns_type); root = mlx5_get_root_namespace(dev, ns_type);
if (!root) if (!root)
return ERR_PTR(-EOPNOTSUPP); return ERR_PTR(-EOPNOTSUPP);
...@@ -3681,7 +3681,7 @@ void mlx5_packet_reformat_dealloc(struct mlx5_core_dev *dev, ...@@ -3681,7 +3681,7 @@ void mlx5_packet_reformat_dealloc(struct mlx5_core_dev *dev,
{ {
struct mlx5_flow_root_namespace *root; struct mlx5_flow_root_namespace *root;
root = get_root_namespace(dev, pkt_reformat->ns_type); root = mlx5_get_root_namespace(dev, pkt_reformat->ns_type);
if (WARN_ON(!root)) if (WARN_ON(!root))
return; return;
root->cmds->packet_reformat_dealloc(root, pkt_reformat); root->cmds->packet_reformat_dealloc(root, pkt_reformat);
...@@ -3703,7 +3703,7 @@ mlx5_create_match_definer(struct mlx5_core_dev *dev, ...@@ -3703,7 +3703,7 @@ mlx5_create_match_definer(struct mlx5_core_dev *dev,
struct mlx5_flow_definer *definer; struct mlx5_flow_definer *definer;
int id; int id;
root = get_root_namespace(dev, ns_type); root = mlx5_get_root_namespace(dev, ns_type);
if (!root) if (!root)
return ERR_PTR(-EOPNOTSUPP); return ERR_PTR(-EOPNOTSUPP);
...@@ -3727,7 +3727,7 @@ void mlx5_destroy_match_definer(struct mlx5_core_dev *dev, ...@@ -3727,7 +3727,7 @@ void mlx5_destroy_match_definer(struct mlx5_core_dev *dev,
{ {
struct mlx5_flow_root_namespace *root; struct mlx5_flow_root_namespace *root;
root = get_root_namespace(dev, definer->ns_type); root = mlx5_get_root_namespace(dev, definer->ns_type);
if (WARN_ON(!root)) if (WARN_ON(!root))
return; return;
......
...@@ -342,4 +342,7 @@ void mlx5_packet_reformat_dealloc(struct mlx5_core_dev *dev, ...@@ -342,4 +342,7 @@ void mlx5_packet_reformat_dealloc(struct mlx5_core_dev *dev,
struct mlx5_pkt_reformat *reformat); struct mlx5_pkt_reformat *reformat);
u32 mlx5_flow_table_id(struct mlx5_flow_table *ft); u32 mlx5_flow_table_id(struct mlx5_flow_table *ft);
struct mlx5_flow_root_namespace *
mlx5_get_root_namespace(struct mlx5_core_dev *dev, enum mlx5_flow_namespace_type ns_type);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment