comparison auto/os/linux @ 8676:7df607cb2d11 quic

QUIC: ngx_quic_bpf module. The quic kernel bpf helper inspects packet payload for DCID, extracts key and routes the packet into socket matching the key. Due to reuseport feature, each worker owns a personal socket, which is identified by the same key, used to create DCID. BPF objects are locked in RAM and are subject to RLIMIT_MEMLOCK. The "ulimit -l" command may be used to setup proper limits, if maps cannot be created with EPERM or updated with ETOOLONG.
author Vladimir Homutov <vl@nginx.com>
date Fri, 25 Dec 2020 15:01:15 +0300
parents d3747ba486e7
children 7f95010f10b7
comparison
equal deleted inserted replaced
8675:d3747ba486e7 8676:7df607cb2d11
232 BPF_FOUND=YES 232 BPF_FOUND=YES
233 233
234 CORE_SRCS="$CORE_SRCS src/core/ngx_bpf.c" 234 CORE_SRCS="$CORE_SRCS src/core/ngx_bpf.c"
235 CORE_DEPS="$CORE_DEPS src/core/ngx_bpf.h" 235 CORE_DEPS="$CORE_DEPS src/core/ngx_bpf.h"
236 fi 236 fi
237
238
239 # SO_COOKIE socket option
240
241 ngx_feature="SO_COOKIE"
242 ngx_feature_name="NGX_HAVE_SO_COOKIE"
243 ngx_feature_run=no
244 ngx_feature_incs="#include <sys/socket.h>
245 #include <stdint.h>"
246 ngx_feature_path=
247 ngx_feature_libs=
248 ngx_feature_test="socklen_t optlen = sizeof(uint64_t);
249 uint64_t cookie;
250 getsockopt(0, SOL_SOCKET, SO_COOKIE, &cookie, &optlen)"
251 . auto/feature
252
253 if [ $ngx_found = yes ]; then
254 SO_COOKIE_FOUND=YES
255 have=NGX_HAVE_SO_COOKIE . auto/have
256 fi
257
258
259 # ngx_quic_bpf module uses sockhash to select socket from reuseport group,
260 # support appeared in Linux-5.7:
261 #
262 # commit: 9fed9000c5c6cacfcaaa48aff74818072ae294cc
263 # bpf: Allow selecting reuseport socket from a SOCKMAP/SOCKHASH
264 #
265 if [ $NGX_QUIC_BPF$BPF_FOUND = YESYES ]; then
266 echo $ngx_n "checking for kernel with reuseport/BPF support...$ngx_c"
267 if [ $version -lt 329472 ]; then
268 echo " not found (at least 5.7 is required)"
269 NGX_QUIC_BPF=NO
270 else
271 echo " found"
272 fi
273 fi
274