DPDK usage discussions
 help / color / mirror / Atom feed
* mlx5: rte_flow template/async API raw_encap validation bug ?
@ 2024-03-18 10:26 Guvenc Gulce
  2024-03-19  0:24 ` Suanming Mou
  0 siblings, 1 reply; 6+ messages in thread
From: Guvenc Gulce @ 2024-03-18 10:26 UTC (permalink / raw)
  To: users; +Cc: suanmingm, orika

[-- Attachment #1: Type: text/plain, Size: 2311 bytes --]

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:

<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: 3667 bytes --]

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

end of thread, other threads:[~2024-03-21  9:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-18 10:26 mlx5: rte_flow template/async API raw_encap validation bug ? Guvenc Gulce
2024-03-19  0:24 ` Suanming Mou
2024-03-19 14:25   ` Gregory Etelson
2024-03-20 15:19     ` Tao Li
2024-03-20 16:36       ` Gregory Etelson
2024-03-21  9:28         ` Tao Li

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).