Before sending/receiving packet, check that the packet_len configured is supported by the pktios MTU. This allows interface that do not support jumbo frame to pass the test. However it has the bad side effect of not thoroughly checking the pktio if PKT_LEN_NORMAL is smaller than the MTU.
Signed-off-by: Nicolas Morey-Chaisemartin <[email protected]> --- test/validation/pktio/pktio.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c index 5c0799b..8fadbf7 100644 --- a/test/validation/pktio/pktio.c +++ b/test/validation/pktio/pktio.c @@ -455,6 +455,7 @@ static void test_txrx(odp_queue_type_t q_type, int num_pkts) int ret, i, if_b; pktio_info_t pktios[MAX_NUM_IFACES]; pktio_info_t *io; + uint32_t mtu, min_mtu = UINT32_MAX; /* create pktios and associate input/output queues */ for (i = 0; i < num_ifaces; ++i) { @@ -475,12 +476,19 @@ static void test_txrx(odp_queue_type_t q_type, int num_pkts) ret = odp_pktio_start(io->id); CU_ASSERT(ret == 0); + + mtu = odp_pktio_mtu(io->id); + if (mtu < min_mtu) + min_mtu = mtu; } - /* if we have two interfaces then send through one and receive on - * another but if there's only one assume it's a loopback */ - if_b = (num_ifaces == 1) ? 0 : 1; - pktio_txrx_multi(&pktios[0], &pktios[if_b], num_pkts); + /* Skip test if packet len is larger than the MTU */ + if (min_mtu >= packet_len) { + /* if we have two interfaces then send through one and receive + * on another but if there's only one assume it's a loopback */ + if_b = (num_ifaces == 1) ? 0 : 1; + pktio_txrx_multi(&pktios[0], &pktios[if_b], num_pkts); + } for (i = 0; i < num_ifaces; ++i) { destroy_inq(pktios[i].id); -- 2.6.1.3.g8d02103 _______________________________________________ lng-odp mailing list [email protected] https://lists.linaro.org/mailman/listinfo/lng-odp
