On Fri, Dec 18, 2015 at 01:43:18PM +0300, Maxim Uvarov wrote: > One comment bellow, other things look good. > > Maxim. > > On 12/11/2015 20:10, Stuart Haslam wrote: > >Modify the tests that currently transmit packets in batches to also > >receive packets in batches. This adds coverage of odp_queue_deq_multi() > >and odp_schedule_multi() specifically against a packet input queue, > >as this doesn't get tested anywhere else in the validation suite. > > > >Signed-off-by: Stuart Haslam <stuart.has...@linaro.org> > >--- > >Changes in v2 - rebased and picked up new time API > > > > test/validation/pktio/pktio.c | 139 > > +++++++++++++++++++++--------------------- > > 1 file changed, 68 insertions(+), 71 deletions(-) > > > >diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c > >index 52e5414..1eca694 100644 > >--- a/test/validation/pktio/pktio.c > >+++ b/test/validation/pktio/pktio.c > >@@ -137,7 +137,7 @@ static uint32_t pktio_pkt_seq(odp_packet_t pkt) > > pkt_tail_t tail; > > if (pkt == ODP_PACKET_INVALID) > >- return -1; > >+ return TEST_SEQ_INVALID; > > off = odp_packet_l4_offset(pkt); > > if (off == ODP_PACKET_OFFSET_INVALID) > >@@ -332,68 +332,76 @@ static int destroy_inq(odp_pktio_t pktio) > > return odp_queue_destroy(inq); > > } > >-static odp_event_t queue_deq_wait_time(odp_queue_t queue, uint64_t ns) > >+static int get_packets(pktio_info_t *pktio_rx, odp_packet_t pkt_tbl[], int > >num) > > { > >- odp_time_t start, now, diff; > >- odp_event_t ev; > >+ odp_event_t evt_tbl[num]; > >+ int num_evts = 0; > >+ int num_pkts = 0; > >+ int i; > >- start = odp_time_local(); > >+ if (pktio_rx->in_mode == ODP_PKTIN_MODE_RECV) > >+ return odp_pktio_recv(pktio_rx->id, pkt_tbl, num); > >- do { > >- ev = odp_queue_deq(queue); > >- if (ev != ODP_EVENT_INVALID) > >- return ev; > >- now = odp_time_local(); > >- diff = odp_time_diff(now, start); > >- } while (odp_time_to_ns(diff) < ns); > >+ if (num > 1) { > that means that you never test odp_queue_deq_multi and > odp_schedule_multi for num = 1. > But validation tests should do it' It's not performance tests so I > think simple it can be separate test case. >
OK, although there are plenty of other batch lengths that we don't test, it's easy enough to add a special case for 1. -- Stuart. _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp