From: Gregory Etelson <getelson@nvidia.com>
To: Suanming Mou <suanmingm@nvidia.com>,
Guvenc Gulce <guvenc.gulce@gmail.com>,
"users@dpdk.org" <users@dpdk.org>
Cc: Ori Kam <orika@nvidia.com>, Maayan Kashani <mkashani@nvidia.com>
Subject: Re: mlx5: rte_flow template/async API raw_encap validation bug ?
Date: Tue, 19 Mar 2024 14:25:36 +0000 [thread overview]
Message-ID: <IA1PR12MB633255D40F27999831F7666FA52C2@IA1PR12MB6332.namprd12.prod.outlook.com> (raw)
In-Reply-To: <CO6PR12MB53969FC75835335A9F32DB68C12C2@CO6PR12MB5396.namprd12.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 5065 bytes --]
Hello Guvenc,
Flow actions in MLX5 PMD actions template are translated according to these general rules:
1.
If flow action configuration in template mask was not NULL, PMD constructs the action according
to the action configuration parameters.
PMD will use that pre-build action during async flow creation.
The action parameters cannot be changed during async flow creation.
2.
If flow action configuration in template mask was NULL, PMD ignores the action configuration in the template.
The action will be constructed according to configuration data provided during async flow creation.
Before patch 2e543b6f18a2 ("net/mlx5: reuse reformat and modify actions in a table")
the PMD ignored the RAW_ENCAP NULL mask configuration and used the action configuration for construction.
2e543b6f18a2 does not allow access to RAW_ENCAP configuration if the action did not provide correct mask.
If flow action configuration has several parameters, the action template can be partially translated -
some action parameters will be provided with the template and other with async flow.
In that case, if the action mask parameter has any non-zero value, it's configuration parameter will be used in a template.
If the action mask parameter is 0, that parameter value will be provided during async flow.
Partial action translation used for pre-defined flow actions.
MLX5 PMD requires the `size` parameter of the RAW_ENCAP action during the template action translation.
The action data can be provided ether with the template action configuration or with async flow.
Therefore, the RAW_ENCAP template configuration can be fully masked with the action size and data or partially masked with size only.
Regards,
Gregory
________________________________
From: Suanming Mou <suanmingm@nvidia.com>
Sent: Tuesday, March 19, 2024 02:24
To: Guvenc Gulce <guvenc.gulce@gmail.com>; users@dpdk.org <users@dpdk.org>; Gregory Etelson <getelson@nvidia.com>
Cc: Ori Kam <orika@nvidia.com>; Maayan Kashani <mkashani@nvidia.com>
Subject: RE: mlx5: rte_flow template/async API raw_encap validation bug ?
Hi Guvenc,
From: Guvenc Gulce <guvenc.gulce@gmail.com>
Sent: Monday, March 18, 2024 6:26 PM
To: users@dpdk.org
Cc: Suanming Mou <suanmingm@nvidia.com>; Ori Kam <orika@nvidia.com>
Subject: mlx5: rte_flow template/async API raw_encap validation bug ?
Hi all,
It is great that we have rte_flow async/template api integrated to mlx5
driver code and it is being established as the new standard rte_flow API.
I have the following raw_encap problem when using the rte_flow async/template API
with mlx5 driver:
- raw_encap rte_flow action template fails during validation when the action mask
conf is NULL but this clearly contradicts the explanation from Suanming Mou's
commit 7f6daa490d9 which clearly states that the raw encap action mask is allowed
to be NULL.
<Excerpt from commit 7f6daa490d9>
2. RAW encap (encap_data: raw)
action conf (raw_data)
a. action mask conf (not NULL)
- encap_data constant.
b. action mask conf (NULL)
- encap_data will change.
</Excerpt from commit 7f6daa490d9>
Commenting out the raw_encap validation would make it possible to create
rte_flow template with null mask conf which can be concretized later on.
Things seem to work after relaxing the rte_flow raw_encap validation.
The change would look like:
[Suanming] I guess maybe it is due to the raw_encap and raw_decap combination. I added Gregory who added that code maybe can explain it better. @Gregory Etelson<mailto:getelson@nvidia.com>
<Excerpt>
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 35f1ed7a03..3f57fd9286 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -6020,10 +6020,10 @@ flow_hw_validate_action_raw_encap(const struct rte_flow_action *action,
const struct rte_flow_action_raw_encap *mask_conf = mask->conf;
const struct rte_flow_action_raw_encap *action_conf = action->conf;
- if (!mask_conf || !mask_conf->size)
+/* if (!mask_conf || !mask_conf->size)
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION, mask,
- "raw_encap: size must be masked");
+ "raw_encap: size must be masked"); */
if (!action_conf || !action_conf->size)
return rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ACTION, action,
</Excerpt>
But this can not be the proper solution. Please advise a solution how to make the
raw_encap work with rte_flow template/async API. If relaxing the validation is ok, I can
also prepare and send a patch.
Thanks in advance,
Guvenc Gulce
[-- Attachment #2: Type: text/html, Size: 16746 bytes --]
next prev parent reply other threads:[~2024-03-19 14:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-18 10:26 Guvenc Gulce
2024-03-19 0:24 ` Suanming Mou
2024-03-19 14:25 ` Gregory Etelson [this message]
2024-03-20 15:19 ` Tao Li
2024-03-20 16:36 ` Gregory Etelson
2024-03-21 9:28 ` Tao Li
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=IA1PR12MB633255D40F27999831F7666FA52C2@IA1PR12MB6332.namprd12.prod.outlook.com \
--to=getelson@nvidia.com \
--cc=guvenc.gulce@gmail.com \
--cc=mkashani@nvidia.com \
--cc=orika@nvidia.com \
--cc=suanmingm@nvidia.com \
--cc=users@dpdk.org \
/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).