From patchwork Fri Mar 18 17:25:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Kiss X-Patchwork-Id: 64091 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp86180lbc; Fri, 18 Mar 2016 10:25:56 -0700 (PDT) X-Received: by 10.107.2.148 with SMTP id 142mr13435480ioc.128.1458321956668; Fri, 18 Mar 2016 10:25:56 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p143si692149ioe.96.2016.03.18.10.25.50; Fri, 18 Mar 2016 10:25:56 -0700 (PDT) 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 1375D669B4; Fri, 18 Mar 2016 17:25:50 +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 3159F61CD3; Fri, 18 Mar 2016 17:25:46 +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 8694766982; Fri, 18 Mar 2016 17:25:43 +0000 (UTC) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by lists.linaro.org (Postfix) with ESMTPS id 95FF761CD3 for ; Fri, 18 Mar 2016 17:25:42 +0000 (UTC) Received: by mail-wm0-f50.google.com with SMTP id p65so46822899wmp.0 for ; Fri, 18 Mar 2016 10:25:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BU/9tleOmLqe6bVpHrtBVu+72CJ98IU2KtRC10nc3fg=; b=Cm2PwWizX0qe0hw5ylZBX9vSK46aP3ArE1frhiwNVVx8hwEafjg4WyvOTVmCj7Zugz pcPqcekeFyNIPCtIqwn3LoQ8+Dr3GH1q1O6QVkGn/nPG49yMzvGwXvyjLkYxCaqWvN7P 5P7WjcPn8KydBwhEmZXABqmgcijNF/nOXvkhtH96tJpInhb6VL5+o/8wBj3Kv/6JKvFW wGC1jI8yDiRUzy7qrXmGnvuz/WC2Bp/XP0GucMDbTCoOy3MWV7ReTKZdbvALEIm54LLG YkGA1dYz2LYZENhsf7UJkX5dfvy5kgDRlTvxC+EU93xW9W2OCR/FJySWsP6VnKkJLx75 EUdw== X-Gm-Message-State: AD7BkJJZ3gzZIAJ8Cjex+AVCoM1uwn64grMwR9MZ9wtMLJMq7UJ/zCoLDPBiQcpmfNXwRs6QK6c= X-Received: by 10.194.119.201 with SMTP id kw9mr18897617wjb.173.1458321941863; Fri, 18 Mar 2016 10:25:41 -0700 (PDT) Received: from localhost.localdomain ([195.11.233.227]) by smtp.googlemail.com with ESMTPSA id gt7sm13093999wjc.1.2016.03.18.10.25.41 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Mar 2016 10:25:41 -0700 (PDT) From: Zoltan Kiss To: lng-odp@lists.linaro.org Date: Fri, 18 Mar 2016 17:25:04 +0000 Message-Id: <1458321904-24247-2-git-send-email-zoltan.kiss@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1458321904-24247-1-git-send-email-zoltan.kiss@linaro.org> References: <1458321904-24247-1-git-send-email-zoltan.kiss@linaro.org> X-Topics: patch Cc: ola.liljedahl@arm.com, petri.savolainen@nokia.com 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 9443cd2..cb403a6 100644 --- a/test/validation/pktio/pktio.c +++ b/test/validation/pktio/pktio.c @@ -176,29 +176,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;