From: Bing Zhao <bingz@nvidia.com>
To: <viacheslavo@nvidia.com>, <matan@nvidia.com>
Cc: <dev@dpdk.org>, <orika@nvidia.com>, <rasland@nvidia.com>,
<thomas@monjalon.net>, <shunh@nvidia.com>
Subject: [dpdk-dev] [PATCH] net/mlx5: fix the meter hierarchy validation with yellow
Date: Thu, 29 Jul 2021 19:04:05 +0300 [thread overview]
Message-ID: <20210729160405.161982-4-bingz@nvidia.com> (raw)
In-Reply-To: <20210729160405.161982-1-bingz@nvidia.com>
In mlx5 PMD, the meter hierarchy only supports the green color. It
means that a meter action can only be in the green action list. In
the meanwhile, the yellow action list should be empty now. Any
action for the yellow color policy will be considered invalid if
the green color policy is a hierarchy.
Also, the error message printing of meter hierarchy validation is
fixed by removing an incorrect checking.
Fixes: 4b7bf3ffb473 ("net/mlx5: support yellow in meter policy validation")
Fixes: a3b7af90baba ("net/mlx5: validate meter action in policy")
Cc: shunh@nvidia.com
Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
drivers/net/mlx5/mlx5_flow_dv.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 837450722a..d5669e209d 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -17691,9 +17691,14 @@ flow_dv_validate_mtr_policy_acts(struct rte_eth_dev *dev,
return -rte_mtr_error_set(error,
ENOTSUP,
RTE_MTR_ERROR_TYPE_METER_POLICY,
- NULL, flow_err.message ?
- flow_err.message :
- "Meter hierarchy only supports GREEN color.");
+ NULL,
+ "Meter hierarchy only supports GREEN color.");
+ if (*policy_mode != MLX5_MTR_POLICY_MODE_OG)
+ return -rte_mtr_error_set(error,
+ ENOTSUP,
+ RTE_MTR_ERROR_TYPE_METER_POLICY,
+ NULL,
+ "No yellow policy should be provided in meter hierarchy.");
mtr = act->conf;
ret = flow_dv_validate_policy_mtr_hierarchy(dev,
mtr->mtr_id,
--
2.27.0
next prev parent reply other threads:[~2021-07-29 16:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-29 16:04 [dpdk-dev] [PATCH] net/mlx5: fix meter profile validation Bing Zhao
2021-07-29 16:04 ` [dpdk-dev] [PATCH] net/mlx5: fix the EIR calculation Bing Zhao
2021-07-29 20:06 ` Raslan Darawsheh
2021-07-29 16:04 ` [dpdk-dev] [PATCH] net/mlx5: fix the green color policy RSS queues overwritten Bing Zhao
2021-07-29 20:07 ` Raslan Darawsheh
2021-07-29 16:04 ` Bing Zhao [this message]
2021-07-29 20:07 ` [dpdk-dev] [PATCH] net/mlx5: fix the meter hierarchy validation with yellow Raslan Darawsheh
2021-07-29 20:04 ` [dpdk-dev] [PATCH] net/mlx5: fix meter profile validation Raslan Darawsheh
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=20210729160405.161982-4-bingz@nvidia.com \
--to=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=rasland@nvidia.com \
--cc=shunh@nvidia.com \
--cc=thomas@monjalon.net \
--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;
as well as URLs for NNTP newsgroup(s).