diff mbox series

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

Message ID 1508857207-23099-5-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 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.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 2cc16a045..7a2a11e2c 100644
--- a/platform/linux-generic/m4/configure.m4
+++ b/platform/linux-generic/m4/configure.m4
@@ -97,3 +97,6 @@  AC_DEFINE([ODP_PKTIO_IPC], [1],
 
 AC_DEFINE([ODP_PKTIO_TAP], [1],
 	      [Define to 1 to enable TAP packet I/O support])
+
+AC_DEFINE([ODP_PKTIO_SOCKET], [1],
+	      [Define to 1 to enable SOCKET packet I/O support])
diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c
index 238cd67f9..7481f4f7f 100644
--- a/platform/linux-generic/pktio/socket.c
+++ b/platform/linux-generic/pktio/socket.c
@@ -7,6 +7,8 @@ 
 
 #include "config.h"
 
+#ifdef ODP_PKTIO_SOCKET
+
 #include <odp_posix_extensions.h>
 
 #include <sys/socket.h>
@@ -570,3 +572,5 @@  ODP_MODULE_CONSTRUCTOR(socket_pktio_ops)
  * will remove in Makefile scheme changes.
  */
 int enable_link_socket_pktio_ops = 0;
+
+#endif /* ODP_PKTIO_SOCKET */
diff --git a/platform/linux-generic/pktio/subsystem.c b/platform/linux-generic/pktio/subsystem.c
index 76b8a9283..b65ea1dbe 100644
--- a/platform/linux-generic/pktio/subsystem.c
+++ b/platform/linux-generic/pktio/subsystem.c
@@ -33,7 +33,9 @@  extern int enable_link_netmap_pktio_ops;
 #ifdef HAVE_PCAP
 extern int enable_link_pcap_pktio_ops;
 #endif
+#ifdef ODP_PKTIO_SOCKET
 extern int enable_link_socket_pktio_ops;
+#endif
 extern int enable_link_socket_mmap_pktio_ops;
 #ifdef ODP_PKTIO_TAP
 extern int enable_link_tap_pktio_ops;
@@ -58,7 +60,9 @@  ODP_SUBSYSTEM_CONSTRUCTOR(pktio_ops)
 #ifdef HAVE_PCAP
 	enable_link_pcap_pktio_ops = 1;
 #endif
+#ifdef ODP_PKTIO_SOCKET
 	enable_link_socket_pktio_ops = 1;
+#endif
 	enable_link_socket_mmap_pktio_ops = 1;
 #ifdef ODP_PKTIO_TAP
 	enable_link_tap_pktio_ops = 1;