DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] net/mlx5: fix meter policy validation
@ 2021-11-02  7:22 Rongwei Liu
  2021-11-02  8:20 ` Bing Zhao
  2021-11-09 13:38 ` Raslan Darawsheh
  0 siblings, 2 replies; 5+ messages in thread
From: Rongwei Liu @ 2021-11-02  7:22 UTC (permalink / raw)
  To: matan, viacheslavo, orika, thomas, Bing Zhao; +Cc: dev, rasland

When a user specifies meter policy like "g_actions queue / end
y_actions queue / r_action drop / end", validation logic missed
to set meter policy mode and it took a random value from the stack.

Define ALL policy modes for the mentioned cases.

Fixes: 4b7bf3ffb473 ("net/mlx5: support yellow in meter policy validation")
Cc: bingz@nvidia.com
Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5.h         | 2 ++
 drivers/net/mlx5/mlx5_flow_dv.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 39c001aa1b..591ae2764a 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -622,6 +622,8 @@ struct mlx5_dev_shared_port {
 #define MLX5_MTR_TABLE_ID_DROP 2
 /* Priority of the meter policy matcher. */
 #define MLX5_MTR_POLICY_MATCHER_PRIO 0
+/* Green & yellow color valid for now. */
+#define MLX5_MTR_POLICY_MODE_ALL 0
 /* Default policy. */
 #define MLX5_MTR_POLICY_MODE_DEF 1
 /* Only green color valid. */
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 8962d26c75..e516c11d9a 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -17617,6 +17617,8 @@ flow_dv_validate_mtr_policy_acts(struct rte_eth_dev *dev,
 		*policy_mode = MLX5_MTR_POLICY_MODE_OG;
 	} else if (def_green && !def_yellow) {
 		*policy_mode = MLX5_MTR_POLICY_MODE_OY;
+	} else {
+		*policy_mode = MLX5_MTR_POLICY_MODE_ALL;
 	}
 	/* Set to empty string in case of NULL pointer access by user. */
 	flow_err.message = "";
-- 
2.27.0


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

end of thread, other threads:[~2021-11-09 13:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-02  7:22 [dpdk-dev] [PATCH v1] net/mlx5: fix meter policy validation Rongwei Liu
2021-11-02  8:20 ` Bing Zhao
2021-11-02  8:24   ` Rongwei Liu
2021-11-02  8:25     ` Bing Zhao
2021-11-09 13:38 ` 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).