perf: 性能优化

* io_uring使用buffer pool避免内存分配与释放
    * packet io thread与worker thread无锁访问cmsg
    * 为解密流量的fd设置默认的TTL
This commit is contained in:
luwenpeng
2023-07-14 19:38:18 +08:00
parent 2b00650d3e
commit c3b887f1c5
19 changed files with 935 additions and 939 deletions

View File

@@ -229,7 +229,7 @@ static inline int parse_packet(struct packet *packet, struct bpf_config *config)
* +----+----+----+----------------------------------+
* If "More fragments" or the offset is nonzero, then this is an IP fragment (RFC791).
*/
packet->is_fragmented = !(bpf_ntohs(ip.frag_off) & 0x4000);
packet->is_fragmented = !!(bpf_ntohs(ip.frag_off) & (0x2000 | 0x1fff));
l4_protocol = ip.protocol;
l4_offset = ip.ihl * 4;