随笔分类 -  ebpf

ebpf tutorial
edgecore
摘要:安装docker systemctl enable docker && systemctl start docker cat > /etc/docker/daemon.json << EOF { "registry-mirrors": ["https://b9pmyelo.mirror.aliyun 阅读全文

posted @ 2021-04-08 15:25 tycoon3 阅读(1141) 评论(0) 推荐(0) 编辑

[译] 深入理解 Cilium 的 eBPF 收发包路径(datapath)
摘要:译者序 本文翻译自 2019 年 DigitalOcean 的工程师 Nate Sweet 在 KubeCon 的一篇分享: Understanding (and Troubleshooting) the eBPF Datapath in Cilium 。 由于译者水平有限,本文不免存在遗漏或错误之 阅读全文

posted @ 2021-03-12 14:27 tycoon3 阅读(1137) 评论(0) 推荐(0) 编辑

你的第一个TC BPF 程序
摘要:https://davidlovezoe.club/wordpress/archives/952 阅读全文

posted @ 2021-03-07 17:41 tycoon3 阅读(225) 评论(0) 推荐(0) 编辑

tcpdump实现和run_filter
摘要:一、tcpdump 对于本机中进程的系统行为调用跟踪,strace是一个很好的工具,而在网络问题的调试中,tcpdump应该说是一个必不可少的工具,和大部分linux下优秀工具一样,它的特点就是简单而强大。默认情况下,tcpdump不会抓取本机内部通讯的报文。根据网络协议栈的规定,对于报文,即使是目 阅读全文

posted @ 2020-01-21 19:28 tycoon3 阅读(706) 评论(0) 推荐(0) 编辑

ebpf sock sk_filter实现
摘要:sk_attach_filter()和sk_run_filter():前者将 filter 伪代码由用户空间复制进内核空间;后者则负责在报文到来时执行伪码解析 BPF JIT 的接口还是简单清晰的:各平台的 JIT 编译函数都实现于bpf_jit_compile()之中(3.16 之后,开始逐步改为 阅读全文

posted @ 2020-01-21 19:22 tycoon3 阅读(836) 评论(0) 推荐(0) 编辑

ebpf bpf_load_program
摘要:size_t insns_cnt = sizeof(prog) / sizeof(struct bpf_insn); prog_fd = bpf_load_program(BPF_PROG_TYPE_SOCKET_FILTER, prog, insns_cnt, "GPL", 0, bpf_log_buf, BPF_LOG_BUF_SIZE); int b... 阅读全文

posted @ 2020-01-21 19:03 tycoon3 阅读(778) 评论(0) 推荐(0) 编辑

eppf map机制
摘要:有如下两种方式加载map 1、BPF_LD_MAP_FD加载map /* pseudo BPF_LD_IMM64 insn used to refer to process-local map_fd */#define BPF_LD_MAP_FD(DST, MAP_FD) \BPF_LD_IMM64 阅读全文

posted @ 2020-01-21 16:55 tycoon3 阅读(840) 评论(0) 推荐(0) 编辑

ebpf anonymous inode
摘要:gcc temp.c -o annon 打开另外一个终端 输入: 打开另外一个终端 阅读全文

posted @ 2020-01-20 17:08 tycoon3 阅读(179) 评论(0) 推荐(0) 编辑

ebpf的sockmap的实现二
摘要:rcv_msg = smap_read_sock_strparser smap_do_verdict smap_verdict_func (*prog->bpf_func)(skb, prog->insnsi) static int smap_init_sock(struct smap_psock 阅读全文

posted @ 2020-01-17 16:27 tycoon3 阅读(488) 评论(0) 推荐(0) 编辑

ebpf的sockmap的实现
摘要:ebpf的sockmap调用strp_init来设置回调函数 static int smap_init_sock(struct smap_psock *psock, struct sock *sk){ static const struct strp_callbacks cb = { .rcv_ms 阅读全文

posted @ 2020-01-17 16:05 tycoon3 阅读(635) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示