LWN's recent article on Kubernetes in Debian discussed the challenges of packaging a massive project with hundreds of dependencies. Many of the issues that arose there, however, are not limited to such projects, as can be seen in the ongoing discussion about whether a copy of the relatively small libbpf library should be shipped with the iproute2 collection of networking tools. Fast-moving projects, it would seem, continue to feel limited by the restrictions imposed by the Linux distribution model.
LWN 最近一篇关于 Debian 中 Kubernetes 的文章讨论了打包一个拥有数百个依赖项的大型项目所面临的挑战。然而,其中出现的许多问题并不仅限于此类项目,这一点可以从当前关于是否应该在 iproute2 网络工具集中附带一个相对较小的 libbpf 库的讨论中看出。看起来,发展迅速的项目依然会感受到 Linux 发行版模式所带来的限制。
Iproute2 is a collection of network-configuration tools found on almost any Linux system; it includes utilities like arpd, ip (the command old-timers guiltily think they should be using when they type ifconfig), ss, and tc. That last command, in particular, is used to configure the traffic-control subsystem, which allows administrators to manage and prioritize the flow of network traffic through their systems. This subsystem has, for some years, had the capability to load and run BPF programs to both classify packets and make decisions on how to queue them. This mechanism gives administrators a great deal of flexibility in the management of network traffic.
Iproute2 是一组在几乎所有 Linux 系统上都能找到的网络配置工具;其中包括 arpd、ip(老用户每次敲 ifconfig 时都会觉得自己其实应该用它)、ss 和 tc。特别是最后这个命令,用于配置流量控制子系统,使管理员能够管理并优先处理系统中的网络流量。多年来,这个子系统已经具备加载和运行 BPF 程序的能力,可以对数据包进行分类并决定如何排队。这个机制为管理员在网络流量管理方面提供了极大的灵活性。
The code for handling BPF programs within iproute2 is old, though, and lacks support for many of the features that have been added to BPF in the last few years. Since that code was written, the BPF community has developed libbpf (which lives in the kernel source tree) as the preferred way to work with BPF programs and load them into the kernel. This is not a small task; libbpf must interpret the instructions encoded as special ELF sections in an executable BPF program and make the necessary calls to the sprawling bpf() system call. This work can include creating maps, "relocating" structure offsets to match the configuration of the running kernel, loading programs, and attaching those programs to the appropriate hooks within the kernel. Libbpf has grown quickly, along with the rest of the BPF ecosystem.
不过,iproute2 中处理 BPF 程序的代码已
1万+



被折叠的 条评论
为什么被折叠?



