comparison src/event/quic/ngx_event_quic_transport.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 046c951e393a
children 3443ee341cc1
comparison
equal deleted inserted replaced
8675:d3747ba486e7 8676:7df607cb2d11
40 (p)[2] = (u_char) ((s) >> 8), \ 40 (p)[2] = (u_char) ((s) >> 8), \
41 (p)[3] = (u_char) (s), \ 41 (p)[3] = (u_char) (s), \
42 (p) + sizeof(uint32_t)) 42 (p) + sizeof(uint32_t))
43 43
44 #endif 44 #endif
45
46 #define ngx_quic_write_uint64(p, s) \
47 ((p)[0] = (u_char) ((s) >> 56), \
48 (p)[1] = (u_char) ((s) >> 48), \
49 (p)[2] = (u_char) ((s) >> 40), \
50 (p)[3] = (u_char) ((s) >> 32), \
51 (p)[4] = (u_char) ((s) >> 24), \
52 (p)[5] = (u_char) ((s) >> 16), \
53 (p)[6] = (u_char) ((s) >> 8), \
54 (p)[7] = (u_char) (s), \
55 (p) + sizeof(uint64_t))
45 56
46 #define ngx_quic_write_uint24(p, s) \ 57 #define ngx_quic_write_uint24(p, s) \
47 ((p)[0] = (u_char) ((s) >> 16), \ 58 ((p)[0] = (u_char) ((s) >> 16), \
48 (p)[1] = (u_char) ((s) >> 8), \ 59 (p)[1] = (u_char) ((s) >> 8), \
49 (p)[2] = (u_char) (s), \ 60 (p)[2] = (u_char) (s), \
1979 ngx_quic_build_int(&p, cl->reason.len); 1990 ngx_quic_build_int(&p, cl->reason.len);
1980 p = ngx_cpymem(p, cl->reason.data, cl->reason.len); 1991 p = ngx_cpymem(p, cl->reason.data, cl->reason.len);
1981 1992
1982 return p - start; 1993 return p - start;
1983 } 1994 }
1995
1996
1997 void
1998 ngx_quic_dcid_encode_key(u_char *dcid, uint64_t key)
1999 {
2000 (void) ngx_quic_write_uint64(dcid, key);
2001 }