admin管理员组文章数量:1390896
Recently, I've been trying to work with BPF_ARENA. My objective is to use it on XDP programs. However, the following error appears when I try to use bpf_arena_alloc_pages:
program must be sleepable to call sleepable kfunc bpf_arena_alloc_pages
From what I understand about XDP, at least currently, XDP programs aren't sleepable. If so, I'm confused as to why the eBPF documentation lists XDP programs as a type that can use this kfunc.
There is a flag BPF_F_SLEEPABLE that can be used to load the eBPF program as sleepable, but does that also apply to XDP? This older post has a similar question, but it's probably outdated and I couldn't find more information about sleepable programs and, more specifically, how this kfunc could be used in XDP.
Recently, I've been trying to work with BPF_ARENA. My objective is to use it on XDP programs. However, the following error appears when I try to use bpf_arena_alloc_pages:
program must be sleepable to call sleepable kfunc bpf_arena_alloc_pages
From what I understand about XDP, at least currently, XDP programs aren't sleepable. If so, I'm confused as to why the eBPF documentation lists XDP programs as a type that can use this kfunc.
There is a flag BPF_F_SLEEPABLE that can be used to load the eBPF program as sleepable, but does that also apply to XDP? This older post has a similar question, but it's probably outdated and I couldn't find more information about sleepable programs and, more specifically, how this kfunc could be used in XDP.
Share Improve this question asked Mar 17 at 1:23 Pedro MPedro M 518 bronze badges1 Answer
Reset to default 1If so, I'm confused as to why the eBPF documentation lists XDP programs as a type that can use this kfunc.
The reason why its there is because the list is generated based on the program types it is registered for. BPF_PROG_TYPE_UNSPEC
meaning all program types that support kfuncs.
The sleepable limitation originates from the KF_SLEEPABLE
kfuncs flag it is registered with. And as you said, XDP programs cannot be sleepable.
Unfortunately, the eBPF docs are not sophisticated enough (yet) to remove sleepable kfuncs from the list of supported kfuncs of non-sleepable program types.
本文标签: bpfSleepable eBPFXDP programsStack Overflow
版权声明:本文标题:bpf - Sleepable eBPFXDP programs - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744582253a2613990.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论