DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jiawei Wang <jiaweiw@nvidia.com>
To: <suanmingm@nvidia.com>, <viacheslavo@nvidia.com>,
	Matan Azrad <matan@nvidia.com>, Ori Kam <orika@nvidia.com>
Cc: <dev@dpdk.org>, <rasland@nvidia.com>, <stable@dpdk.org>
Subject: [PATCH] net/mlx5: fix the validation of the sample encap action
Date: Tue, 7 Nov 2023 17:08:20 +0200	[thread overview]
Message-ID: <20231107150820.30805-1-jiaweiw@nvidia.com> (raw)

The flow sample/mirror action includes sub-actions for the
duplicated packet.
In SW steering case, dv_flow_en=1, there is a FW limitation
that forces configuring also encap action when port action
for the wire port is configured in the duplicated packet's
sub-actions.

The driver did a wrong validation for the above limitation
and forced other actions instead of encap for the wire port.
Force only encap action in case of wire port.

This patch fixes the wrongly checking for the sample encap action.

Fixes: a8697f50f50f ("net/mlx5: fix E-Switch mirror flow rule validation")
Cc: stable@dpdk.org

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 154e509707..9753af2cb1 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -8721,7 +8721,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 								RTE_FLOW_ERROR_TYPE_ACTION, NULL,
 								"mirror to rep port with encap is not supported");
 			} else {
-				if ((sub_action_flags & ~MLX5_FLOW_ACTION_ENCAP) &&
+				if (!(sub_action_flags & MLX5_FLOW_ACTION_ENCAP) &&
 				    (action_flags & MLX5_FLOW_ACTION_JUMP))
 					return rte_flow_error_set(error, ENOTSUP,
 								RTE_FLOW_ERROR_TYPE_ACTION, NULL,
-- 
2.18.1


             reply	other threads:[~2023-11-07 15:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-07 15:08 Jiawei Wang [this message]
2023-11-12 14:23 ` 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=20231107150820.30805-1-jiaweiw@nvidia.com \
    --to=jiaweiw@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=suanmingm@nvidia.com \
    --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).