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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion test/validation/api/pool/pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -2023,6 +2023,7 @@ static void test_packet_pool_ext_uarea_init(void)
odp_pool_ext_capability_t capa;
odp_pool_ext_param_t param;
uint32_t num = ELEM_NUM, i;
uint32_t max_payload;
odp_pool_t pool;
uarea_init_t data;
odp_shm_t shm;
Expand All @@ -2049,10 +2050,14 @@ static void test_packet_pool_ext_uarea_init(void)
CU_ASSERT_FATAL(shm != ODP_SHM_INVALID);
CU_ASSERT(data.count == num);

max_payload = param.pkt.buf_size;
max_payload -= capa.pkt.odp_header_size + param.pkt.app_header_size;
max_payload -= capa.pkt.max_headroom_size;
max_payload -= capa.pkt.odp_trailer_size;
for (i = 0; i < num; i++) {
CU_ASSERT(data.mark[i] == 1);

pkts[i] = odp_packet_alloc(pool, (param.pkt.buf_size - param.pkt.headroom) / 2);
pkts[i] = odp_packet_alloc(pool, max_payload);

CU_ASSERT(pkts[i] != ODP_PACKET_INVALID);

Expand Down