All of
 help / color / mirror / Atom feed
From: Alexander Kozyrev <>
To: <>
Cc: <>, <>, <>
Subject: [dpdk-dev] [PATCH v2] net/mlx5: do not allow copy to mark via modify field
Date: Fri, 16 Jul 2021 11:43:05 +0300	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

The Mark action is a two-stage process in the Mellanox driver.
First, a hardware register is filled with the required value,
then this value is registered in the software resource table.

The MODIFY_FIELD action can instruct a Mellanox NIC to copy
some value from an arbitrary packet header field into the
hardware register, associated with the Mark item. But there
is no way NIC can modify the software resource table as well.

Due to these driver limitations the copying of arbitrary value
to the MARK can not be supported and should be rejected in the

Signed-off-by: Alexander Kozyrev <>
v2: Rewrote the commit message to clarify the limitation better.

 drivers/net/mlx5/mlx5_flow_dv.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index d250486950..519c610e50 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -4940,10 +4940,11 @@ flow_dv_validate_action_modify_field(struct rte_eth_dev *dev,
 				"source and destination fields"
 				" cannot be the same");
 	if (action_modify_field->dst.field == RTE_FLOW_FIELD_VALUE ||
-	    action_modify_field->dst.field == RTE_FLOW_FIELD_POINTER)
+	    action_modify_field->dst.field == RTE_FLOW_FIELD_POINTER ||
+	    action_modify_field->dst.field == RTE_FLOW_FIELD_MARK)
 		return rte_flow_error_set(error, EINVAL,
-				"immediate value or a pointer to it"
+				"mark, immediate value or a pointer to it"
 				" cannot be used as a destination");
 	if (action_modify_field->dst.field == RTE_FLOW_FIELD_START ||
 	    action_modify_field->src.field == RTE_FLOW_FIELD_START)

  parent reply	other threads:[~2021-07-16  8:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16 18:34 [dpdk-dev] [PATCH] " Alexander Kozyrev
2021-07-14  6:30 ` Slava Ovsiienko
2021-07-16  8:43 ` Alexander Kozyrev [this message]
2021-07-16 10:47   ` [dpdk-dev] [PATCH v2] " Slava Ovsiienko
2021-07-22 14:28     ` Thomas Monjalon

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: [dpdk-dev] [PATCH v2] net/mlx5: do not allow copy to mark via modify field' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.