DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maayan Kashani <mkashani@nvidia.com>
To: <dev@dpdk.org>
Cc: <mkashani@nvidia.com>, <dsosnowski@nvidia.com>,
	<rasland@nvidia.com>, "Bing Zhao" <bingz@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	"Ori Kam" <orika@nvidia.com>, Suanming Mou <suanmingm@nvidia.com>,
	Matan Azrad <matan@nvidia.com>
Subject: [PATCH v3 02/11] net/mlx5: add dummy last action
Date: Mon, 3 Jun 2024 13:48:41 +0300	[thread overview]
Message-ID: <20240603104850.9935-2-mkashani@nvidia.com> (raw)
In-Reply-To: <20240603104850.9935-1-mkashani@nvidia.com>

From: Bing Zhao <bingz@nvidia.com>

The RTE_FLOW_ACTION_TYPE_END action needs to be translated into the
MLX5DR_ACTION_TYP_LAST for the future usage. It is only needed in
the hardware steering backward compatible API.

Signed-off-by: Bing Zhao <bingz@nvidia.com>
---
 drivers/net/mlx5/mlx5.h         |  1 +
 drivers/net/mlx5/mlx5_flow_hw.c | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 92ad33d486..0d30e7ab36 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -1509,6 +1509,7 @@ struct mlx5_dev_ctx_shared {
 	/* Direct Rules tables for FDB, NIC TX+RX */
 	void *dr_drop_action; /* Pointer to DR drop action, any domain. */
 	void *pop_vlan_action; /* Pointer to DR pop VLAN action. */
+	void *hw_dummy_last; /* Pointer to the DR dummy end action, any domain. */
 #if defined(HAVE_IBV_FLOW_DV_SUPPORT) || !defined(HAVE_INFINIBAND_VERBS_H)
 	struct mlx5_send_to_kernel_action send_to_kernel_action[MLX5DR_TABLE_TYPE_MAX];
 #endif
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index efd2141913..015622f3bf 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -10639,6 +10639,17 @@ flow_hw_configure(struct rte_eth_dev *dev,
 		if (ret)
 			goto err;
 	}
+	/*
+	 * All domains will use the same dummy action, only used in the backward
+	 * compatible API. Initialize it for only once. No order dependency.
+	 */
+	if (!priv->sh->hw_dummy_last) {
+		priv->sh->hw_dummy_last = mlx5dr_action_create_last(priv->dr_ctx,
+								    MLX5DR_ACTION_FLAG_HWS_RX);
+		if (!priv->sh->hw_dummy_last)
+			/* Do not overwrite the rte_errno. */
+			goto err;
+	}
 	if (!priv->shared_host)
 		flow_hw_create_send_to_kernel_actions(priv);
 	if (port_attr->nb_conn_tracks || (host_priv && host_priv->hws_ctpool)) {
@@ -10717,6 +10728,10 @@ flow_hw_configure(struct rte_eth_dev *dev,
 		flow_hw_ct_mng_destroy(dev, priv->ct_mng);
 		priv->ct_mng = NULL;
 	}
+	if (priv->sh->hw_dummy_last) {
+		mlx5dr_action_destroy(priv->sh->hw_dummy_last);
+		priv->sh->hw_dummy_last = NULL;
+	}
 	flow_hw_destroy_send_to_kernel_action(priv);
 	flow_hw_cleanup_ctrl_fdb_tables(dev);
 	flow_hw_free_vport_actions(priv);
@@ -10832,6 +10847,10 @@ flow_hw_resource_release(struct rte_eth_dev *dev)
 		mlx5dr_action_destroy(priv->hw_def_miss);
 	flow_hw_destroy_nat64_actions(priv);
 	flow_hw_destroy_vlan(dev);
+	if (priv->sh->hw_dummy_last) {
+		mlx5dr_action_destroy(priv->sh->hw_dummy_last);
+		priv->sh->hw_dummy_last = NULL;
+	}
 	flow_hw_destroy_send_to_kernel_action(priv);
 	flow_hw_free_vport_actions(priv);
 	if (priv->acts_ipool) {
-- 
2.25.1


  reply	other threads:[~2024-06-03 10:49 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-02 10:28 [PATCH 01/11] net/mlx5: initial design of non template to hws Maayan Kashani
2024-06-03  8:04 ` [PATCH v2 05/34] " Maayan Kashani
2024-06-03  8:04   ` [PATCH v2 06/34] net/mlx5: add dummy last action Maayan Kashani
2024-06-03  8:04   ` [PATCH v2 07/34] net/mlx5: add basic actions support for non-template API Maayan Kashani
2024-06-03  8:04   ` [PATCH v2 08/34] net/mlx5: add default miss action support in nt2hws mode Maayan Kashani
2024-06-03  8:04   ` [PATCH v2 09/34] net/mlx5: add ASO actions support to non-template mode Maayan Kashani
2024-06-03  8:04   ` [PATCH v2 10/34] net/mlx5: fix segfault on counter pool destroy Maayan Kashani
2024-06-03  8:05   ` [PATCH v2 11/34] net/mlx5: abstract action handling and enable reconfigure Maayan Kashani
2024-06-03  8:05   ` [PATCH v2 12/34] common/mlx5: read connection tracking attributes Maayan Kashani
2024-06-03  8:05   ` [PATCH v2 13/34] net/mlx5: support bulk actions in non template mode Maayan Kashani
2024-06-03  8:05   ` [PATCH v2 14/34] net/mlx5: use non const max number for ASO actions Maayan Kashani
2024-06-03  8:05   ` [PATCH v2 15/34] net/mlx5: initial design changes Maayan Kashani
2024-06-03 10:48 ` [PATCH v3 01/11] net/mlx5: initial design of non template to hws Maayan Kashani
2024-06-03 10:48   ` Maayan Kashani [this message]
2024-06-03 10:48   ` [PATCH v3 03/11] net/mlx5: add basic actions support for non-template API Maayan Kashani
2024-06-03 10:48   ` [PATCH v3 04/11] net/mlx5: add default miss action support in nt2hws mode Maayan Kashani
2024-06-03 10:48   ` [PATCH v3 05/11] net/mlx5: add ASO actions support to non-template mode Maayan Kashani
2024-06-03 10:48   ` [PATCH v3 06/11] net/mlx5: fix segfault on counter pool destroy Maayan Kashani
2024-06-03 10:48   ` [PATCH v3 07/11] net/mlx5: abstract action handling and enable reconfigure Maayan Kashani
2024-06-03 10:48   ` [PATCH v3 08/11] common/mlx5: read connection tracking attributes Maayan Kashani
2024-06-03 10:48   ` [PATCH v3 09/11] net/mlx5: support bulk actions in non template mode Maayan Kashani
2024-06-03 10:48   ` [PATCH v3 10/11] net/mlx5: use non const max number for ASO actions Maayan Kashani
2024-06-03 10:48   ` [PATCH v3 11/11] net/mlx5: initial design changes Maayan Kashani
2024-06-06 10:23   ` [PATCH v4 00/11] non-template pmd basic func Maayan Kashani
2024-06-06 10:23     ` [PATCH v4 01/11] net/mlx5: initial design of non template to hws Maayan Kashani
2024-06-06 10:23     ` [PATCH v4 02/11] net/mlx5: add dummy last action Maayan Kashani
2024-06-06 10:23     ` [PATCH v4 03/11] net/mlx5: add basic actions support for non-template API Maayan Kashani
2024-06-06 10:23     ` [PATCH v4 04/11] net/mlx5: add default miss action support in nt2hws mode Maayan Kashani
2024-06-06 10:23     ` [PATCH v4 05/11] net/mlx5: add ASO actions support to non-template mode Maayan Kashani
2024-06-06 10:23     ` [PATCH v4 06/11] net/mlx5: fix segfault on counter pool destroy Maayan Kashani
2024-06-06 10:23     ` [PATCH v4 07/11] net/mlx5: abstract action handling and enable reconfigure Maayan Kashani
2024-06-06 10:23     ` [PATCH v4 08/11] common/mlx5: read connection tracking attributes Maayan Kashani
2024-06-06 10:23     ` [PATCH v4 09/11] net/mlx5: support bulk actions in non template mode Maayan Kashani
2024-06-06 10:23     ` [PATCH v4 10/11] net/mlx5: use non const max number for ASO actions Maayan Kashani
2024-06-06 10:23     ` [PATCH v4 11/11] net/mlx5: initial design changes Maayan Kashani
2024-06-06 12:32     ` [PATCH v5 01/11] net/mlx5: initial design of non template to hws Maayan Kashani
2024-06-06 12:32       ` [PATCH v5 02/11] net/mlx5: add dummy last action Maayan Kashani
2024-06-06 12:32       ` [PATCH v5 03/11] net/mlx5: add basic actions support for non-template API Maayan Kashani
2024-06-06 12:32       ` [PATCH v5 04/11] net/mlx5: add default miss action support in nt2hws mode Maayan Kashani
2024-06-06 12:32       ` [PATCH v5 05/11] net/mlx5: add ASO actions support to non-template mode Maayan Kashani
2024-06-06 12:32       ` [PATCH v5 06/11] net/mlx5: fix segfault on counter pool destroy Maayan Kashani
2024-06-06 12:32       ` [PATCH v5 07/11] net/mlx5: abstract action handling and enable reconfigure Maayan Kashani
2024-06-06 12:32       ` [PATCH v5 08/11] common/mlx5: read connection tracking attributes Maayan Kashani
2024-06-06 12:32       ` [PATCH v5 09/11] net/mlx5: support bulk actions in non template mode Maayan Kashani
2024-06-06 12:32       ` [PATCH v5 10/11] net/mlx5: use non const max number for ASO actions Maayan Kashani
2024-06-06 12:32       ` [PATCH v5 11/11] net/mlx5: initial design changes Maayan Kashani
2024-06-09  8:55       ` [PATCH v6 01/11] net/mlx5: initial design of non template to hws Maayan Kashani
2024-06-09  8:55         ` [PATCH v6 02/11] net/mlx5: add dummy last action Maayan Kashani
2024-06-09  8:55         ` [PATCH v6 03/11] net/mlx5: add basic actions support for non-template API Maayan Kashani
2024-06-09  8:55         ` [PATCH v6 04/11] net/mlx5: add default miss action support in nt2hws mode Maayan Kashani
2024-06-09  8:55         ` [PATCH v6 05/11] net/mlx5: add ASO actions support to non-template mode Maayan Kashani
2024-06-09  8:55         ` [PATCH v6 06/11] net/mlx5: fix segfault on counter pool destroy Maayan Kashani
2024-06-09  8:55         ` [PATCH v6 07/11] net/mlx5: abstract action handling and enable reconfigure Maayan Kashani
2024-06-09  8:55         ` [PATCH v6 08/11] common/mlx5: read connection tracking attributes Maayan Kashani
2024-06-09  8:55         ` [PATCH v6 09/11] net/mlx5: support bulk actions in non template mode Maayan Kashani
2024-06-09  8:55         ` [PATCH v6 10/11] net/mlx5: use non const max number for ASO actions Maayan Kashani
2024-06-09  8:56         ` [PATCH v6 11/11] net/mlx5: initial design changes Maayan Kashani
2024-06-09 11:00         ` [PATCH v7 01/11] net/mlx5: initial design of non template to hws Maayan Kashani
2024-06-09 11:00           ` [PATCH v7 02/11] net/mlx5: add dummy last action Maayan Kashani
2024-06-09 11:00           ` [PATCH v7 03/11] net/mlx5: add basic actions support for non-template API Maayan Kashani
2024-06-09 11:01           ` [PATCH v7 04/11] net/mlx5: add default miss action support in nt2hws mode Maayan Kashani
2024-06-09 11:01           ` [PATCH v7 05/11] net/mlx5: add ASO actions support to non-template mode Maayan Kashani
2024-06-09 11:01           ` [PATCH v7 06/11] net/mlx5: fix segfault on counter pool destroy Maayan Kashani
2024-06-09 11:01           ` [PATCH v7 07/11] net/mlx5: abstract action handling and enable reconfigure Maayan Kashani
2024-06-09 11:01           ` [PATCH v7 08/11] common/mlx5: read connection tracking attributes Maayan Kashani
2024-06-09 11:01           ` [PATCH v7 09/11] net/mlx5: support bulk actions in non template mode Maayan Kashani
2024-06-09 11:01           ` [PATCH v7 10/11] net/mlx5: use non const max number for ASO actions Maayan Kashani
2024-06-09 11:01           ` [PATCH v7 11/11] net/mlx5: initial design changes Maayan Kashani
2024-06-10  8:34           ` [PATCH v7 01/11] net/mlx5: initial design of non template to hws Raslan Darawsheh

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=20240603104850.9935-2-mkashani@nvidia.com \
    --to=mkashani@nvidia.com \
    --cc=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=suanmingm@nvidia.com \
    --cc=viacheslavo@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).