[PATCH v3] linux-gen: packet: optimize single packet alloc/free functions#2327
Merged
MatiasElo merged 3 commits intoOpenDataPlane:masterfrom Apr 1, 2026
Merged
Conversation
psavol
approved these changes
Mar 26, 2026
eda8cad to
8ac9192
Compare
platform/linux-generic/odp_packet.c
Outdated
| if (odp_unlikely(skip_references(&hdr, 1))) | ||
| return; | ||
|
|
||
| _odp_event_free((odp_event_t)(uintptr_t)hdr); |
Collaborator
There was a problem hiding this comment.
The ugly cast could be avoided like this:
_odp_event_free(_odp_event_from_hdr(&hdr->event_hdr));
JannePeltonen
approved these changes
Apr 1, 2026
Collaborator
JannePeltonen
left a comment
There was a problem hiding this comment.
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>
8ac9192 to
45d58e1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.