comparison src/event/quic/ngx_event_quic_bpf_code.c @ 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
children 85e60c064728
comparison
equal deleted inserted replaced
8675:d3747ba486e7 8676:7df607cb2d11
1 /* AUTO-GENERATED, DO NOT EDIT. */
2
3 #include <stddef.h>
4 #include <stdint.h>
5
6 #include "ngx_bpf.h"
7
8
9 static ngx_bpf_reloc_t bpf_reloc_prog_ngx_quic_reuseport_helper[] = {
10 { "ngx_quic_sockmap", 56 },
11 };
12
13 static struct bpf_insn bpf_insn_prog_ngx_quic_reuseport_helper[] = {
14 /* opcode dst src offset imm */
15 { 0x79, BPF_REG_4, BPF_REG_1, (int16_t) 0, 0x0 },
16 { 0x79, BPF_REG_3, BPF_REG_1, (int16_t) 8, 0x0 },
17 { 0xbf, BPF_REG_2, BPF_REG_4, (int16_t) 0, 0x0 },
18 { 0x7, BPF_REG_2, BPF_REG_0, (int16_t) 0, 0x8 },
19 { 0x2d, BPF_REG_2, BPF_REG_3, (int16_t) 55, 0x0 },
20 { 0xbf, BPF_REG_5, BPF_REG_4, (int16_t) 0, 0x0 },
21 { 0x7, BPF_REG_5, BPF_REG_0, (int16_t) 0, 0x9 },
22 { 0x2d, BPF_REG_5, BPF_REG_3, (int16_t) 52, 0x0 },
23 { 0xb7, BPF_REG_5, BPF_REG_0, (int16_t) 0, 0x14 },
24 { 0xb7, BPF_REG_0, BPF_REG_0, (int16_t) 0, 0x9 },
25 { 0x71, BPF_REG_6, BPF_REG_2, (int16_t) 0, 0x0 },
26 { 0x67, BPF_REG_6, BPF_REG_0, (int16_t) 0, 0x38 },
27 { 0xc7, BPF_REG_6, BPF_REG_0, (int16_t) 0, 0x38 },
28 { 0x65, BPF_REG_6, BPF_REG_0, (int16_t) 10, 0xffffffff },
29 { 0xbf, BPF_REG_2, BPF_REG_4, (int16_t) 0, 0x0 },
30 { 0x7, BPF_REG_2, BPF_REG_0, (int16_t) 0, 0xd },
31 { 0x2d, BPF_REG_2, BPF_REG_3, (int16_t) 43, 0x0 },
32 { 0xbf, BPF_REG_5, BPF_REG_4, (int16_t) 0, 0x0 },
33 { 0x7, BPF_REG_5, BPF_REG_0, (int16_t) 0, 0xe },
34 { 0x2d, BPF_REG_5, BPF_REG_3, (int16_t) 40, 0x0 },
35 { 0xb7, BPF_REG_0, BPF_REG_0, (int16_t) 0, 0xe },
36 { 0x71, BPF_REG_5, BPF_REG_4, (int16_t) 12, 0x0 },
37 { 0xb7, BPF_REG_6, BPF_REG_0, (int16_t) 0, 0x8 },
38 { 0x2d, BPF_REG_6, BPF_REG_5, (int16_t) 36, 0x0 },
39 { 0xf, BPF_REG_5, BPF_REG_0, (int16_t) 0, 0x0 },
40 { 0xf, BPF_REG_4, BPF_REG_5, (int16_t) 0, 0x0 },
41 { 0x2d, BPF_REG_4, BPF_REG_3, (int16_t) 33, 0x0 },
42 { 0xbf, BPF_REG_4, BPF_REG_2, (int16_t) 0, 0x0 },
43 { 0x7, BPF_REG_4, BPF_REG_0, (int16_t) 0, 0x9 },
44 { 0x2d, BPF_REG_4, BPF_REG_3, (int16_t) 30, 0x0 },
45 { 0x71, BPF_REG_4, BPF_REG_2, (int16_t) 1, 0x0 },
46 { 0x67, BPF_REG_4, BPF_REG_0, (int16_t) 0, 0x38 },
47 { 0x71, BPF_REG_3, BPF_REG_2, (int16_t) 2, 0x0 },
48 { 0x67, BPF_REG_3, BPF_REG_0, (int16_t) 0, 0x30 },
49 { 0x4f, BPF_REG_3, BPF_REG_4, (int16_t) 0, 0x0 },
50 { 0x71, BPF_REG_4, BPF_REG_2, (int16_t) 3, 0x0 },
51 { 0x67, BPF_REG_4, BPF_REG_0, (int16_t) 0, 0x28 },
52 { 0x4f, BPF_REG_3, BPF_REG_4, (int16_t) 0, 0x0 },
53 { 0x71, BPF_REG_4, BPF_REG_2, (int16_t) 4, 0x0 },
54 { 0x67, BPF_REG_4, BPF_REG_0, (int16_t) 0, 0x20 },
55 { 0x4f, BPF_REG_3, BPF_REG_4, (int16_t) 0, 0x0 },
56 { 0x71, BPF_REG_4, BPF_REG_2, (int16_t) 5, 0x0 },
57 { 0x67, BPF_REG_4, BPF_REG_0, (int16_t) 0, 0x38 },
58 { 0xc7, BPF_REG_4, BPF_REG_0, (int16_t) 0, 0x20 },
59 { 0x4f, BPF_REG_3, BPF_REG_4, (int16_t) 0, 0x0 },
60 { 0x71, BPF_REG_4, BPF_REG_2, (int16_t) 6, 0x0 },
61 { 0x67, BPF_REG_4, BPF_REG_0, (int16_t) 0, 0x10 },
62 { 0x4f, BPF_REG_3, BPF_REG_4, (int16_t) 0, 0x0 },
63 { 0x71, BPF_REG_4, BPF_REG_2, (int16_t) 7, 0x0 },
64 { 0x67, BPF_REG_4, BPF_REG_0, (int16_t) 0, 0x8 },
65 { 0x4f, BPF_REG_3, BPF_REG_4, (int16_t) 0, 0x0 },
66 { 0x71, BPF_REG_2, BPF_REG_2, (int16_t) 8, 0x0 },
67 { 0x4f, BPF_REG_3, BPF_REG_2, (int16_t) 0, 0x0 },
68 { 0x7b, BPF_REG_10, BPF_REG_3, (int16_t) 65528, 0x0 },
69 { 0xbf, BPF_REG_3, BPF_REG_10, (int16_t) 0, 0x0 },
70 { 0x7, BPF_REG_3, BPF_REG_0, (int16_t) 0, 0xfffffff8 },
71 { 0x18, BPF_REG_2, BPF_REG_0, (int16_t) 0, 0x0 },
72 { 0x0, BPF_REG_0, BPF_REG_0, (int16_t) 0, 0x0 },
73 { 0xb7, BPF_REG_4, BPF_REG_0, (int16_t) 0, 0x0 },
74 { 0x85, BPF_REG_0, BPF_REG_0, (int16_t) 0, 0x52 },
75 { 0xb7, BPF_REG_0, BPF_REG_0, (int16_t) 0, 0x1 },
76 { 0x95, BPF_REG_0, BPF_REG_0, (int16_t) 0, 0x0 },
77 };
78
79
80 ngx_bpf_program_t ngx_quic_reuseport_helper = {
81 .relocs = bpf_reloc_prog_ngx_quic_reuseport_helper,
82 .nrelocs = sizeof(bpf_reloc_prog_ngx_quic_reuseport_helper)
83 / sizeof(bpf_reloc_prog_ngx_quic_reuseport_helper[0]),
84 .ins = bpf_insn_prog_ngx_quic_reuseport_helper,
85 .nins = sizeof(bpf_insn_prog_ngx_quic_reuseport_helper)
86 / sizeof(bpf_insn_prog_ngx_quic_reuseport_helper[0]),
87 .license = "BSD",
88 .type = BPF_PROG_TYPE_SK_REUSEPORT,
89 };
90