Skip to content

RFC ethdev: update GENEVE option item structure

Michael Baum dpdk-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ethdev: fix GENEVE option item conversionlib/ethdev/rte_flow.c+25 -40 replies
2/2ethdev: add data size field to GENEVE option itemapp/test-pmd/cmdline_flow.c doc/guides/prog_guide/rte_flow.rst doc/guides/testpmd_app_ug/testpmd_funcs.rst +2 more+47 -211 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/2] ethdev: update GENEVE option item structure

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.

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.

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.

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

[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

 app/test-pmd/cmdline_flow.c                 | 10 +++++++
 doc/guides/prog_guide/rte_flow.rst          | 16 ++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  3 ++-
 lib/ethdev/rte_flow.c                       | 29 +++++++++++++++++----
 lib/ethdev/rte_flow.h                       |  3 ++-
 5 files changed, 54 insertions(+), 7 deletions(-)
Signature · 1 line
2.25.1