The BPF system call API, version 14

Things happen quickly in the Berkeley Packet Filter (BPF) world. LWN last looked at this work in July, when version 2 of the patch set adding the bpf() system call had been posted. Two months later, this work is up to version 14; quite a bit has been changed and some functionality has been removed in an attempt to make the patches small enough for reviewers to cope with. At this point, though, the core system call may be reaching a point where it is getting close to ready for entry into the mainline. It seems like a good time for another look at this significant addition to the kernel's functionality, with fervent hopes that it doesn't change yet again.
BPF 的世界变化迅速。LWN 上一次关注这一工作是在七月,当时用于添加 bpf() 系统调用的补丁集还处于第 2 版。两个月后,该补丁集已经更新到了第 14 版;期间进行了大量修改,并移除了一些功能,以使补丁集足够小,从而便于审阅。目前来看,该系统调用的核心部分似乎已经趋于稳定,有望进入主线内核。现在是时候再次审视这个对内核功能具有重要意义的新特性了,并且希望它不要再发生大的变动。

BPF developer Alexei Starovoitov has certainly been energetic in his efforts to get this work in condition for merging — the posting of twelve versions in two months, many with significant changes, testifies to that. He has been responsive to requests for changes, but, as this complaint suggests, some developers have found him to be a little too pushy. That has not stopped some of his work from getting into the mainline, though, and, in the end, should not be a real impediment to the eventual merging of the rest.
BPF 开发者 Alexei Starovoitov 在推动该功能合并方面无疑展现出了极大的热情——两个月内发布了十二个版本,许多还带有重大变更,这本身就是明证。他对修改建议响应积极,但如某些人所抱怨的那样,有些开发者觉得他有点太过强势。尽管如此,他的一部分工作已经成功合入主线,而这一点终究不会成为剩余部分最终被合并的真正障碍。

As with previous versions, the BPF functionality is accessed by way of a single multiplexor system call, but that call has changed significantly:
与早期版本一样,BPF 功能仍通过一个多路复用的系统调用访问,但该调用本身已经发生了显著变化:

#include <linux/bpf.h>

int bpf(int cmd, union bpf_attr *attr, unsigned int size);

The key change, made following a suggestion from Ingo Molnar, is to create a single large union type holding all of the possible parameter types for the various operations supported by bpf(). How that union is used depends on the specific command give

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

mounter625

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值