Skip to content

[PATCH v3] linux-gen: packet: optimize single packet alloc/free functions#2327

Merged
MatiasElo merged 3 commits intoOpenDataPlane:masterfrom
MatiasElo:dev/packet-alloc-free-opt
Apr 1, 2026
Merged

[PATCH v3] linux-gen: packet: optimize single packet alloc/free functions#2327
MatiasElo merged 3 commits intoOpenDataPlane:masterfrom
MatiasElo:dev/packet-alloc-free-opt

Conversation

@MatiasElo
Copy link
Copy Markdown
Collaborator

No description provided.

@odpbuild odpbuild changed the title linux-gen: packet: optimize single packet alloc/free functions [PATCH v1] linux-gen: packet: optimize single packet alloc/free functions Mar 23, 2026
@MatiasElo MatiasElo force-pushed the dev/packet-alloc-free-opt branch from eda8cad to 8ac9192 Compare April 1, 2026 10:13
@odpbuild odpbuild changed the title [PATCH v1] linux-gen: packet: optimize single packet alloc/free functions [PATCH v2] linux-gen: packet: optimize single packet alloc/free functions Apr 1, 2026
if (odp_unlikely(skip_references(&hdr, 1)))
return;

_odp_event_free((odp_event_t)(uintptr_t)hdr);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ugly cast could be avoided like this:
_odp_event_free(_odp_event_from_hdr(&hdr->event_hdr));

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in v3.

Copy link
Copy Markdown
Collaborator

@JannePeltonen JannePeltonen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok. One minor comment about a possible change to get rid of some casting.

Optimize odp_packet_alloc() function implementation. The patch includes a
simpler processing path for single segment packets.

Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
Optimize odp_packet_free() function implementation for single segment
packets by utilizing _odp_event_free() function.

Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
All packet segments must always be from the same pool, so the single pool
free function packet_free_sp() can be used in several places to optimize
performance.

Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
@MatiasElo MatiasElo force-pushed the dev/packet-alloc-free-opt branch from 8ac9192 to 45d58e1 Compare April 1, 2026 12:06
@odpbuild odpbuild changed the title [PATCH v2] linux-gen: packet: optimize single packet alloc/free functions [PATCH v3] linux-gen: packet: optimize single packet alloc/free functions Apr 1, 2026
@MatiasElo MatiasElo enabled auto-merge (rebase) April 1, 2026 12:07
@MatiasElo MatiasElo merged commit a899559 into OpenDataPlane:master Apr 1, 2026
164 checks passed
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.

3 participants