Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Yevgeny Kliteynik <kliteyn@nvidia.com>,
Alex Vesker <valex@nvidia.com>,
Saeed Mahameed <saeedm@nvidia.com>
Subject: [net-next 17/17] net/mlx5: DR, Add support for update FTE
Date: Thu, 26 Aug 2021 17:58:02 -0700 [thread overview]
Message-ID: <20210827005802.236119-18-saeed@kernel.org> (raw)
In-Reply-To: <20210827005802.236119-1-saeed@kernel.org>
From: Yevgeny Kliteynik <kliteyn@nvidia.com>
Add the support for update FTE, which is needed for cases where there are
multiple rules with the same match. In such case fs_core will merge the
actions and call update FTE to update current FTE. Since we don't want to
disrupt the traffic, we will add the new duplicate rule, and only then
remove the old duplicate rule.
Signed-off-by: Alex Vesker <valex@nvidia.com>
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
.../mellanox/mlx5/core/steering/fs_dr.c | 39 ++++++++++++++-----
1 file changed, 30 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c
index 633c9ec4c84e..7e58f4e594b7 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c
@@ -625,15 +625,6 @@ static void mlx5_cmd_dr_modify_header_dealloc(struct mlx5_flow_root_namespace *n
mlx5dr_action_destroy(modify_hdr->action.dr_action);
}
-static int mlx5_cmd_dr_update_fte(struct mlx5_flow_root_namespace *ns,
- struct mlx5_flow_table *ft,
- struct mlx5_flow_group *group,
- int modify_mask,
- struct fs_fte *fte)
-{
- return -EOPNOTSUPP;
-}
-
static int mlx5_cmd_dr_delete_fte(struct mlx5_flow_root_namespace *ns,
struct mlx5_flow_table *ft,
struct fs_fte *fte)
@@ -658,6 +649,36 @@ static int mlx5_cmd_dr_delete_fte(struct mlx5_flow_root_namespace *ns,
return 0;
}
+static int mlx5_cmd_dr_update_fte(struct mlx5_flow_root_namespace *ns,
+ struct mlx5_flow_table *ft,
+ struct mlx5_flow_group *group,
+ int modify_mask,
+ struct fs_fte *fte)
+{
+ struct fs_fte fte_tmp = {};
+ int ret;
+
+ if (mlx5_dr_is_fw_table(ft->flags))
+ return mlx5_fs_cmd_get_fw_cmds()->update_fte(ns, ft, group, modify_mask, fte);
+
+ /* Backup current dr rule details */
+ fte_tmp.fs_dr_rule = fte->fs_dr_rule;
+ memset(&fte->fs_dr_rule, 0, sizeof(struct mlx5_fs_dr_rule));
+
+ /* First add the new updated rule, then delete the old rule */
+ ret = mlx5_cmd_dr_create_fte(ns, ft, group, fte);
+ if (ret)
+ goto restore_fte;
+
+ ret = mlx5_cmd_dr_delete_fte(ns, ft, &fte_tmp);
+ WARN_ONCE(ret, "dr update fte duplicate rule deletion failed\n");
+ return ret;
+
+restore_fte:
+ fte->fs_dr_rule = fte_tmp.fs_dr_rule;
+ return ret;
+}
+
static int mlx5_cmd_dr_set_peer(struct mlx5_flow_root_namespace *ns,
struct mlx5_flow_root_namespace *peer_ns)
{
--
2.31.1
prev parent reply other threads:[~2021-08-27 0:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-27 0:57 [pull request][net-next 00/17] mlx5 updates 2021-08-26 Saeed Mahameed
2021-08-27 0:57 ` [net-next 01/17] net/mlx5: DR, Added support for REMOVE_HEADER packet reformat Saeed Mahameed
2021-08-27 9:10 ` patchwork-bot+netdevbpf
2021-08-27 0:57 ` [net-next 02/17] net/mlx5: DR, Split modify VLAN state to separate pop/push states Saeed Mahameed
2021-08-27 0:57 ` [net-next 03/17] net/mlx5: DR, Enable VLAN pop on TX and VLAN push on RX Saeed Mahameed
2021-08-27 0:57 ` [net-next 04/17] net/mlx5: DR, Enable QP retransmission Saeed Mahameed
2021-08-27 0:57 ` [net-next 05/17] net/mlx5: DR, Improve error flow in actions_build_ste_arr Saeed Mahameed
2021-08-27 0:57 ` [net-next 06/17] net/mlx5: DR, Warn and ignore SW steering rule insertion on QP err Saeed Mahameed
2021-08-27 0:57 ` [net-next 07/17] net/mlx5: DR, Reduce print level for FT chaining level check Saeed Mahameed
2021-08-27 0:57 ` [net-next 08/17] net/mlx5: DR, Support IPv6 matching on flow label for STEv0 Saeed Mahameed
2021-08-27 0:57 ` [net-next 09/17] net/mlx5: DR, replace uintN_t with kernel-style types Saeed Mahameed
2021-08-27 0:57 ` [net-next 10/17] net/mlx5: DR, Use FW API when updating FW-owned flow table Saeed Mahameed
2021-08-27 0:57 ` [net-next 11/17] net/mlx5: DR, Add ignore_flow_level support for multi-dest flow tables Saeed Mahameed
2021-08-27 0:57 ` [net-next 12/17] net/mlx5: DR, Skip source port matching on FDB RX domain Saeed Mahameed
2021-08-27 0:57 ` [net-next 13/17] net/mlx5: DR, Merge DR_STE_SIZE enums Saeed Mahameed
2021-08-27 0:57 ` [net-next 14/17] net/mlx5: DR, Remove HW specific STE type from nic domain Saeed Mahameed
2021-08-27 0:58 ` [net-next 15/17] net/mlx5: DR, Remove rehash ctrl struct from dr_htbl Saeed Mahameed
2021-08-27 0:58 ` [net-next 16/17] net/mlx5: DR, Improve rule tracking memory consumption Saeed Mahameed
2021-08-27 0:58 ` Saeed Mahameed [this message]
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=20210827005802.236119-18-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=davem@davemloft.net \
--cc=kliteyn@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.com \
--cc=valex@nvidia.com \
--subject='Re: [net-next 17/17] net/mlx5: DR, Add support for update FTE' \
/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
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).