summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-08-31 09:56:55 -0400
committerDavid Goulet <dgoulet@torproject.org>2017-09-15 11:40:59 -0400
commit8424c4f35bd77f5b83113a74c424ca6d12393f1d (patch)
tree2cacb7f86d6e7ecd0968631606fcd2448c3ced8e /configure.ac
parentdde358667d386d2c7b28866b029effa062ab9b6d (diff)
downloadtor-8424c4f35bd77f5b83113a74c424ca6d12393f1d.tar.gz
tor-8424c4f35bd77f5b83113a74c424ca6d12393f1d.zip
sched: Detect KIST support at compile time
Add a detection for the KIST scheduler in our build system and set HAVE_KIST_SUPPORT if available. Adapt the should use kist function with this new compile option. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac28
1 files changed, 28 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 1e41b3f080..c449294d0f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -792,6 +792,34 @@ AC_CHECK_MEMBERS([SSL.state], , ,
[#include <openssl/ssl.h>
])
+dnl Define the set of checks for KIST scheduler support.
+AC_DEFUN([CHECK_KIST_SUPPORT],[
+ dnl KIST needs struct tcp_info and for certain members to exist.
+ AC_CHECK_MEMBERS(
+ [struct tcp_info.tcpi_unacked, struct tcp_info.tcpi_snd_mss],
+ , ,[[#include <netinet/tcp.h>]])
+ dnl KIST needs SIOCOUTQNSD to exist for an ioctl call.
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
+ #include <linux/sockios.h>
+ #ifndef SIOCOUTQNSD
+ #error
+ #endif
+ ])], have_siocoutqnsd=yes, have_siocoutqnsd=no)
+ if test "x$have_siocoutqnsd" = "xyes"; then
+ if test "x$ac_cv_member_struct_tcp_info_tcpi_unacked" = "xyes"; then
+ if test "x$ac_cv_member_struct_tcp_info_tcpi_snd_mss" = "xyes"; then
+ have_kist_support=yes
+ fi
+ fi
+ fi
+])
+dnl Now, trigger the check.
+CHECK_KIST_SUPPORT
+AS_IF([test "x$have_kist_support" = "xyes"],
+ [AC_DEFINE(HAVE_KIST_SUPPORT, 1, [Defined if KIST scheduler is supported
+ on this system])],
+ [AC_MSG_NOTICE([KIST scheduler can't be used. Missing support.])])
+
LIBS="$save_LIBS"
LDFLAGS="$save_LDFLAGS"
CPPFLAGS="$save_CPPFLAGS"