diff mbox series

[2.0,v2,5/6] linux-gen: pktio: socket: build SOCKET_MMAP pktio based on configuration option

Message ID 1508857207-23099-6-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 SOCKET_MMAP 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-generic/m4/configure.m4     | 3 +++
 platform/linux-generic/pktio/socket_mmap.c | 4 ++++
 platform/linux-generic/pktio/subsystem.c   | 4 ++++
 3 files changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4
index 7a2a11e2c..c1d3509dc 100644
--- a/platform/linux-generic/m4/configure.m4
+++ b/platform/linux-generic/m4/configure.m4
@@ -100,3 +100,6 @@  AC_DEFINE([ODP_PKTIO_TAP], [1],
 
 AC_DEFINE([ODP_PKTIO_SOCKET], [1],
 	      [Define to 1 to enable SOCKET packet I/O support])
+
+AC_DEFINE([ODP_PKTIO_SOCKET_MMAP], [1],
+	      [Define to 1 to enable SOCKET_MMAP packet I/O support])
diff --git a/platform/linux-generic/pktio/socket_mmap.c b/platform/linux-generic/pktio/socket_mmap.c
index 3b62979d8..67d2b9206 100644
--- a/platform/linux-generic/pktio/socket_mmap.c
+++ b/platform/linux-generic/pktio/socket_mmap.c
@@ -7,6 +7,8 @@ 
 
 #include "config.h"
 
+#ifdef ODP_PKTIO_SOCKET_MMAP
+
 #include <odp_posix_extensions.h>
 
 #include <odp_packet_io_internal.h>
@@ -777,3 +779,5 @@  ODP_MODULE_CONSTRUCTOR(socket_mmap_pktio_ops)
  * will remove in Makefile scheme changes.
  */
 int enable_link_socket_mmap_pktio_ops = 0;
+
+#endif /* ODP_PKTIO_SOCKET_MMAP */
diff --git a/platform/linux-generic/pktio/subsystem.c b/platform/linux-generic/pktio/subsystem.c
index b65ea1dbe..d26c152c3 100644
--- a/platform/linux-generic/pktio/subsystem.c
+++ b/platform/linux-generic/pktio/subsystem.c
@@ -36,7 +36,9 @@  extern int enable_link_pcap_pktio_ops;
 #ifdef ODP_PKTIO_SOCKET
 extern int enable_link_socket_pktio_ops;
 #endif
+#ifdef ODP_PKTIO_SOCKET_MMAP
 extern int enable_link_socket_mmap_pktio_ops;
+#endif
 #ifdef ODP_PKTIO_TAP
 extern int enable_link_tap_pktio_ops;
 #endif
@@ -63,7 +65,9 @@  ODP_SUBSYSTEM_CONSTRUCTOR(pktio_ops)
 #ifdef ODP_PKTIO_SOCKET
 	enable_link_socket_pktio_ops = 1;
 #endif
+#ifdef ODP_PKTIO_SOCKET_MMAP
 	enable_link_socket_mmap_pktio_ops = 1;
+#endif
 #ifdef ODP_PKTIO_TAP
 	enable_link_tap_pktio_ops = 1;
 #endif