DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/5] net/mlx5: fix the table flags of mirror action
@ 2025-06-17 13:39 Gregory Etelson
  2025-06-17 13:39 ` [PATCH 2/5] net/mlx5: add mlx5_hw_create_mirror function Gregory Etelson
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Gregory Etelson @ 2025-06-17 13:39 UTC (permalink / raw)
  To: dev
  Cc: getelson,  ,
	rasland, Bing Zhao, ophirmu, Dariusz Sosnowski,
	Viacheslav Ovsiienko, Ori Kam, Suanming Mou, Matan Azrad

From: Bing Zhao <bingz@nvidia.com>

The HWS mirror action is created with STCs based on the flags. In the
past, there was a single type of FDB domain. After introducing the
unified FDB feature, there are 4 types of tables in FDB domain,
including FDB, FDB_RX, FDB_TX and FDB_UNIFIED. More STCs will be
allocated when the new FDB flags are set.

Without specifying the group ID, the default 0 would be used to
determine the table type. Since only the old FDB type was supported
on the root table. The flag was set wrongly and the STCs for other
FDB sub-types were not allocated.

When using this mirror action to create a flow in the unified FDB,
there are some errors:

  1. If there is no other action STC allocated before, the offsets
     of old FDB and unified FDB will be the same. But the value of
     the mirror is zero. The mirror action is not really applied even
     if no error is observed when pulling the result.
  2. If there is some other action STC allocated before, the offset
     0 will reflact that action but not the mirror itself. An error
     will be observed for the rule insertion.

Since the mirror is only supported in HWS non-root tables, setting
the group to some non-zero value will make STCs be allocated and
used properly.

Fixes: 8daf5794077f ("net/mlx5: support FDB unified domain")
Cc: ophirmu@nvidia.com

Signed-off-by: Bing Zhao <bingz@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index af2e7a84a5..a8a3f3872a 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -14803,7 +14803,7 @@ flow_hw_async_action_list_handle_create(struct rte_eth_dev *dev, uint32_t queue,
 	enum mlx5_indirect_list_type list_type;
 	struct rte_flow_action_list_handle *handle;
 	struct mlx5_priv *priv = dev->data->dev_private;
-	const struct mlx5_flow_template_table_cfg table_cfg = {
+	struct mlx5_flow_template_table_cfg table_cfg = {
 		.external = true,
 		.attr = {
 			.flow_attr = {
@@ -14840,6 +14840,11 @@ flow_hw_async_action_list_handle_create(struct rte_eth_dev *dev, uint32_t queue,
 	}
 	switch (list_type) {
 	case MLX5_INDIRECT_ACTION_LIST_TYPE_MIRROR:
+		/*
+		 * Mirror action is only supported in HWS group. Setting group to
+		 * non-zero will ensure that the action resources are allocated correctly.
+		 */
+		table_cfg.attr.flow_attr.group = 1;
 		handle = mlx5_hw_mirror_handle_create(dev, &table_cfg,
 						      actions, error);
 		break;
-- 
2.48.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-06-17 13:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-17 13:39 [PATCH 1/5] net/mlx5: fix the table flags of mirror action Gregory Etelson
2025-06-17 13:39 ` [PATCH 2/5] net/mlx5: add mlx5_hw_create_mirror function Gregory Etelson
2025-06-17 13:39 ` [PATCH 3/5] net/mlx5: create utility functions for non-template sample action Gregory Etelson
2025-06-17 13:39 ` [PATCH 4/5] net/mlx5: add MLX5 mirror flow action Gregory Etelson
2025-06-17 13:39 ` [PATCH 5/5] net/mlx5: support non-template SAMPLE " Gregory Etelson

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).