]> git.kaiwu.me - nginx.git/commitdiff
Core: added autotest for UDP segmentation offloading.
authorVladimir Homutov <vl@nginx.com>
Wed, 26 Jan 2022 17:40:00 +0000 (20:40 +0300)
committerVladimir Homutov <vl@nginx.com>
Wed, 26 Jan 2022 17:40:00 +0000 (20:40 +0300)
auto/os/linux
src/os/unix/ngx_linux_config.h

index 74b587026b8e8b790e31f2de46fb92e1026fb35f..0ae701fad6daf932d6df022a872b7153a78a9697 100644 (file)
@@ -232,4 +232,20 @@ ngx_feature_test="struct crypt_data  cd;
 ngx_include="sys/vfs.h";     . auto/include
 
 
+# UDP segmentation offloading
+
+ngx_feature="UDP_SEGMENT"
+ngx_feature_name="NGX_HAVE_UDP_SEGMENT"
+ngx_feature_run=no
+ngx_feature_incs="#include <sys/socket.h>
+                  #include <stdint.h>
+                  #include <netinet/udp.h>"
+ngx_feature_path=
+ngx_feature_libs=
+ngx_feature_test="socklen_t optlen = sizeof(int);
+                  int val;
+                  getsockopt(0, SOL_UDP, UDP_SEGMENT, &val, &optlen)"
+. auto/feature
+
+
 CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
index 3036caebf630e2d3e16d7b2cb3916c4edcf74f0f..88fef47cefebab26cfa3c343fb1131a74235532d 100644 (file)
@@ -103,6 +103,10 @@ typedef struct iocb  ngx_aiocb_t;
 #include <linux/capability.h>
 #endif
 
+#if (NGX_HAVE_UDP_SEGMENT)
+#include <netinet/udp.h>
+#endif
+
 
 #define NGX_LISTEN_BACKLOG        511