aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetri Savolainen <petri.savolainen@nokia.com>2019-04-10 10:28:24 +0300
committerMatias Elo <matias.elo@nokia.com>2019-04-15 09:53:05 +0300
commit12eaa3d2ce51cc5cd48e54deded2740161162022 (patch)
treebf525bbbd674306c20e988a00c560ec7b02ef03d
parent36009b1444af036c189046ee4edb50d13d861120 (diff)
downloadodp-12eaa3d2ce51cc5cd48e54deded2740161162022.tar.gz
validation: pktio: improve debug info on magic number miss
Linux IPv6 stack sends additional packets during test. Test filters out these with a magic number in test packets. Some times Linux veth bridge interface overflows due to these extra packets and test packets are lost. Added debug information for easier debug of these kind of issues. Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com> Reviewed-and-tested-by: Matias Elo <matias.elo@nokia.com>
-rw-r--r--test/validation/api/pktio/pktio.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio/pktio.c
index a4f7cecd2..15f58e95a 100644
--- a/test/validation/api/pktio/pktio.c
+++ b/test/validation/api/pktio/pktio.c
@@ -219,8 +219,9 @@ static uint32_t pktio_pkt_seq_hdr(odp_packet_t pkt, size_t l4_hdr_len)
}
if (head.magic != TEST_SEQ_MAGIC) {
- fprintf(stderr, "error: header magic invalid %" PRIu32 "\n",
+ fprintf(stderr, "error: header magic invalid 0x%" PRIx32 "\n",
head.magic);
+ odp_packet_print(pkt);
return TEST_SEQ_INVALID;
}
@@ -237,7 +238,7 @@ static uint32_t pktio_pkt_seq_hdr(odp_packet_t pkt, size_t l4_hdr_len)
CU_ASSERT(seq != TEST_SEQ_INVALID);
} else {
fprintf(stderr,
- "error: tail magic invalid %" PRIu32 "\n",
+ "error: tail magic invalid 0x%" PRIx32 "\n",
tail.magic);
}
} else {
@@ -592,20 +593,24 @@ static int wait_for_packets_hdr(pktio_info_t *pktio_rx, odp_packet_t pkt_tbl[],
uint32_t seq_tbl[], int num, txrx_mode_e mode,
uint64_t ns, size_t l4_hdr_len)
{
- odp_time_t wait_time, end;
+ odp_time_t wait_time, end, start;
int num_rx = 0;
int i;
odp_packet_t pkt_tmp[num];
wait_time = odp_time_local_from_ns(ns);
- end = odp_time_sum(odp_time_local(), wait_time);
+ start = odp_time_local();
+ end = odp_time_sum(start, wait_time);
- do {
+ while (num_rx < num && odp_time_cmp(end, odp_time_local()) > 0) {
int n = get_packets(pktio_rx, pkt_tmp, num - num_rx, mode);
if (n < 0)
break;
+ if (n == 0)
+ continue;
+
for (i = 0; i < n; ++i) {
if (pktio_pkt_seq_hdr(pkt_tmp[i], l4_hdr_len) ==
seq_tbl[num_rx])
@@ -613,7 +618,7 @@ static int wait_for_packets_hdr(pktio_info_t *pktio_rx, odp_packet_t pkt_tbl[],
else
odp_packet_free(pkt_tmp[i]);
}
- } while (num_rx < num && odp_time_cmp(end, odp_time_local()) > 0);
+ }
return num_rx;
}
@@ -795,6 +800,10 @@ static void pktio_txrx_multi(pktio_info_t *pktio_a, pktio_info_t *pktio_b,
num_rx = wait_for_packets(pktio_b, rx_pkt, tx_seq,
num_pkts, mode, ODP_TIME_SEC_IN_NS);
CU_ASSERT(num_rx == num_pkts);
+ if (num_rx != num_pkts) {
+ fprintf(stderr, "error: received %i, out of %i packets\n",
+ num_rx, num_pkts);
+ }
for (i = 0; i < num_rx; ++i) {
odp_packet_data_range_t range;