TSG-14829 io_uring支持触发事件,适配mrzcpd的epoll_wait功能

This commit is contained in:
luwenpeng
2023-04-21 17:57:23 +08:00
parent 6e02f6b8ac
commit 97a4386bc4
20 changed files with 2255 additions and 1 deletions

53
bpf/bpf_config_define.h Normal file
View File

@@ -0,0 +1,53 @@
#ifndef _BPF_CONFIG_H_
#define _BPF_CONFIG_H_
#ifdef __cplusplus
extern "C"
{
#endif
#define BPF_CONFIG_KEY_DEBUG_LOG "bpf_debug_log"
#define BPF_CONFIG_KEY_HASH_MODE "bpf_hash_mode"
#define BPF_CONFIG_KEY_QUEUE_NUM "bpf_queue_num"
#define __uint(name, val) int(*name)[val]
#define __type(name, val) val *name
#define SEC(NAME) __attribute__((section(NAME), used))
enum bpf_hash_mode
{
BPF_HASH_MODE_TUPLE2 = 0x2,
BPF_HASH_MODE_TUPLE4 = 0x4,
};
struct string32
{
char str[32];
};
struct kv_pair
{
struct string32 key;
__u32 val;
};
struct bpf_config
{
struct kv_pair debug_log;
struct kv_pair hash_mode;
struct kv_pair queue_num;
};
struct
{
__uint(type, BPF_MAP_TYPE_HASH);
__type(key, struct string32);
__type(value, __u32);
__uint(max_entries, 16);
} bpf_config_map SEC(".maps");
#ifdef __cplusplus
}
#endif
#endif