Signed-off-by: Maxim Uvarov <[email protected]>
---
 configure.ac                                    |  1 -
 example/Makefile.am                             |  2 +-
 example/l2fwd/.gitignore                        |  1 -
 example/l2fwd/Makefile.am                       | 10 ----------
 test/performance/.gitignore                     |  3 ++-
 test/performance/Makefile.am                    |  4 ++--
 {example/l2fwd => test/performance}/odp_l2fwd.c | 26 ++++++++++++-------------
 7 files changed, 18 insertions(+), 29 deletions(-)
 delete mode 100644 example/l2fwd/.gitignore
 delete mode 100644 example/l2fwd/Makefile.am
 rename {example/l2fwd => test/performance}/odp_l2fwd.c (96%)

diff --git a/configure.ac b/configure.ac
index 57054c5..0ec83f2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -252,7 +252,6 @@ AC_CONFIG_FILES([Makefile
                 example/Makefile
                 example/generator/Makefile
                 example/ipsec/Makefile
-                example/l2fwd/Makefile
                 example/packet/Makefile
                 example/timer/Makefile
                 pkgconfig/libodp.pc
diff --git a/example/Makefile.am b/example/Makefile.am
index 3021571..6bb4f5c 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -1 +1 @@
-SUBDIRS = generator ipsec l2fwd packet timer
+SUBDIRS = generator ipsec packet timer
diff --git a/example/l2fwd/.gitignore b/example/l2fwd/.gitignore
deleted file mode 100644
index 8563319..0000000
--- a/example/l2fwd/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-odp_l2fwd
diff --git a/example/l2fwd/Makefile.am b/example/l2fwd/Makefile.am
deleted file mode 100644
index feced2a..0000000
--- a/example/l2fwd/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-include $(top_srcdir)/example/Makefile.inc
-
-bin_PROGRAMS = odp_l2fwd
-odp_l2fwd_LDFLAGS = $(AM_LDFLAGS) -static
-odp_l2fwd_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/example
-
-noinst_HEADERS = \
-                 $(top_srcdir)/example/example_debug.h
-
-dist_odp_l2fwd_SOURCES = odp_l2fwd.c
diff --git a/test/performance/.gitignore b/test/performance/.gitignore
index 1bdb90d..d41d1e1 100644
--- a/test/performance/.gitignore
+++ b/test/performance/.gitignore
@@ -1,4 +1,5 @@
 *.log
 *.trs
-odp_scheduling
 odp_atomic
+odp_l2fwd
+odp_scheduling
diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am
index b0f7457..b501584 100644
--- a/test/performance/Makefile.am
+++ b/test/performance/Makefile.am
@@ -1,10 +1,10 @@
 include $(top_srcdir)/test/Makefile.inc
 
-TESTS_ENVIRONMENT = TEST_DIR=${builddir}
+TESTS_ENVIRONMENT = TEST_DIR=${builddir} ODP_PLATFORM=${with_platform}
 
 EXECUTABLES = odp_atomic
 
-COMPILE_ONLY = odp_scheduling
+COMPILE_ONLY = odp_scheduling odp_l2fwd
 
 TESTSCRIPTS = odp_scheduling_run
 
diff --git a/example/l2fwd/odp_l2fwd.c b/test/performance/odp_l2fwd.c
similarity index 96%
rename from example/l2fwd/odp_l2fwd.c
rename to test/performance/odp_l2fwd.c
index 4a49008..5d4b833 100644
--- a/example/l2fwd/odp_l2fwd.c
+++ b/test/performance/odp_l2fwd.c
@@ -18,7 +18,7 @@
 #include <unistd.h>
 #include <errno.h>
 
-#include <example_debug.h>
+#include <test_debug.h>
 
 #include <odp.h>
 #include <odp/helper/linux.h>
@@ -176,7 +176,7 @@ static inline odp_queue_t lookup_dest_q(odp_packet_t pkt)
                        src_idx = i;
 
        if (src_idx == -1)
-               EXAMPLE_ABORT("Failed to determine pktio input\n");
+               LOG_ABORT("Failed to determine pktio input\n");
 
        dst_idx = (src_idx % 2 == 0) ? src_idx+1 : src_idx-1;
        pktio_dst = gbl_args->pktios[dst_idx];
@@ -261,7 +261,7 @@ static odp_pktio_t create_pktio(const char *dev, odp_pool_t 
pool,
 
        pktio = odp_pktio_open(dev, pool);
        if (pktio == ODP_PKTIO_INVALID) {
-               EXAMPLE_ERR("Error: failed to open %s\n", dev);
+               LOG_ERR("Error: failed to open %s\n", dev);
                return ODP_PKTIO_INVALID;
        }
 
@@ -281,13 +281,13 @@ static odp_pktio_t create_pktio(const char *dev, 
odp_pool_t pool,
 
        inq_def = odp_queue_create(inq_name, ODP_QUEUE_TYPE_PKTIN, &qparam);
        if (inq_def == ODP_QUEUE_INVALID) {
-               EXAMPLE_ERR("Error: pktio queue creation failed\n");
+               LOG_ERR("Error: pktio queue creation failed\n");
                return ODP_PKTIO_INVALID;
        }
 
        ret = odp_pktio_inq_setdef(pktio, inq_def);
        if (ret != 0) {
-               EXAMPLE_ERR("Error: default input-Q setup\n");
+               LOG_ERR("Error: default input-Q setup\n");
                return ODP_PKTIO_INVALID;
        }
 
@@ -354,13 +354,13 @@ int main(int argc, char *argv[])
 
        /* Init ODP before calling anything else */
        if (odp_init_global(NULL, NULL)) {
-               EXAMPLE_ERR("Error: ODP global init failed.\n");
+               LOG_ERR("Error: ODP global init failed.\n");
                exit(EXIT_FAILURE);
        }
 
        /* Init this thread */
        if (odp_init_local()) {
-               EXAMPLE_ERR("Error: ODP local init failed.\n");
+               LOG_ERR("Error: ODP local init failed.\n");
                exit(EXIT_FAILURE);
        }
 
@@ -370,7 +370,7 @@ int main(int argc, char *argv[])
        gbl_args = odp_shm_addr(shm);
 
        if (gbl_args == NULL) {
-               EXAMPLE_ERR("Error: shared mem alloc failed.\n");
+               LOG_ERR("Error: shared mem alloc failed.\n");
                exit(EXIT_FAILURE);
        }
        memset(gbl_args, 0, sizeof(*gbl_args));
@@ -398,13 +398,13 @@ int main(int argc, char *argv[])
        printf("cpu mask:           %s\n", cpumaskstr);
 
        if (num_workers < gbl_args->appl.if_count) {
-               EXAMPLE_ERR("Error: CPU count %d less than interface count\n",
-                           num_workers);
+               LOG_ERR("Error: CPU count %d less than interface count\n",
+                       num_workers);
                exit(EXIT_FAILURE);
        }
        if (gbl_args->appl.if_count % 2 != 0) {
-               EXAMPLE_ERR("Error: interface count %d is odd in fwd appl.\n",
-                           gbl_args->appl.if_count);
+               LOG_ERR("Error: interface count %d is odd in fwd appl.\n",
+                       gbl_args->appl.if_count);
                exit(EXIT_FAILURE);
        }
 
@@ -418,7 +418,7 @@ int main(int argc, char *argv[])
        pool = odp_pool_create("packet pool", ODP_SHM_NULL, &params);
 
        if (pool == ODP_POOL_INVALID) {
-               EXAMPLE_ERR("Error: packet pool create failed.\n");
+               LOG_ERR("Error: packet pool create failed.\n");
                exit(EXIT_FAILURE);
        }
        odp_pool_print(pool);
-- 
1.9.1

_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to