[API-NEXT,v1,3/4] test: pktio: use capability to set test pool packet length

Message ID 1497488406-16652-4-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • Add scalable scheduler for travis CI
Related show

Commit Message

Github ODP bot June 15, 2017, 1 a.m.
From: Matias Elo <matias.elo@nokia.com>


Test used to fail if odp_pool_capability_t.pkt.max_len < PKT_BUF_SIZE.
https://bugs.linaro.org/show_bug.cgi?id=3013

Signed-off-by: Matias Elo <matias.elo@nokia.com>

Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

---
/** Email created from pull request 50 (nagarahalli:api-next-travis)
 ** https://github.com/Linaro/odp/pull/50
 ** Patch: https://github.com/Linaro/odp/pull/50.patch
 ** Base sha: 4f97e500a097928e308a415c32a88465adc5f5cc
 ** Merge commit sha: 95322c7b65a45928baf62cc6dd993c3a3bcdfe3a
 **/
 test/common_plat/validation/api/pktio/pktio.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/test/common_plat/validation/api/pktio/pktio.c b/test/common_plat/validation/api/pktio/pktio.c
index d3eb838f..43fe515a 100644
--- a/test/common_plat/validation/api/pktio/pktio.c
+++ b/test/common_plat/validation/api/pktio/pktio.c
@@ -123,20 +123,23 @@  static inline void _pktio_wait_linkup(odp_pktio_t pktio)
 
 static void set_pool_len(odp_pool_param_t *params, odp_pool_capability_t *capa)
 {
+	uint32_t len;
 	uint32_t seg_len;
 
+	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;
 
 	switch (pool_segmentation) {
 	case PKT_POOL_SEGMENTED:
 		/* Force segment to minimum size */
 		params->pkt.seg_len = 0;
-		params->pkt.len = PKT_BUF_SIZE;
+		params->pkt.len = len;
 		break;
 	case PKT_POOL_UNSEGMENTED:
 	default:
 		params->pkt.seg_len = seg_len;
-		params->pkt.len = PKT_BUF_SIZE;
+		params->pkt.len = len;
 		break;
 	}
 }