diff mbox series

[2.0,v2,1/6] linux-dpdk: pktio: dpdk: build dpdk pktio based on configuration option

Message ID 1508857207-23099-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [2.0,v2,1/6] linux-dpdk: pktio: dpdk: build dpdk pktio based on configuration option | expand

Commit Message

Github ODP bot Oct. 24, 2017, 3 p.m. UTC
From: Bogdan Pricope <bogdan.pricope@linaro.org>


Build dpdk pktio based on configuration option

Signed-off-by: Bogdan Pricope <bogdan.pricope@linaro.org>

---
/** Email created from pull request 255 (bogdanPricope:2_0_pktio_sub_unif_pr)
 ** https://github.com/Linaro/odp/pull/255
 ** Patch: https://github.com/Linaro/odp/pull/255.patch
 ** Base sha: d37aa7f1c0480273fb0ccfded44a13e3e5a8e42f
 ** Merge commit sha: 7ba6d7f0e026041bb48d6d90f02d9b556020c337
 **/
 platform/linux-dpdk/m4/configure.m4   | 6 ++++++
 platform/linux-dpdk/pktio/dpdk.c      | 3 +++
 platform/linux-dpdk/pktio/subsystem.c | 4 ++++
 3 files changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/platform/linux-dpdk/m4/configure.m4 b/platform/linux-dpdk/m4/configure.m4
index b08136bc3..16fdeadee 100644
--- a/platform/linux-dpdk/m4/configure.m4
+++ b/platform/linux-dpdk/m4/configure.m4
@@ -158,3 +158,9 @@  AC_SUBST([DPDK_LIBS])
 
 AC_CONFIG_FILES([platform/linux-dpdk/Makefile
 		 platform/linux-dpdk/include/odp/api/plat/static_inline.h])
+
+##########################################################################
+# Enable dpdk pktio build
+##########################################################################
+AC_DEFINE([ODP_PKTIO_DPDK], [1],
+	      [Define to 1 to enable DPDK packet I/O support])
diff --git a/platform/linux-dpdk/pktio/dpdk.c b/platform/linux-dpdk/pktio/dpdk.c
index 1248c130e..a6e2573e5 100644
--- a/platform/linux-dpdk/pktio/dpdk.c
+++ b/platform/linux-dpdk/pktio/dpdk.c
@@ -6,6 +6,8 @@ 
 
 #include <config.h>
 
+#ifdef ODP_PKTIO_DPDK
+
 #include <odp_posix_extensions.h>
 #include <stdio.h>
 #include <errno.h>
@@ -760,3 +762,4 @@  ODP_MODULE_CONSTRUCTOR(dpdk_pktio_ops)
  */
 int enable_link_dpdk_pktio_ops = 0;
 
+#endif /* ODP_PKTIO_DPDK */
diff --git a/platform/linux-dpdk/pktio/subsystem.c b/platform/linux-dpdk/pktio/subsystem.c
index 985ae7822..ab99db0d5 100644
--- a/platform/linux-dpdk/pktio/subsystem.c
+++ b/platform/linux-dpdk/pktio/subsystem.c
@@ -22,7 +22,9 @@  ODP_SUBSYSTEM_FOREACH_TEMPLATE(pktio_ops, term_global, ODP_ABORT)
 /* Temporary variable to enable link modules,
  * will remove in Makefile scheme changes.
  */
+#ifdef ODP_PKTIO_DPDK
 extern int enable_link_dpdk_pktio_ops;
+#endif
 extern int enable_link_loopback_pktio_ops;
 
 ODP_SUBSYSTEM_CONSTRUCTOR(pktio_ops)
@@ -30,6 +32,8 @@  ODP_SUBSYSTEM_CONSTRUCTOR(pktio_ops)
 	odp_subsystem_constructor(pktio_ops);
 
 	/* Further initialization per subsystem */
+#ifdef ODP_PKTIO_DPDK
 	enable_link_dpdk_pktio_ops = 1;
+#endif
 	enable_link_loopback_pktio_ops = 1;
 }