aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarman Kalra <hkalra@marvell.com>2021-01-26 15:23:29 +0530
committerPetri Savolainen <petri.savolainen@nokia.com>2021-02-04 14:49:17 +0200
commit2010f8f62a58d032c3f1ec3987200e5101284eb1 (patch)
treefd3498a94298b6bec31bff5dce4ad9173524b018
parentdf3abb351d23fbd4a738e43ab0f6b25de7230679 (diff)
validation: pktio: fix segment length pool param
During pool creation segment length (param.pkt.seg_len) gets initialised with max segment length possible (which could go up to max packet length supported in case of single segmented buffer), while packet length (param.pkt.len) value gets initialised with PKT_BUF_SIZE. With this initialisation seg length becomes much greater than packet length i.e. (param.pkt.seg_len > param.pkt.len). With given pool params, expectation is to support param.pkt.num packets of param.pkt.len with first buffer segment size as param.pkt.seg_len, which is not feasible. Signed-off-by: Harman Kalra <hkalra@marvell.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
-rw-r--r--test/validation/api/pktio/pktio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio/pktio.c
index 185545fe9..87d5b6ad4 100644
--- a/test/validation/api/pktio/pktio.c
+++ b/test/validation/api/pktio/pktio.c
@@ -140,7 +140,8 @@ static void set_pool_len(odp_pool_param_t *params, odp_pool_capability_t *capa)
len = (capa->pkt.max_len && capa->pkt.max_len < PKT_BUF_SIZE) ?
capa->pkt.max_len : PKT_BUF_SIZE;
- seg_len = capa->pkt.max_seg_len ? capa->pkt.max_seg_len : PKT_BUF_SIZE;
+ seg_len = (capa->pkt.max_seg_len && capa->pkt.max_seg_len < PKT_BUF_SIZE) ?
+ capa->pkt.max_seg_len : PKT_BUF_SIZE;
switch (pool_segmentation) {
case PKT_POOL_SEGMENTED: