Skip to content

Commit da2f660

Browse files
mosheshemesh2kuba-moo
authored andcommitted
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: Yevgeny Kliteynik <[email protected]> Signed-off-by: Moshe Shemesh <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Reviewed-by: Kalesh AP <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 48eb74e commit da2f660

File tree

2 files changed

+11
-8
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core
  • include/linux/mlx5

2 files changed

+11
-8
lines changed

drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3590,8 +3590,8 @@ int mlx5_fs_remove_rx_underlay_qpn(struct mlx5_core_dev *dev, u32 underlay_qpn)
35903590
}
35913591
EXPORT_SYMBOL(mlx5_fs_remove_rx_underlay_qpn);
35923592

3593-
static struct mlx5_flow_root_namespace
3594-
*get_root_namespace(struct mlx5_core_dev *dev, enum mlx5_flow_namespace_type ns_type)
3593+
struct mlx5_flow_root_namespace *
3594+
mlx5_get_root_namespace(struct mlx5_core_dev *dev, enum mlx5_flow_namespace_type ns_type)
35953595
{
35963596
struct mlx5_flow_namespace *ns;
35973597

@@ -3614,7 +3614,7 @@ struct mlx5_modify_hdr *mlx5_modify_header_alloc(struct mlx5_core_dev *dev,
36143614
struct mlx5_modify_hdr *modify_hdr;
36153615
int err;
36163616

3617-
root = get_root_namespace(dev, ns_type);
3617+
root = mlx5_get_root_namespace(dev, ns_type);
36183618
if (!root)
36193619
return ERR_PTR(-EOPNOTSUPP);
36203620

@@ -3639,7 +3639,7 @@ void mlx5_modify_header_dealloc(struct mlx5_core_dev *dev,
36393639
{
36403640
struct mlx5_flow_root_namespace *root;
36413641

3642-
root = get_root_namespace(dev, modify_hdr->ns_type);
3642+
root = mlx5_get_root_namespace(dev, modify_hdr->ns_type);
36433643
if (WARN_ON(!root))
36443644
return;
36453645
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,
36553655
struct mlx5_flow_root_namespace *root;
36563656
int err;
36573657

3658-
root = get_root_namespace(dev, ns_type);
3658+
root = mlx5_get_root_namespace(dev, ns_type);
36593659
if (!root)
36603660
return ERR_PTR(-EOPNOTSUPP);
36613661

@@ -3681,7 +3681,7 @@ void mlx5_packet_reformat_dealloc(struct mlx5_core_dev *dev,
36813681
{
36823682
struct mlx5_flow_root_namespace *root;
36833683

3684-
root = get_root_namespace(dev, pkt_reformat->ns_type);
3684+
root = mlx5_get_root_namespace(dev, pkt_reformat->ns_type);
36853685
if (WARN_ON(!root))
36863686
return;
36873687
root->cmds->packet_reformat_dealloc(root, pkt_reformat);
@@ -3703,7 +3703,7 @@ mlx5_create_match_definer(struct mlx5_core_dev *dev,
37033703
struct mlx5_flow_definer *definer;
37043704
int id;
37053705

3706-
root = get_root_namespace(dev, ns_type);
3706+
root = mlx5_get_root_namespace(dev, ns_type);
37073707
if (!root)
37083708
return ERR_PTR(-EOPNOTSUPP);
37093709

@@ -3727,7 +3727,7 @@ void mlx5_destroy_match_definer(struct mlx5_core_dev *dev,
37273727
{
37283728
struct mlx5_flow_root_namespace *root;
37293729

3730-
root = get_root_namespace(dev, definer->ns_type);
3730+
root = mlx5_get_root_namespace(dev, definer->ns_type);
37313731
if (WARN_ON(!root))
37323732
return;
37333733

include/linux/mlx5/fs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,4 +342,7 @@ void mlx5_packet_reformat_dealloc(struct mlx5_core_dev *dev,
342342
struct mlx5_pkt_reformat *reformat);
343343

344344
u32 mlx5_flow_table_id(struct mlx5_flow_table *ft);
345+
346+
struct mlx5_flow_root_namespace *
347+
mlx5_get_root_namespace(struct mlx5_core_dev *dev, enum mlx5_flow_namespace_type ns_type);
345348
#endif

0 commit comments

Comments
 (0)