summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2018-10-12 17:17:10 +0200
committerDimitri Staessens <[email protected]>2018-10-12 17:30:49 +0200
commit33e89097c05cb0bb1816a15aa5ef4740d03eb90a (patch)
treefb9aba94899fb954f22a8017e7d9ab164e3be331
parent7abcc9be25efce7a0848bb2ba79d6f142df0cee9 (diff)
downloadouroboros-33e89097c05cb0bb1816a15aa5ef4740d03eb90a.tar.gz
ouroboros-33e89097c05cb0bb1816a15aa5ef4740d03eb90a.zip
ipcpd: Make Qdisc bypass configurable
This will make bypassing the qdisc configurable, as it might be handy for getting fast data rates but is generally needed. Signed-off-by: Sander Vrijders <[email protected]> Signed-off-by: Dimitri Staessens <[email protected]>
-rw-r--r--src/ipcpd/config.h.in1
-rw-r--r--src/ipcpd/eth/CMakeLists.txt2
-rw-r--r--src/ipcpd/eth/eth.c4
3 files changed, 7 insertions, 0 deletions
diff --git a/src/ipcpd/config.h.in b/src/ipcpd/config.h.in
index 567fe971..04565fab 100644
--- a/src/ipcpd/config.h.in
+++ b/src/ipcpd/config.h.in
@@ -63,3 +63,4 @@
#cmakedefine HAVE_RAW_SOCKETS
#define IPCP_ETH_RD_THR @IPCP_ETH_RD_THR@
#define IPCP_ETH_WR_THR @IPCP_ETH_WR_THR@
+#cmakedefine IPCP_ETH_QDISC_BYPASS
diff --git a/src/ipcpd/eth/CMakeLists.txt b/src/ipcpd/eth/CMakeLists.txt
index 6672f93c..e4acdb7f 100644
--- a/src/ipcpd/eth/CMakeLists.txt
+++ b/src/ipcpd/eth/CMakeLists.txt
@@ -82,6 +82,8 @@ if (HAVE_ETH)
"Number of reader threads in Ethernet IPCP")
set(IPCP_ETH_WR_THR 3 CACHE STRING
"Number of writer threads in Ethernet IPCP")
+ set(IPCP_ETH_QDISC_BYPASS false CACHE BOOL
+ "Bypass the Qdisc in the kernel when using raw sockets")
set(ETH_LLC_SOURCES
# Add source files here
diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c
index e7a1580c..3a749cf7 100644
--- a/src/ipcpd/eth/eth.c
+++ b/src/ipcpd/eth/eth.c
@@ -1231,7 +1231,9 @@ static int eth_ipcp_bootstrap(const struct ipcp_config * conf)
size_t maxsz;
#endif
#if defined(HAVE_RAW_SOCKETS)
+ #if defined(IPCP_ETH_QDISC_BYPASS)
int qdisc_bypass = 1;
+ #endif /* ENABLE_QDISC_BYPASS */
int flags;
#endif
assert(conf);
@@ -1415,10 +1417,12 @@ static int eth_ipcp_bootstrap(const struct ipcp_config * conf)
goto fail_device;
}
+ #if defined(IPCP_ETH_QDISC_BYPASS)
if (setsockopt(eth_data.s_fd, SOL_PACKET, PACKET_QDISC_BYPASS,
&qdisc_bypass, sizeof(qdisc_bypass))) {
log_info("Qdisc bypass not supported.");
}
+ #endif
if (bind(eth_data.s_fd, (struct sockaddr *) &eth_data.device,
sizeof(eth_data.device))) {