DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Raslan Darawsheh <rasland@nvidia.com>
To: Adrian Schollmeyer <a.schollmeyer@syseleven.de>,
	Dariusz Sosnowski <dsosnowski@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	Bing Zhao <bingz@nvidia.com>, Ori Kam <orika@nvidia.com>,
	Suanming Mou <suanmingm@nvidia.com>,
	Matan Azrad <matan@nvidia.com>,
	Michael Baum <michaelba@nvidia.com>
Cc: dev@dpdk.org, Michael Pfeiffer <m.pfeiffer@syseleven.de>,
	stable@dpdk.org
Subject: Re: [PATCH] net/mlx5: remove nonsensical flow action class_id checks
Date: Thu, 4 Jun 2026 12:36:11 +0300	[thread overview]
Message-ID: <66253785-b2bf-4e4d-a905-96559143c688@nvidia.com> (raw)
In-Reply-To: <20260520132533.159996-1-a.schollmeyer@syseleven.de>

Hi,


On 20/05/2026 4:25 PM, Adrian Schollmeyer wrote:
> From: Michael Pfeiffer <m.pfeiffer@syseleven.de>
> 
> For a MODIFY_FIELD action, flow_hw_validate_action_modify_field() is
> invoked and enforces class_id == 0 in the action's source and
> destination, if the modified field is none of
> RTE_FLOW_FIELD_GENEVE_OPT_*, as the value is used solely for GENEVE
> fields.
> 
> However, this check is flawed due to the way rte_flow_field_data is
> initialized. As it consists of unions and anonymous structs as members,
> empty initialization of this struct or initializing just the tag_index
> only guarantees initialization of the first union member, while the
> remaining member's default initialization behavior is unspecified.
> Therefore, depending on the compiler type, version and configuration,
> the remaining members may either be default-initialized as well or
> contain bytes from uninitialized memory. This causes the check to fail
> depending on how the struct is initialized wherever it is used.
> 
> For example, rte_flow_configure() sometimes fails on mlx5 under these
> circumstances with an error "destination class id is not supported"
> during creation of representor tagging rules, as these internally use
> MODIFY_FIELD actions in the following call stack:
> 
>    1. rte_flow_configure
>    2. mlx5_flow_port_configure
>    3. flow_hw_configure
>    4. __flow_hw_configure
>    5. flow_hw_setup_tx_repr_tagging
>    6. flow_hw_create_tx_repr_tag_jump_acts_tmpl
>       --> various rte_flow_action_modify_field are initialized here, but
>           class_id remains uninitialized
>    7. __flow_hw_actions_template_create
>    8. mlx5_flow_hw_actions_validate
>    9. flow_hw_validate_action_modify_field
>       --> invoked with class_id containing uninitialized bytes and
>           non-GENEVE field type
> 
> Remove the two checks for class_id in the non-GENEVE case, as this field
> is unused for these actions and avoids additional implicit dependencies
> on the correct ordering of union members.
> 
> Fixes: 1caa89ec1891 ("net/mlx5: support GENEVE options modification")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Michael Pfeiffer <m.pfeiffer@syseleven.de>
> Signed-off-by: Adrian Schollmeyer <a.schollmeyer@syseleven.de>

Patch applied to next-net-mlx,

Kindest regards
Raslan Darawsheh


      parent reply	other threads:[~2026-06-04  9:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 13:25 [PATCH] net/mlx5: remove nonsensical flow action class_id checks Adrian Schollmeyer
2026-05-21 16:23 ` Dariusz Sosnowski
2026-06-04  9:36 ` Raslan Darawsheh [this message]

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=66253785-b2bf-4e4d-a905-96559143c688@nvidia.com \
    --to=rasland@nvidia.com \
    --cc=a.schollmeyer@syseleven.de \
    --cc=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=m.pfeiffer@syseleven.de \
    --cc=matan@nvidia.com \
    --cc=michaelba@nvidia.com \
    --cc=orika@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