This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via 12eaa3d2ce51cc5cd48e54deded2740161162022 (commit) via 36009b1444af036c189046ee4edb50d13d861120 (commit) from 0178075e5e16e843034ac59ad4978e6a70ef86b5 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 12eaa3d2ce51cc5cd48e54deded2740161162022 Author: Petri Savolainen petri.savolainen@nokia.com Date: Wed Apr 10 10:28:24 2019 +0300
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
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;
commit 36009b1444af036c189046ee4edb50d13d861120 Author: Petri Savolainen petri.savolainen@nokia.com Date: Tue Apr 9 14:36:56 2019 +0300
linux-gen: packet: print packet input flags
Print packet input flag names to improve readability of odp_packet_print() output.
Signed-off-by: Petri Savolainen petri.savolainen@nokia.com Reviewed-and-tested-by: Matias Elo matias.elo@nokia.com
diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index f4c99ce15..be62557d5 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -1736,6 +1736,40 @@ int _odp_packet_cmp_data(odp_packet_t pkt, uint32_t offset, * ******************************************************** * */ +static int packet_print_input_flags(odp_packet_hdr_t *hdr, char *str, int max) +{ + int len = 0; + + if (hdr->p.input_flags.l2) + len += snprintf(&str[len], max - len, "l2 "); + if (hdr->p.input_flags.l3) + len += snprintf(&str[len], max - len, "l3 "); + if (hdr->p.input_flags.l4) + len += snprintf(&str[len], max - len, "l4 "); + if (hdr->p.input_flags.eth) + len += snprintf(&str[len], max - len, "eth "); + if (hdr->p.input_flags.vlan) + len += snprintf(&str[len], max - len, "vlan "); + if (hdr->p.input_flags.arp) + len += snprintf(&str[len], max - len, "arp "); + if (hdr->p.input_flags.ipv4) + len += snprintf(&str[len], max - len, "ipv4 "); + if (hdr->p.input_flags.ipv6) + len += snprintf(&str[len], max - len, "ipv6 "); + if (hdr->p.input_flags.ipsec) + len += snprintf(&str[len], max - len, "ipsec "); + if (hdr->p.input_flags.udp) + len += snprintf(&str[len], max - len, "udp "); + if (hdr->p.input_flags.tcp) + len += snprintf(&str[len], max - len, "tcp "); + if (hdr->p.input_flags.sctp) + len += snprintf(&str[len], max - len, "sctp "); + if (hdr->p.input_flags.icmp) + len += snprintf(&str[len], max - len, "icmp "); + + return len; +} + void odp_packet_print(odp_packet_t pkt) { odp_packet_seg_t seg; @@ -1753,7 +1787,12 @@ void odp_packet_print(odp_packet_t pkt) len += odp_buffer_snprint(&str[len], n - len, buf); len += snprintf(&str[len], n - len, " input_flags 0x%" PRIx64 "\n", hdr->p.input_flags.all); - len += snprintf(&str[len], n - len, " flags 0x%" PRIx32 "\n", + if (hdr->p.input_flags.all) { + len += snprintf(&str[len], n - len, " "); + len += packet_print_input_flags(hdr, &str[len], n - len); + len += snprintf(&str[len], n - len, "\n"); + } + len += snprintf(&str[len], n - len, " flags 0x%" PRIx32 "\n", hdr->p.flags.all_flags); len += snprintf(&str[len], n - len, " l2_offset %" PRIu32 "\n", hdr->p.l2_offset);
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/odp_packet.c | 41 ++++++++++++++++++++++++++++++++++++- test/validation/api/pktio/pktio.c | 21 +++++++++++++------ 2 files changed, 55 insertions(+), 7 deletions(-)
hooks/post-receive