perf: 性能优化
* io_uring使用buffer pool避免内存分配与释放
* packet io thread与worker thread无锁访问cmsg
* 为解密流量的fd设置默认的TTL
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user