DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@amd.com>
To: Michael Baum <michaelba@nvidia.com>, dev@dpdk.org
Cc: Dariusz Sosnowski <dsosnowski@nvidia.com>,
	Thomas Monjalon <thomas@monjalon.net>, Ori Kam <orika@nvidia.com>
Subject: Re: [RFC 0/2] ethdev: update GENEVE option item structure
Date: Tue, 11 Jun 2024 18:07:09 +0100	[thread overview]
Message-ID: <d51b6c63-4098-4327-91ff-551f7687a540@amd.com> (raw)
In-Reply-To: <20240417072304.3260172-1-michaelba@nvidia.com>

On 4/17/2024 8:23 AM, Michael Baum wrote:
> The "rte_flow_item_geneve_opt" structure describes the GENEVE TLV option
> header according to RFC 8926 [1]:
> 
> struct rte_flow_item_geneve_opt {
> 	rte_be16_t option_class;
> 	uint8_t option_type;
> 	uint8_t option_len;
> 	uint32_t *data;
> };
> 
> The "option_len" field is used for two different purposes:
>  1. item field for matching with value/mask.
>  2. descriptor for data array size.
> 

For the long run solution, we may consider adding geneve option header
to net/rte_geneve.h and make "struct rte_flow_item_geneve_opt" + data size ?

> Those two different purposes might limit each other. For example, when
> matching on length with full mask (0x1f), the data array in the mask
> structure might be taken as size 31 and read invalid memory.
> 
> This problem appears in conversion API. In current implementation, the
> "rte_flow_conv" API copies the "rte_flow_item_geneve_opt" structure
> without taking care about data deep-copy. The attempt to solve this
> revealed the problem in determining the size of the mask data array. To
> resolve this issue, two solutions are suggested.
> 

Are we having this problem only with geneve options because data size is
not fixed / defined for the header?

> Immediate Workaround:
> The data array size in the "mask" structure is determined by
> "option_len" field in the "spec" structure. This workaround can be
> integrated soon to avoid deep-copy missing.
> 

This requires a geneve specific pointer in the item spec, which is not
really nice, although it is temporary solution. Perhaps we can skip
this, can you please check below comment.

> Long Run Solution:
> Add a new field into "rte_flow_item_geneve_opt" structure regardless to
> "option_len" field. This solution should wait to "24.11" version since
> it contains API change.
>

I was expecting the same, but CI seems passed ABI test case [1], it may
be because new field appended end of the struct.
Can you please double check, if ABI is not broken, we can go with this
solution directly?

[1]
https://mails.dpdk.org/archives/test-report/2024-April/643570.html

> When the API is changed, I'll take the opportunity to add documentation
> for this item in "rte_flow.rst" file and update the data type to
> "rte_be32_t".
> 

If we can go with updating struct in this release, adding protocol
option struct in net library can wait v24.11 release.
So "rte_be32_t" type change in this struct won't be a thing.

> [1] https://datatracker.ietf.org/doc/html/rfc8926
> 
> Michael Baum (2):
>   ethdev: fix GENEVE option item conversion
>   ethdev: add data size field to GENEVE option item
> 
> 

@Ori, Can you please help reviewing this patch?
At worst, it can be good to address the fix in this release.


      parent reply	other threads:[~2024-06-11 17:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17  7:23 Michael Baum
2024-04-17  7:23 ` [RFC 1/2] ethdev: fix GENEVE option item conversion Michael Baum
2024-04-17  7:23 ` [RFC 2/2] ethdev: add data size field to GENEVE option item Michael Baum
2024-09-22 21:51   ` Ferruh Yigit
2024-06-11 17:07 ` Ferruh Yigit [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=d51b6c63-4098-4327-91ff-551f7687a540@amd.com \
    --to=ferruh.yigit@amd.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=michaelba@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=thomas@monjalon.net \
    /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).