From 04cda53929c499a72b6265ee4a30e96c84bb6ecc Mon Sep 17 00:00:00 2001 From: Thad House Date: Mon, 29 Mar 2021 09:44:18 -0700 Subject: [PATCH] Add build flag to disable GSO on posix for interop runner (#1395) The interop runner has issues with GSO, where it says its supported but it is not. Add a flag to completely disable GSO on the interop runner --- CMakeLists.txt | 5 +++++ Dockerfile | 3 ++- src/platform/datapath_epoll.c | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f5abcb2c..91dad3d46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,6 +131,7 @@ option(QUIC_RANDOM_ALLOC_FAIL "Randomly fails allocation calls" OFF) option(QUIC_TLS_SECRETS_SUPPORT "Enable export of TLS secrets" OFF) option(QUIC_TELEMETRY_ASSERTS "Enable telemetry asserts in release builds" OFF) option(QUIC_USE_SYSTEM_LIBCRYPTO "Use system libcrypto if openssl TLS" OFF) +option(QUIC_DISABLE_POSIX_GSO "Disable GSO for systems that say they support it but don't" OFF) # FindLTTngUST does not exist before CMake 3.6, so disable logging for older cmake versions if (${CMAKE_VERSION} VERSION_LESS "3.6.0") @@ -342,6 +343,10 @@ else() list(APPEND QUIC_COMMON_DEFINES CX_PLATFORM_LINUX) endif() + if (QUIC_DISABLE_POSIX_GSO) + list(APPEND QUIC_COMMON_DEFINES DISABLE_POSIX_GSO) + endif() + if (QUIC_ENABLE_SANITIZERS) set(QUIC_ENABLE_LOGGING OFF) message(WARNING "LTTng logging is incompatible with sanitizers. Skipping logging") diff --git a/Dockerfile b/Dockerfile index e6b0fa32f..f68596041 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,8 @@ RUN chmod +x /src/scripts/install-powershell-docker.sh RUN /src/scripts/install-powershell-docker.sh ENV PATH="/root/.dotnet/tools:${PATH}" RUN cmake -DQUIC_BUILD_TEST=OFF -DQUIC_BUILD_PERF=OFF \ - -DQUIC_ENABLE_LOGGING=on -DQUIC_TLS_SECRETS_SUPPORT=on .. + -DQUIC_ENABLE_LOGGING=on -DQUIC_TLS_SECRETS_SUPPORT=on \ + -DQUIC_DISABLE_POSIX_GSO=on .. RUN cmake --build . FROM martenseemann/quic-network-simulator-endpoint diff --git a/src/platform/datapath_epoll.c b/src/platform/datapath_epoll.c index 4243eda7c..f38664e58 100644 --- a/src/platform/datapath_epoll.c +++ b/src/platform/datapath_epoll.c @@ -37,6 +37,12 @@ CXPLAT_STATIC_ASSERT((SIZEOF_STRUCT_MEMBER(QUIC_BUFFER, Buffer) == sizeof(void*) // #define CXPLAT_LARGE_SEND_BUFFER_SIZE 0xFFFF +#ifdef DISABLE_POSIX_GSO +#ifdef UDP_SEGMENT +#undef UDP_SEGMENT +#endif +#endif + // // A receive block to receive a UDP packet over the sockets. //