From patchwork Mon Sep 11 19:00:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 112221 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4214005qgf; Mon, 11 Sep 2017 12:09:45 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBuLPco+Yuwe2fMmSbZFsOeL/pQwPOIThMQmkp0mhszgjWU0xlD4nCJhbTAxKysVEAfvkT+ X-Received: by 10.55.146.198 with SMTP id u189mr15977775qkd.317.1505156985837; Mon, 11 Sep 2017 12:09:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505156985; cv=none; d=google.com; s=arc-20160816; b=C5W4oOmnyRsVVKbOZzp1j+7KJeS58ZYDp/oFOCQ/b1STMTF+79r5Ispb61tMJM6CHH xu1GboLGV+gdCt57GmE2cqDClMg8UUYuPWswAKNbuLktL2ks/SIGqaCFwI//Kg0axQ+M HLOh0OcYH8GHvZV8GMq82GY+bUvGd9Zb0Sbc5FU9FQBbJLDNAADg1JnTsP/D02y9KxAt XBEPVTT62gEE0zAPnp25WGuLRld3hwvgSYfkiRgaHyCEnX0dW4p/SZExuOZXE53vtJhk kgbsG5AZ68iF74E8//BW58FTgYO0T6V7bIGd5YDdhsWd9EPtilNZTaPZyvF6sWjTkF1x f1aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=aH+qV6dwal6y/zxi1oyhKEyS3bPWxwDB+tXP6/UnpHY=; b=tqS1HxTXpIIgClC78HT9D/ULhwIe6yJXdpkptwFVU+m/KyOQQekHUlNiwcBI6CVoY1 ZKwkU7wLY5P9W+mLR5mjOHJn8xhLLTSei7V2AOWGuo5VLYaRqhqIncW2Zh/OZinHrtBb NMbNQiJI08pNrrhUeaX7THFFesyiK3KkoYlM92TOeK4rvu3LV0gS5JckWc5foA5obyw/ zYYs01MDXRZZbZYF1CaPSn0Ph/cw5LmMQrP6NunyDBn4NFq03yih1LugnKeqYpDozdww 3kCvskR5rpP18mSTT6agfqFSwBtGTCviNU8RX0bX1taZ0FVSkqaL1JUKCJJMxYj8efN4 BQuQ== ARC-Authentication-Results: i=1; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id g62si9170420qtd.225.2017.09.11.12.09.45; Mon, 11 Sep 2017 12:09:45 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 7EDDD61CBC; Mon, 11 Sep 2017 19:09:45 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 B93A560DB2; Mon, 11 Sep 2017 19:01:29 +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 69C6F60D8F; Mon, 11 Sep 2017 19:00:36 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id BC4B160D88 for ; Mon, 11 Sep 2017 19:00:28 +0000 (UTC) Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward103j.mail.yandex.net (Yandex) with ESMTP id BB19234C3F33 for ; Mon, 11 Sep 2017 22:00:27 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id a3zHrrvIkl-0RDW0sEn; Mon, 11 Sep 2017 22:00:27 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Xiwxkqm3eV-0RlKxbC5; Mon, 11 Sep 2017 22:00:27 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 11 Sep 2017 22:00:00 +0300 Message-Id: <1505156408-13887-12-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505156408-13887-1-git-send-email-odpbot@yandex.ru> References: <1505156408-13887-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 173 Subject: [lng-odp] [PATCH API-NEXT v1 11/19] test: pktio_ipc: switch to test_debug rather than example_debug 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov Reviewed-by: Bill Fischofer Signed-off-by: Maxim Uvarov --- /** Email created from pull request 173 (muvarov:api-next) ** https://github.com/Linaro/odp/pull/173 ** Patch: https://github.com/Linaro/odp/pull/173.patch ** Base sha: 7fa8e2c97ed18f8dd6e95cbc78b7e668ccb98869 ** Merge commit sha: 057be0905a62a157cc96a91743ea70e66e8554ca **/ test/linux-generic/pktio_ipc/ipc_common.c | 12 +++++----- test/linux-generic/pktio_ipc/ipc_common.h | 2 +- test/linux-generic/pktio_ipc/pktio_ipc1.c | 40 +++++++++++++++---------------- test/linux-generic/pktio_ipc/pktio_ipc2.c | 36 ++++++++++++++-------------- 4 files changed, 45 insertions(+), 45 deletions(-) diff --git a/test/linux-generic/pktio_ipc/ipc_common.c b/test/linux-generic/pktio_ipc/ipc_common.c index 2004c7d2..e15d3913 100644 --- a/test/linux-generic/pktio_ipc/ipc_common.c +++ b/test/linux-generic/pktio_ipc/ipc_common.c @@ -29,14 +29,14 @@ int ipc_odp_packet_send_or_free(odp_pktio_t pktio, end_time = odp_time_sum(start_time, wait); if (odp_pktout_queue(pktio, &pktout, 1) != 1) { - EXAMPLE_ERR("no output queue\n"); + LOG_ERR("no output queue\n"); return -1; } while (sent != num) { ret = odp_pktout_send(pktout, &pkt_tbl[sent], num - sent); if (ret < 0) { - EXAMPLE_ERR("odp_pktout_send return %d\n", ret); + LOG_ERR("odp_pktout_send return %d\n", ret); for (i = sent; i < num; i++) odp_packet_free(pkt_tbl[i]); return -1; @@ -47,7 +47,7 @@ int ipc_odp_packet_send_or_free(odp_pktio_t pktio, if (odp_time_cmp(end_time, odp_time_local()) < 0) { for (i = sent; i < num; i++) odp_packet_free(pkt_tbl[i]); - EXAMPLE_ERR("Send Timeout!\n"); + LOG_ERR("Send Timeout!\n"); return -1; } } @@ -71,17 +71,17 @@ odp_pktio_t create_pktio(odp_pool_t pool, int master_pid) printf("pid: %d, create IPC pktio %s\n", getpid(), name); ipc_pktio = odp_pktio_open(name, pool, &pktio_param); if (ipc_pktio == ODP_PKTIO_INVALID) { - EXAMPLE_ERR("Error: ipc pktio %s create failed.\n", name); + LOG_ERR("Error: ipc pktio %s create failed.\n", name); return ODP_PKTIO_INVALID; } if (odp_pktin_queue_config(ipc_pktio, NULL)) { - EXAMPLE_ERR("Input queue config failed\n"); + LOG_ERR("Input queue config failed\n"); return ODP_PKTIO_INVALID; } if (odp_pktout_queue_config(ipc_pktio, NULL)) { - EXAMPLE_ERR("Output queue config failed\n"); + LOG_ERR("Output queue config failed\n"); return ODP_PKTIO_INVALID; } diff --git a/test/linux-generic/pktio_ipc/ipc_common.h b/test/linux-generic/pktio_ipc/ipc_common.h index 334788f3..2b04b144 100644 --- a/test/linux-generic/pktio_ipc/ipc_common.h +++ b/test/linux-generic/pktio_ipc/ipc_common.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/test/linux-generic/pktio_ipc/pktio_ipc1.c b/test/linux-generic/pktio_ipc/pktio_ipc1.c index b1ed21b8..ee46d1da 100644 --- a/test/linux-generic/pktio_ipc/pktio_ipc1.c +++ b/test/linux-generic/pktio_ipc/pktio_ipc1.c @@ -77,7 +77,7 @@ static int pktio_run_loop(odp_pool_t pool) return -1; if (odp_pktin_queue(ipc_pktio, &pktin, 1) != 1) { - EXAMPLE_ERR("no input queue\n"); + LOG_ERR("no input queue\n"); return -1; } @@ -107,8 +107,8 @@ static int pktio_run_loop(odp_pool_t pool) cycle = odp_time_local(); diff = odp_time_diff(cycle, start_cycle); if (odp_time_cmp(wait, diff) < 0) { - EXAMPLE_DBG("exit after %d seconds\n", - run_time_sec); + LOG_DBG("exit after %d seconds\n", + run_time_sec); break; } } @@ -132,7 +132,7 @@ static int pktio_run_loop(odp_pool_t pool) stat_errors++; stat_free++; odp_packet_free(pkt); - EXAMPLE_ERR("invalid l4 offset\n"); + LOG_ERR("invalid l4 offset\n"); } off += ODPH_UDPHDR_LEN; @@ -143,7 +143,7 @@ static int pktio_run_loop(odp_pool_t pool) stat_errors++; stat_free++; odp_packet_free(pkt); - EXAMPLE_DBG("error\n"); + LOG_DBG("error\n"); continue; } @@ -157,7 +157,7 @@ static int pktio_run_loop(odp_pool_t pool) stat_errors++; stat_free++; odp_packet_free(pkt); - EXAMPLE_DBG("error\n"); + LOG_DBG("error\n"); continue; } @@ -184,7 +184,7 @@ static int pktio_run_loop(odp_pool_t pool) if (head.seq != cnt_recv && sync_cnt) { stat_errors++; odp_packet_free(pkt); - EXAMPLE_DBG("head.seq %d - " + LOG_DBG("head.seq %d - " "cnt_recv %" PRIu64 "" " = %" PRIu64 "\n", head.seq, cnt_recv, @@ -226,7 +226,7 @@ static int pktio_run_loop(odp_pool_t pool) off = odp_packet_l4_offset(pkt); if (off == ODP_PACKET_OFFSET_INVALID) - EXAMPLE_ABORT("packet L4 offset not set"); + LOG_ABORT("packet L4 offset not set"); head.magic = TEST_SEQ_MAGIC; head.seq = cnt++; @@ -235,20 +235,20 @@ static int pktio_run_loop(odp_pool_t pool) ret = odp_packet_copy_from_mem(pkt, off, sizeof(head), &head); if (ret) - EXAMPLE_ABORT("unable to copy in head data"); + LOG_ABORT("unable to copy in head data"); tail.magic = TEST_SEQ_MAGIC; off = odp_packet_len(pkt) - sizeof(pkt_tail_t); ret = odp_packet_copy_from_mem(pkt, off, sizeof(tail), &tail); if (ret) - EXAMPLE_ABORT("unable to copy in tail data"); + LOG_ABORT("unable to copy in tail data"); } /* 5. Send packets to ipc_pktio */ ret = ipc_odp_packet_send_or_free(ipc_pktio, pkt_tbl, pkts); if (ret < 0) { - EXAMPLE_DBG("unable to sending to ipc pktio\n"); + LOG_DBG("unable to sending to ipc pktio\n"); break; } @@ -275,14 +275,14 @@ static int pktio_run_loop(odp_pool_t pool) /* cleanup and exit */ ret = odp_pktio_stop(ipc_pktio); if (ret) { - EXAMPLE_DBG("odp_pktio_stop error %d\n", ret); + LOG_DBG("odp_pktio_stop error %d\n", ret); return -1; } exit: ret = odp_pktio_close(ipc_pktio); if (ret) { - EXAMPLE_DBG("odp_pktio_close error %d\n", ret); + LOG_DBG("odp_pktio_close error %d\n", ret); return -1; } @@ -308,7 +308,7 @@ int main(int argc, char *argv[]) /* Init ODP before calling anything else */ if (odp_init_global(&instance, NULL, NULL)) { - EXAMPLE_ERR("Error: ODP global init failed.\n"); + LOG_ERR("Error: ODP global init failed.\n"); exit(EXIT_FAILURE); } @@ -329,7 +329,7 @@ int main(int argc, char *argv[]) /* Init this thread */ if (odp_init_local(instance, ODP_THREAD_WORKER)) { - EXAMPLE_ERR("Error: ODP local init failed.\n"); + LOG_ERR("Error: ODP local init failed.\n"); exit(EXIT_FAILURE); } @@ -345,7 +345,7 @@ int main(int argc, char *argv[]) pool = odp_pool_create(TEST_IPC_POOL_NAME, ¶ms); if (pool == ODP_POOL_INVALID) { - EXAMPLE_ERR("Error: packet pool create failed.\n"); + LOG_ERR("Error: packet pool create failed.\n"); exit(EXIT_FAILURE); } @@ -354,20 +354,20 @@ int main(int argc, char *argv[]) ret = pktio_run_loop(pool); if (odp_pool_destroy(pool)) { - EXAMPLE_ERR("Error: odp_pool_destroy() failed.\n"); + LOG_ERR("Error: odp_pool_destroy() failed.\n"); exit(EXIT_FAILURE); } if (odp_term_local()) { - EXAMPLE_ERR("Error: odp_term_local() failed.\n"); + LOG_ERR("Error: odp_term_local() failed.\n"); exit(EXIT_FAILURE); } if (odp_term_global(instance)) { - EXAMPLE_ERR("Error: odp_term_global() failed.\n"); + LOG_ERR("Error: odp_term_global() failed.\n"); exit(EXIT_FAILURE); } - EXAMPLE_DBG("return %d\n", ret); + LOG_DBG("return %d\n", ret); return ret; } diff --git a/test/linux-generic/pktio_ipc/pktio_ipc2.c b/test/linux-generic/pktio_ipc/pktio_ipc2.c index 062ed9b7..deb6eddf 100644 --- a/test/linux-generic/pktio_ipc/pktio_ipc2.c +++ b/test/linux-generic/pktio_ipc/pktio_ipc2.c @@ -44,7 +44,7 @@ static int ipc_second_process(int master_pid) pool = odp_pool_create(TEST_IPC_POOL_NAME, ¶ms); if (pool == ODP_POOL_INVALID) { - EXAMPLE_ERR("Error: packet pool create failed.\n"); + LOG_ERR("Error: packet pool create failed.\n"); exit(EXIT_FAILURE); } @@ -77,7 +77,7 @@ static int ipc_second_process(int master_pid) if (odp_pktin_queue(ipc_pktio, &pktin, 1) != 1) { odp_pool_destroy(pool); - EXAMPLE_ERR("no input queue\n"); + LOG_ERR("no input queue\n"); return -1; } @@ -105,8 +105,8 @@ static int ipc_second_process(int master_pid) cycle = odp_time_local(); diff = odp_time_diff(cycle, start_cycle); if (odp_time_cmp(wait, diff) < 0) { - EXAMPLE_DBG("exit after %d seconds\n", - run_time_sec); + LOG_DBG("exit after %d seconds\n", + run_time_sec); break; } } @@ -123,7 +123,7 @@ static int ipc_second_process(int master_pid) off = odp_packet_l4_offset(pkt); if (off == ODP_PACKET_OFFSET_INVALID) { - EXAMPLE_ERR("invalid l4 offset\n"); + LOG_ERR("invalid l4 offset\n"); for (int j = i; j < pkts; j++) odp_packet_free(pkt_tbl[j]); break; @@ -133,10 +133,10 @@ static int ipc_second_process(int master_pid) ret = odp_packet_copy_to_mem(pkt, off, sizeof(head), &head); if (ret) - EXAMPLE_ABORT("unable copy out head data"); + LOG_ABORT("unable copy out head data"); if (head.magic != TEST_SEQ_MAGIC) { - EXAMPLE_ERR("Wrong head magic! %x", head.magic); + LOG_ERR("Wrong head magic! %x", head.magic); for (int j = i; j < pkts; j++) odp_packet_free(pkt_tbl[j]); break; @@ -147,13 +147,13 @@ static int ipc_second_process(int master_pid) ret = odp_packet_copy_from_mem(pkt, off, sizeof(head), &head); if (ret) - EXAMPLE_ABORT("unable to copy in head data"); + LOG_ABORT("unable to copy in head data"); } /* send all packets back */ ret = ipc_odp_packet_send_or_free(ipc_pktio, pkt_tbl, i); if (ret < 0) - EXAMPLE_ABORT("can not send packets\n"); + LOG_ABORT("can not send packets\n"); stat_pkts += ret; @@ -174,13 +174,13 @@ static int ipc_second_process(int master_pid) sizeof(head), &head); if (ret) - EXAMPLE_ABORT("unable to copy in head data"); + LOG_ABORT("unable to copy in head data"); pkt_tbl[0] = alloc_pkt; ret = ipc_odp_packet_send_or_free(ipc_pktio, pkt_tbl, 1); if (ret < 0) - EXAMPLE_ABORT("can not send packets\n"); + LOG_ABORT("can not send packets\n"); stat_pkts += 1; } } @@ -188,20 +188,20 @@ static int ipc_second_process(int master_pid) /* cleanup and exit */ ret = odp_pktio_stop(ipc_pktio); if (ret) { - EXAMPLE_DBG("ipc2: odp_pktio_stop error %d\n", ret); + LOG_DBG("ipc2: odp_pktio_stop error %d\n", ret); return -1; } not_started: ret = odp_pktio_close(ipc_pktio); if (ret) { - EXAMPLE_DBG("ipc2: odp_pktio_close error %d\n", ret); + LOG_DBG("ipc2: odp_pktio_close error %d\n", ret); return -1; } ret = odp_pool_destroy(pool); if (ret) - EXAMPLE_DBG("ipc2: pool_destroy error %d\n", ret); + LOG_DBG("ipc2: pool_destroy error %d\n", ret); return stat_pkts > 1000 ? 0 : -1; } @@ -219,7 +219,7 @@ int main(int argc, char *argv[]) parse_args(argc, argv); if (odp_init_global(&instance, NULL, NULL)) { - EXAMPLE_ERR("Error: ODP global init failed.\n"); + LOG_ERR("Error: ODP global init failed.\n"); exit(EXIT_FAILURE); } @@ -243,19 +243,19 @@ int main(int argc, char *argv[]) /* Init this thread */ if (odp_init_local(instance, ODP_THREAD_WORKER)) { - EXAMPLE_ERR("Error: ODP local init failed.\n"); + LOG_ERR("Error: ODP local init failed.\n"); exit(EXIT_FAILURE); } ret = ipc_second_process(master_pid); if (odp_term_local()) { - EXAMPLE_ERR("Error: odp_term_local() failed.\n"); + LOG_ERR("Error: odp_term_local() failed.\n"); exit(EXIT_FAILURE); } if (odp_term_global(instance)) { - EXAMPLE_ERR("Error: odp_term_global() failed.\n"); + LOG_ERR("Error: odp_term_global() failed.\n"); exit(EXIT_FAILURE); }