Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH v3] validation: pool: fix uarea init test for external pools #1900

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

ashwinyes
Copy link
Contributor

The max payload of single segmented packets in external pools depends on the odp_header_size, app_header_size, max_headroom_size and odp_trailer_size.

Take all these into consideration when doing packet alloc from external pools so that allocations don't fail.

@odpbuild odpbuild changed the title validation: pool: fix uarea init test for external pools [PATCH v1] validation: pool: fix uarea init test for external pools Sep 6, 2023
Comment on lines 2053 to 2060
uint32_t max_payload;

CU_ASSERT(data.mark[i] == 1);

pkts[i] = odp_packet_alloc(pool, (param.pkt.buf_size - param.pkt.headroom) / 2);
max_payload = param.pkt.buf_size;
max_payload -= capa.pkt.odp_header_size + param.pkt.app_header_size;
max_payload -= capa.pkt.odp_trailer_size;
max_payload -= capa.pkt.max_headroom_size;
pkts[i] = odp_packet_alloc(pool, max_payload);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd move calculating max_payload outside the for loop and perhaps deducting max_headroom_size after header sizes would be more logical, but otherwise looking good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in v2.

@odpbuild odpbuild changed the title [PATCH v1] validation: pool: fix uarea init test for external pools [PATCH v2] validation: pool: fix uarea init test for external pools Sep 7, 2023
@MatiasElo
Copy link
Collaborator

Hi @ashwinyes, please add tags so this PR can be merged.

@MatiasElo
Copy link
Collaborator

Ping @ashwinyes

The max payload of single segmented packets in external
pools depends on the odp_header_size, app_header_size,
max_headroom_size and odp_trailer_size.

Take all these into consideration when doing packet alloc
from external pools so that allocations don't fail.

Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
@odpbuild odpbuild changed the title [PATCH v2] validation: pool: fix uarea init test for external pools [PATCH v3] validation: pool: fix uarea init test for external pools Sep 14, 2023
@ashwinyes
Copy link
Contributor Author

Hi @ashwinyes, please add tags so this PR can be merged.

Done

@MatiasElo MatiasElo merged commit e0c4b4a into OpenDataPlane:master Sep 14, 2023
174 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.

2 participants