From patchwork Thu Sep 7 12:00:05 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: 111903 Delivered-To: patch@linaro.org Received: by 10.37.128.210 with SMTP id c18csp103159ybm; Thu, 7 Sep 2017 05:23:46 -0700 (PDT) X-Google-Smtp-Source: ADKCNb6HMDAXsg7nyEXrCb9Y0YduhV61wKDlTZD/Feq4kFv0z0ffNyPH0x72bZoiKOdqVg8caB9q X-Received: by 10.200.44.107 with SMTP id e40mr3293037qta.262.1504787026819; Thu, 07 Sep 2017 05:23:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504787026; cv=none; d=google.com; s=arc-20160816; b=LoQYpGszP+LnqxW3J3AHuQr3h6Uu+5815h3QgHuYMZKyV7ZFuu1qv75Y+ODlcH4T5f nwno4X0iyiWDoBS5l5HcUUZ1eHJ4mZTVVKtcmBvGUflEEAYPMoWExoLROvBaPpJMEtPd D8jnlnPE1bZPrNCxvXzphiI/GPyMZPkHATzFWf+SSjjPZgXeBjo21wI4497mTAaDNcQM XsWmpXPVvm+3KFVI8A5z579uGpywq4ilMT9pqgjPkAXPgAjhojrOh4BZ3KUG9W+MvbFA Ox53Ye321wo+/IbseyxPVDLys7/goDxOer6Ulx9XmmyA1LamnRSmgCwEN3+Fgay4+V+C Rvig== 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=0ZVbxZiM0RrdqOEHxCuxPP719jXsNtoKG9KewNL/E6s=; b=y0MQduPyKqQUjlSIBeiIcnKnnWVEGZjYiZhrmYI4tLFucBCO0vjXOMu3e9Xpm7eBRw V3iVHOZhGJPULywP5093wVW3n7f+9X1nC/RQ7zhiiet+HkdccvPUwVULVo9emtidORM6 PhKkWkNdbaIPb1PnGQN0dUF1QYhYP4PQrE1+to1prsTAycTxX+Ymc4ENOK/tUaQOOhEp fZUJm8YPKtijsa1e5ijlR1AIXZy2/3heeIj5beBuspA+jLNVrIBTGCVNETbzHRQv7ZUD YsEeN5LFo6D9LGuNgt5OhS+e3hnCExTvp68ydVVr6gn925nrw4Ext9kak+hrVpgu+/Y5 Yg7Q== 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 f30si2698747qta.485.2017.09.07.05.23.46; Thu, 07 Sep 2017 05:23:46 -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 6271F65BCB; Thu, 7 Sep 2017 12:23:46 +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 A86F865BD1; Thu, 7 Sep 2017 12:07:37 +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 3CC0E60C30; Thu, 7 Sep 2017 12:06:27 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id 6173D646DE for ; Thu, 7 Sep 2017 12:00:36 +0000 (UTC) Received: from mxback9g.mail.yandex.net (mxback9g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:170]) by forward106j.mail.yandex.net (Yandex) with ESMTP id D87F0180340E for ; Thu, 7 Sep 2017 15:00:34 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback9g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id kOe4icchmh-0YcGnLLl; Thu, 07 Sep 2017 15:00:34 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id OSCKROY85q-0Xd40wWA; Thu, 07 Sep 2017 15:00:33 +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: Thu, 7 Sep 2017 15:00:05 +0300 Message-Id: <1504785609-27545-11-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504785609-27545-1-git-send-email-odpbot@yandex.ru> References: <1504785609-27545-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 165 Subject: [lng-odp] [PATCH v4 10/14] 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 --- /** Email created from pull request 165 (lumag:improve-build-3) ** https://github.com/Linaro/odp/pull/165 ** Patch: https://github.com/Linaro/odp/pull/165.patch ** Base sha: 360c1d34b52a2356619b9290811862b9de41de00 ** Merge commit sha: b3c5b66f989f86f62c8d44471480599b93cac6c0 **/ 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); }