Opened 2 years ago

Closed 2 years ago

Last modified 12 months ago

#2292 closed defect (fixed)

nginx config test cannot pass if quic_bpf is enabled

Reported by: zhuizhuhaomeng@… Owned by:
Priority: major Milestone: nginx-1.21
Component: http/3 Version:
Keywords: quic bpf Cc:
uname -a: 5.11.22-100.fc32.x86_64
nginx -V: nginx version: nginx/1.21.4
built by gcc 10.3.1 20210422 (Red Hat 10.3.1-1) (GCC)
built with OpenSSL 1.1.1 (compatible; BoringSSL) (running with BoringSSL)
TLS SNI support enabled
configure arguments: --with-http_v3_module --with-cc-opt=-I/usr/local/openresty/boringssl/include --with-ld-opt='-L/usr/local/openresty/boringssl/lib -Wl,-rpath,/usr/local/openresty/boringssl/lib'

Description

the error message

[root@fedora-lijunlong nginx]# ./sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: [emerg] quic bpf setsockopt(SO_ATTACH_REUSEPORT_EBPF) failed (22: Invalid argument)
nginx: [emerg] ngx_quic_bpf_module failed to initialize, check limits

nginx.conf

worker_processes  2;
worker_cpu_affinity auto;
quic_bpf on;

events {
    worker_connections  1000000;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  65;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_certificate http3.crt;
    ssl_certificate_key http3.key;
    quic_max_idle_timeout 5;

    server {
        listen       80;
        listen       8443 reuseport ssl;
        listen       8443 reuseport http3;
        server_name  localhost;

        access_log  off;

        location / {
            root   html;
            index  index.html index.htm;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

Change History (8)

comment:1 by vl, 2 years ago

Works fine here with 5.9.2

What is the host you are running at (arch, linux distribution version, container or not?)

in reply to:  1 comment:2 by zhuizhuhaomeng@…, 2 years ago

Replying to vl:

Works fine here with 5.9.2

What is the host you are running at (arch, linux distribution version, container or not?)

fedora 32
amd64 CPU
kvm

comment:3 by vl, 2 years ago

I see that fedora 32 was released with kernel 5.6 initially, but you are using 5.11.
Was it some official update? Did you update kernel headers as well and rebuilt nginx?
Was it built on the same machine as you are trying to run?

in reply to:  3 comment:4 by zhuizhuhaomeng@…, 2 years ago

Replying to vl:

I see that fedora 32 was released with kernel 5.6 initially, but you are using 5.11.
Was it some official update? Did you update kernel headers as well and rebuilt nginx?
Was it built on the same machine as you are trying to run?


It is an official update. and I update the kernel headers as well, but does not exactly match.
run on the machine which built nginx.

Should I built linux kernel myself?

comment:5 by vl, 2 years ago

Status: newaccepted

ok, I was able to reproduce the issue. It happens only with '-t' flag. This need to be fixed.

comment:6 by vl, 2 years ago

Summary: quic bpf can not work when linux version greater than 5.7nginx config test cannot pass if quic_bpf is enabled

comment:7 by vl, 2 years ago

Resolution: fixed
Status: acceptedclosed

comment:8 by Vladimir Homutov <vl@…>, 12 months ago

In 8951:7c0f9bb27763/nginx:

QUIC: fixed config test with bpf (ticket #2292).

The SO_REUSEPORT socket option is not set during configuration testing,
thus making the further module initialization impossible and meaningless.

Note: See TracTickets for help on using tickets.