Minimum kernel version
- 主要语言
- Rust
- 星标
- 37
- 派生
- 5
- PR 合并指标
- 30 天内没有已合并 PR
描述
Hi,
No minimum kernel version for `xdpilone` is described. This could be difficult in general depending on exactly what features of the crate are used and how they are used. However, the following information may be useful for users on older kernels.
I attempted to run the `flood-mt` example (unmodified) and found that it was failing with the following sequence of system calls:
```c
[...]
socket(AF_XDP, SOCK_RAW, 0) = 3
setsockopt(3, SOL_XDP, XDP_UMEM_REG, "\0\20\rc\2V\0\0\0\0\20\0\0\0\0\0\0\20\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 32) = 0
socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0) = 4
ioctl(4, SIOCGIFINDEX, {ifr_name="enp0s2", ifr_ifindex=3}) = 0
close(4) = 0
getsockopt(3, SOL_SOCKET, SO_NETNS_COOKIE, "\1\0\0\0\0\0\0\0", [8]) = 0
setsockopt(3, SOL_XDP, XDP_UMEM_COMPLETION_RING, [2048], 4) = 0
setsockopt(3, SOL_XDP, XDP_UMEM_FILL_RING, [2048], 4) = 0
getsockopt(3, SOL_XDP, XDP_MMAP_OFFSETS, "\0\0\0\0\0\0\0\0\200\0\0\0\0\0\0\0@\1\0\0\0\0\0\0\304\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0\0\0\0\0\0\0@\1\0\0\0\0\0\0\304\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0\0\0\0\0\0\0@\1\0\0\0\0\0\0\304\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0\0\0\0\0\0\0@\1\0\0\0\0\0\0\304\0\0\0\0\0\0\0", [128]) = 0
mmap(NULL, 16704, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_POPULATE, 3, 0x100000000) = 0x7f8162609000
mmap(NULL, 16704, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_POPULATE, 3, 0x180000000) = 0x7f8162604000
setsockopt(3, SOL_XDP, XDP_TX_RING, [4096], 4) = 0
getsockopt(3, SOL_XDP, XDP_MMAP_OFFSETS, "\0\0\0\0\0\0\0\0\200\0\0\0\0\0\0\0@\1\0\0\0\0\0\0\304\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0\0\0\0\0\0\0@\1\0\0\0\0\0\0\304\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0\0\0\0\0\0\0@\1\0\0\0\0\0\0\304\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\200\0\0\0\0\0\0\0@\1\0\0\0\0\0\0\304\0\0\0\0\0\0\0", [128]) = 0
write(2, "Binding socket ", 15) = 15
write(2, "0", 1) = 1
write(2, " ", 1) = 1
write(2, "3", 1) = 1
write(2, "\n", 1) = 1
bind(3, {sa_family=AF_XDP, sxdp_flags=0, sxdp_ifindex=if_nametoindex("enp0s2"), sxdp_queue_id=0}, 16) = 0
write(2, "Mapping socket ", 15) = 15
write(2, "0", 1) = 1
write(2, "\n", 1) = 1
mmap(NULL, 65856, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_POPULATE, 3, 0x80000000) = -1 EBUSY (Device or resource busy)
[...]
```
The socket/queue setup demonstrated in the `flood-mt` example where the TX ring is mapped after the `bind()` of the XSK depends on https://github.com/torvalds/linux/commit/5f5a7d8d8bd461f515543040ad7d107cc405d30c ("xsk: allow remap of fill and/or completion rings") which was apparently shipped in the 6.4 kernel, otherwise the `mmap()` call will fail with EBUSY.
贡献指南
这个仓库没有索引到贡献指南
调研方向
该 issue 指出,由于一个特定的 Linux 提交,flood-mt 示例在内核版本低于 6.4 时失败。首先检查 flood-mt 示例代码以理解 socket/队列 的设置。检查 README 或其他文档文件,确定应在何处添加最低内核版本信息。通过审查所链接的 Linux 提交来验证内核版本依赖性,并相应地更新文档。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- linux
- 领域
- networking, operating-systems
- Issue 类型
- 文档
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 55/100