-
Notifications
You must be signed in to change notification settings - Fork 134
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
Conversation
test/validation/api/pool/pool.c
Outdated
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in v2.
47c7764
to
5776d18
Compare
Hi @ashwinyes, please add tags so this PR can be merged. |
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>
5776d18
to
88e2baf
Compare
Done |
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.