From patchwork Wed Mar 2 20:07:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 63420 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2574056lbc; Wed, 2 Mar 2016 12:08:15 -0800 (PST) X-Received: by 10.140.42.137 with SMTP id c9mr36066027qga.5.1456949295460; Wed, 02 Mar 2016 12:08:15 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c16si37614788qkj.48.2016.03.02.12.08.15; Wed, 02 Mar 2016 12:08:15 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 0B59261853; Wed, 2 Mar 2016 20:08:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 74DE5622B1; Wed, 2 Mar 2016 20:07:49 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 4C02661723; Wed, 2 Mar 2016 20:07:45 +0000 (UTC) Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by lists.linaro.org (Postfix) with ESMTPS id D002E61723 for ; Wed, 2 Mar 2016 20:07:12 +0000 (UTC) Received: by mail-wm0-f43.google.com with SMTP id p65so4918970wmp.1 for ; Wed, 02 Mar 2016 12:07:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=j4LCfCj8D7hnH6xJQkON9Rv5lgbRSGPjCH+vUniptF0=; b=OYtz3ntdnBWIGyK1w+GFkbNm9PhKV4Qv8jT/E4HPHwxN65P23BimVuRroEGGxQsfWm Vdl6nyYBZi+J5Liwp5cvWFeEdjpcHJ2CGU56mL1q9NPqjgkML2GO5Z2SEZaJ+KR6qymd XiwLo4pc3Y1Rd/k5Cn00UQ+YpCscagHOOyWIRD71Hp6ktnfllMWw+1mrb061HN17C0kI 2A+HqBdCaIWsMy909p5x3UlUr2l0j3DyVRFsHfSCMgVZHiDrcwHOulMJVvQabWzTf0It AQdVXSwrvFqhXqvwh+ESoL+3+WijtUBPZ4QzXq9DHGuhj/zwslI1b8v1QIw0/LRoPmn2 hAVA== X-Gm-Message-State: AD7BkJKz4cr1ngg5sytuvlpNdzzvK0E/ca5PtyklfjhgJPZ+SQargdebMfKZhrnR15o6fNvtehI= X-Received: by 10.28.226.212 with SMTP id z203mr1795777wmg.78.1456949232062; Wed, 02 Mar 2016 12:07:12 -0800 (PST) Received: from localhost.localdomain ([195.11.233.227]) by smtp.googlemail.com with ESMTPSA id 73sm5656786wmy.22.2016.03.02.12.07.11 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Mar 2016 12:07:11 -0800 (PST) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Wed, 2 Mar 2016 20:07:03 +0000 Message-Id: <1456949223-32489-1-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH] validation: pktio: add more debug log to pktio_pkt_seq() X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Zoltan Kiss --- test/validation/pktio/pktio.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c index a5f25da..084e5cd 100644 --- a/test/validation/pktio/pktio.c +++ b/test/validation/pktio/pktio.c @@ -172,29 +172,45 @@ static uint32_t pktio_pkt_seq(odp_packet_t pkt) pkt_head_t head; pkt_tail_t tail; - if (pkt == ODP_PACKET_INVALID) + if (pkt == ODP_PACKET_INVALID) { + fprintf(stderr, "error: pkt invalid\n"); return TEST_SEQ_INVALID; + } off = odp_packet_l4_offset(pkt); - if (off == ODP_PACKET_OFFSET_INVALID) + if (off == ODP_PACKET_OFFSET_INVALID) { + fprintf(stderr, "error: offset invalid\n"); return TEST_SEQ_INVALID; + } off += ODPH_UDPHDR_LEN; - if (odp_packet_copydata_out(pkt, off, sizeof(head), &head) != 0) + if (odp_packet_copydata_out(pkt, off, sizeof(head), &head) != 0) { + fprintf(stderr, "error: header copy failed\n"); return TEST_SEQ_INVALID; + } - if (head.magic != TEST_SEQ_MAGIC) + if (head.magic != TEST_SEQ_MAGIC) { + fprintf(stderr, "error: header magic invalid %u\n", head.magic); return TEST_SEQ_INVALID; + } if (odp_packet_len(pkt) == packet_len) { off = packet_len - sizeof(tail); - if (odp_packet_copydata_out(pkt, off, sizeof(tail), &tail) != 0) + if (odp_packet_copydata_out(pkt, off, sizeof(tail), &tail) != 0) { + fprintf(stderr, "error: header copy failed\n"); return TEST_SEQ_INVALID; + } if (tail.magic == TEST_SEQ_MAGIC) { seq = head.seq; CU_ASSERT(seq != TEST_SEQ_INVALID); + } else { + fprintf(stderr, "error: tail magic invalid %u\n", + tail.magic); } + } else { + fprintf(stderr, "error: packet length invalid: %u (%u)\n", + odp_packet_len(pkt), packet_len); } return seq;