[nginx] Core: added autotest for UDP segmentation offloading.

Vladimir Homutov vl at nginx.com
Thu Jan 27 11:43:30 UTC 2022


details:   https://hg.nginx.org/nginx/rev/c0a432c0301b
branches:  
changeset: 8004:c0a432c0301b
user:      Vladimir Homutov <vl at nginx.com>
date:      Wed Jan 26 20:40:00 2022 +0300
description:
Core: added autotest for UDP segmentation offloading.

diffstat:

 auto/os/linux                  |  16 ++++++++++++++++
 src/os/unix/ngx_linux_config.h |   4 ++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diffs (38 lines):

diff -r 0f6cc8f73744 -r c0a432c0301b auto/os/linux
--- a/auto/os/linux	Tue Jan 25 15:48:58 2022 +0300
+++ b/auto/os/linux	Wed Jan 26 20:40:00 2022 +0300
@@ -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"
diff -r 0f6cc8f73744 -r c0a432c0301b src/os/unix/ngx_linux_config.h
--- a/src/os/unix/ngx_linux_config.h	Tue Jan 25 15:48:58 2022 +0300
+++ b/src/os/unix/ngx_linux_config.h	Wed Jan 26 20:40:00 2022 +0300
@@ -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
 



More information about the nginx-devel mailing list