From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
Gal Pressman <gal@nvidia.com>,
Leon Romanovsky <leonro@nvidia.com>,
Moshe Shemesh <moshe@nvidia.com>,
Yevgeny Kliteynik <kliteyn@nvidia.com>
Subject: [net-next 04/15] net/mlx5: fs, make get_root_namespace API function
Date: Wed, 11 Sep 2024 13:17:46 -0700 [thread overview]
Message-ID: <20240911201757.1505453-5-saeed@kernel.org> (raw)
In-Reply-To: <20240911201757.1505453-1-saeed@kernel.org>
From: Moshe Shemesh <moshe@nvidia.com>
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 <kliteyn@nvidia.com>
Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
.../net/ethernet/mellanox/mlx5/core/fs_core.c | 16 ++++++++--------
include/linux/mlx5/fs.h | 3 +++
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index a47d6419160d..e32725487702 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -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);
-static struct mlx5_flow_root_namespace
-*get_root_namespace(struct mlx5_core_dev *dev, enum mlx5_flow_namespace_type ns_type)
+struct mlx5_flow_root_namespace *
+mlx5_get_root_namespace(struct mlx5_core_dev *dev, enum mlx5_flow_namespace_type ns_type)
{
struct mlx5_flow_namespace *ns;
@@ -3614,7 +3614,7 @@ struct mlx5_modify_hdr *mlx5_modify_header_alloc(struct mlx5_core_dev *dev,
struct mlx5_modify_hdr *modify_hdr;
int err;
- root = get_root_namespace(dev, ns_type);
+ root = mlx5_get_root_namespace(dev, ns_type);
if (!root)
return ERR_PTR(-EOPNOTSUPP);
@@ -3639,7 +3639,7 @@ void mlx5_modify_header_dealloc(struct mlx5_core_dev *dev,
{
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))
return;
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,
struct mlx5_flow_root_namespace *root;
int err;
- root = get_root_namespace(dev, ns_type);
+ root = mlx5_get_root_namespace(dev, ns_type);
if (!root)
return ERR_PTR(-EOPNOTSUPP);
@@ -3681,7 +3681,7 @@ void mlx5_packet_reformat_dealloc(struct mlx5_core_dev *dev,
{
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))
return;
root->cmds->packet_reformat_dealloc(root, pkt_reformat);
@@ -3703,7 +3703,7 @@ mlx5_create_match_definer(struct mlx5_core_dev *dev,
struct mlx5_flow_definer *definer;
int id;
- root = get_root_namespace(dev, ns_type);
+ root = mlx5_get_root_namespace(dev, ns_type);
if (!root)
return ERR_PTR(-EOPNOTSUPP);
@@ -3727,7 +3727,7 @@ void mlx5_destroy_match_definer(struct mlx5_core_dev *dev,
{
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))
return;
diff --git a/include/linux/mlx5/fs.h b/include/linux/mlx5/fs.h
index 3fb428ce7d1c..b744e554f014 100644
--- a/include/linux/mlx5/fs.h
+++ b/include/linux/mlx5/fs.h
@@ -342,4 +342,7 @@ void mlx5_packet_reformat_dealloc(struct mlx5_core_dev *dev,
struct mlx5_pkt_reformat *reformat);
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
--
2.46.0
next prev parent reply other threads:[~2024-09-11 20:18 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-11 20:17 [pull request][net-next 00/15] mlx5 updates 2024-09-11 Saeed Mahameed
2024-09-11 20:17 ` [net-next 01/15] net/mlx5: HWS, updated API functions comments to kernel doc Saeed Mahameed
2024-09-12 18:52 ` Jacob Keller
2024-09-13 4:00 ` patchwork-bot+netdevbpf
2024-09-11 20:17 ` [net-next 02/15] net/mlx5: HWS, fixed error flow return values of some functions Saeed Mahameed
2024-09-12 18:52 ` Jacob Keller
2024-09-11 20:17 ` [net-next 03/15] net/mlx5: fs, move steering common function to fs_cmd.h Saeed Mahameed
2024-09-12 18:53 ` Jacob Keller
2024-09-11 20:17 ` Saeed Mahameed [this message]
2024-09-12 18:54 ` [net-next 04/15] net/mlx5: fs, make get_root_namespace API function Jacob Keller
2024-09-13 3:23 ` Kalesh Anakkur Purayil
2024-09-11 20:17 ` [net-next 05/15] net/mlx5: fs, move hardware fte deletion function reset Saeed Mahameed
2024-09-12 19:01 ` Jacob Keller
2024-09-11 20:17 ` [net-next 06/15] net/mlx5: fs, remove unused member Saeed Mahameed
2024-09-12 19:06 ` Jacob Keller
2024-09-11 20:17 ` [net-next 07/15] net/mlx5: fs, separate action and destination into distinct struct Saeed Mahameed
2024-09-12 19:08 ` Jacob Keller
2024-09-11 20:17 ` [net-next 08/15] net/mlx5: fs, add support for no append at software level Saeed Mahameed
2024-09-12 19:10 ` Jacob Keller
2024-09-11 20:17 ` [net-next 09/15] net/mlx5: Add device cap for supporting hot reset in sync reset flow Saeed Mahameed
2024-09-12 19:11 ` Jacob Keller
2024-09-11 20:17 ` [net-next 10/15] net/mlx5: Add support for sync reset using hot reset Saeed Mahameed
2024-09-12 19:12 ` Jacob Keller
2024-09-11 20:17 ` [net-next 11/15] net/mlx5: Skip HotPlug check on " Saeed Mahameed
2024-09-12 19:12 ` Jacob Keller
2024-09-11 20:17 ` [net-next 12/15] net/mlx5: Allow users to configure affinity for SFs Saeed Mahameed
2024-09-12 19:13 ` Jacob Keller
2024-09-13 3:19 ` Kalesh Anakkur Purayil
2024-09-11 20:17 ` [net-next 13/15] net/mlx5: Add NOT_READY command return status Saeed Mahameed
2024-09-12 19:14 ` Jacob Keller
2024-09-13 3:20 ` Kalesh Anakkur Purayil
2024-09-11 20:17 ` [net-next 14/15] net/mlx5e: SHAMPO, Add no-split ethtool counters for header/data split Saeed Mahameed
2024-09-12 19:15 ` Jacob Keller
2024-09-11 20:17 ` [net-next 15/15] net/mlx5e: Match cleanup order in mlx5e_free_rq in reverse of mlx5e_alloc_rq Saeed Mahameed
2024-09-12 19:15 ` Jacob Keller
2024-09-13 3:53 ` [pull request][net-next 00/15] mlx5 updates 2024-09-11 Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240911201757.1505453-5-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=kliteyn@nvidia.com \
--cc=kuba@kernel.org \
--cc=leonro@nvidia.com \
--cc=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).