net/mlx5: improve error when group table type mismatch
PATCH 1/1 net/mlx5: improve error when group table type mismatch
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).
--- doc/guides/nics/mlx5.rst | 4 ++++ drivers/net/mlx5/mlx5_flow_hw.c | 28 ++++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-)
doc/guides/nics/mlx5.rst +4 -0
@@ -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
drivers/net/mlx5/mlx5_flow_hw.c +26 -2
@@ -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; }
Signature · 1 line
2.21.0
Hi,
Quoted 5 lines · Maayan Kashani
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. transferwire_orig) the driver returns a generic type mismatch.
Quoted 8 lines
- 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. createwire_origtablebefore the table that jumps to the group).Signed-off-by Maayan Kashani <[email protected]>
Patch applied to next-net-mlx,
Kindest regards
Raslan Darawsheh