DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH dpdk-dev] net/mlx5: check the reg available for metadata action
@ 2020-05-20  1:33 xiangxia.m.yue
  2020-05-22 17:17 ` Slava Ovsiienko
  2020-05-24 11:06 ` [dpdk-dev] [PATCH dpdk-dev v2] " xiangxia.m.yue
  0 siblings, 2 replies; 8+ messages in thread
From: xiangxia.m.yue @ 2020-05-20  1:33 UTC (permalink / raw)
  To: viacheslavo, dev; +Cc: Tonghao Zhang

From: Tonghao Zhang <xiangxia.m.yue@gmail.com>

If user don't set the dv_xmeta_en to 1 or 2,
in the flow_dv_convert_action_set_meta function:
* flow_dv_get_metadata_reg may return the REG_NONE,
  when MLX5_METADATA_FDB enabled for metadata set
  action.
* reg_to_field(REG_NONE) return MLX5_MODI_OUT_NONE
  which is invalid.

The rdma-core calltrace:
dr_action_create_modify_action
dr_actions_convert_modify_header
dr_action_modify_sw_to_hw
dr_action_modify_sw_to_hw_set
dr_ste_get_modify_hdr_hw_field

sw_field [MLX5_MODI_OUT_NONE 4095]
should not > ste_ctx->modify_hdr_field_arr_sz [92]

As doc[1] says:
| dv_xmeta_en 0, this is default value, defines the legacy mode,
| the MARK and META related actions and items operate only within
| NIC Tx and NIC Rx steering domains, no MARK and META information
| crosses the domain boundaries.

This patch add check for that case to warn that not supported.

[1] - http://doc.dpdk.org/guides-20.02/nics/mlx5.html

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index e4818319507c..dfcaf90eda11 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -1251,6 +1251,12 @@ flow_dv_convert_action_set_meta
 
 	if (reg < 0)
 		return reg;
+
+	if (reg == REG_NONE)
+		return rte_flow_error_set(error, ENOTSUP,
+					  RTE_FLOW_ERROR_TYPE_ITEM,
+					  NULL, "unavailable "
+					  "metadata register");
 	/*
 	 * In datapath code there is no endianness
 	 * coversions for perfromance reasons, all
-- 
2.26.1


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

end of thread, other threads:[~2020-11-22 13:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-20  1:33 [dpdk-dev] [PATCH dpdk-dev] net/mlx5: check the reg available for metadata action xiangxia.m.yue
2020-05-22 17:17 ` Slava Ovsiienko
2020-05-24 10:47   ` Tonghao Zhang
2020-05-27  7:43     ` Tonghao Zhang
2020-05-24 11:06 ` [dpdk-dev] [PATCH dpdk-dev v2] " xiangxia.m.yue
2020-08-05 17:09   ` Slava Ovsiienko
2020-11-20 14:48   ` [dpdk-dev] [PATCH v3] " Viacheslav Ovsiienko
2020-11-22 13:00     ` Raslan Darawsheh

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