Skip to content

Conversation

@JannePeltonen
Copy link
Collaborator

Simplify and streamline code by moving user area and user flag from event type specific event headers to the common event header. This does not change for which event types user area and flag are available.

@odpbuild odpbuild changed the title Move user area and user flag to common event header [PATCH v1] Move user area and user flag to common event header May 30, 2025
Add new variants of odp_packet_parse() tests with and without L4
checksumming.

Add new variants of odp_event_user_area(), odp_event_user_flag_set()
and odp_event_user_area_and_flag() tests.

Add tests for odp_packet_l{2,3,4}_type() functions and for the packet
flag getter functions.

Use packets/events of multiple types in a pseudorandom order in
the new tests to make things less predictable for branchy code and
hopefully slightly more realistic.

Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Remove _odp_event_hdr_t::type which is not used for anything.

Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Remove unused flags from _odp_packet_input_flags_t. The flags are set but
never read.

Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Remove L4 protocol flags (TCP, UDP, etc) from the packet input flags
stored in the packet header and store the L4 protocol number directly.
This slightly simplifies odp_packet_l4_type() and packet parsing and
makes it possible to make _odp_packet_input_flags_t smaller to make
room for other things in the packet header.

This causes an application visible change that multiple L4 packet flags
(e.g. both TCP and UDP) can no longer be set at the same time, which
is probably  more in line with the spirit of the ODP API, even though
the old behaviour seemed to be allowed too.

Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Now with fewer packet input flags, shrink _odp_packet_input_flags_t
from 8 to 4 bytes. This reduces the size of packet_parset_t by 8 bytes
since structure padding there gets reduced too. Add explicit unused
padding bytes in packet header (for now) to avoid moving other packet
header fields between cache lines.

Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Add user area pointer in the common event header and remove it from event
type specific headers. This simplifies and speeds up functions like
odp_event_user_area() that operate on generic events. This does not
change which event types support user area.

Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
Add user flag in the common event header and remove it from event type
specific headers. This simplifies and speeds up functions like
odp_event_user_flag() that operate on generic events. This does not
change which event types have a user flag visible through ODP API.

Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com>
@odpbuild odpbuild changed the title [PATCH v1] Move user area and user flag to common event header [PATCH v2] Move user area and user flag to common event header Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants