public inbox for dev@dpdk.org
 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>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	Bing Zhao <bingz@nvidia.com>, Ori Kam <orika@nvidia.com>,
	Suanming Mou <suanmingm@nvidia.com>,
	Matan Azrad <matan@nvidia.com>
Subject: [PATCH] net/mlx5: improve error when group table type mismatch
Date: Wed, 25 Mar 2026 23:54:25 +0200	[thread overview]
Message-ID: <20260325215426.9519-1-mkashani@nvidia.com> (raw)

HWS fixes a flow group's DR table type (FDB_UNIFIED,
FDB_RX, FDB_TX, etc.) on first use.
If a later table uses the same group with a different domain
(e.g. transfer wire_orig) the driver returns a generic type mismatch.

- Add mlx5dr_table_type_name() to map table type enum to readable strings
(e.g. FDB_RX(wire_orig), FDB_UNIFIED).

This makes it easier to fix ordering issues
(e.g. create wire_origtable before the table that jumps to the group).

Signed-off-by: Maayan Kashani <mkashani@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 doc/guides/nics/mlx5.rst        |  4 ++++
 drivers/net/mlx5/mlx5_flow_hw.c | 28 ++++++++++++++++++++++++++--
 2 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index 9dcc93cc235..a350fdaa160 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -2493,6 +2493,10 @@ DPDK       24.11
 Limitations
 ^^^^^^^^^^^
 
+#. With the async template API, the target table must be pre-created
+   before adding a jump action that redirects to a specialized table.
+   The jump will fail if the destination table does not exist yet.
+
 #. With the async template API, jumping to a template table
    with ``RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_WIRE_ORIG`` specialization
    from a template table with a different specialization
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 041066a94f7..a341cdd34d4 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -322,6 +322,21 @@ get_mlx5dr_table_type(const struct rte_flow_attr *attr, uint32_t specialize,
 	return type;
 }
 
+/** Human-readable name for mlx5dr_table_type (for error messages). */
+static inline const char *
+mlx5dr_table_type_name(enum mlx5dr_table_type type)
+{
+	switch (type) {
+	case MLX5DR_TABLE_TYPE_NIC_RX: return "NIC_RX";
+	case MLX5DR_TABLE_TYPE_NIC_TX: return "NIC_TX";
+	case MLX5DR_TABLE_TYPE_FDB: return "FDB";
+	case MLX5DR_TABLE_TYPE_FDB_RX: return "FDB_RX(wire_orig)";
+	case MLX5DR_TABLE_TYPE_FDB_TX: return "FDB_TX(vf_orig)";
+	case MLX5DR_TABLE_TYPE_FDB_UNIFIED: return "FDB_UNIFIED";
+	default: return "unknown";
+	}
+}
+
 /* Non template default queue size used for inner ctrl queue. */
 #define MLX5_NT_DEFAULT_QUEUE_SIZE 32
 
@@ -5312,8 +5327,17 @@ flow_hw_table_create(struct rte_eth_dev *dev,
 	/* Verify unified fdb sub domains consistency */
 	table_type = get_mlx5dr_table_type(&flow_attr, specialize, unified_fdb);
 	if (table_type != grp->type) {
-		DRV_LOG(ERR, "Table type (%u) does not match group id (%u) type (%u)",
-			table_type, grp->group_id, grp->type);
+		DRV_LOG(ERR,
+			"Group %u table type mismatch: group type is fixed on first use. "
+			"This table requires %s but group was first used as %s. "
+			"Create tables with transfer wire_orig or vf_orig before tables jumping to it.",
+			grp->group_id,
+			mlx5dr_table_type_name(table_type),
+			mlx5dr_table_type_name(grp->type));
+		rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ATTR_GROUP,
+				   NULL,
+				   "group table type mismatch: type is fixed on first use; "
+				   "create transfer wire_orig/vf_orig tables before tables jumping to it");
 		rte_errno = EINVAL;
 		goto error;
 	}
-- 
2.21.0


                 reply	other threads:[~2026-03-25 21:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260325215426.9519-1-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