You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experimenting with AF_XDP and would love to use rustix instead of libc. For the BPF side of things, I use aya, so only the non-BPF related syscalls remain. Some syscalls are already supported like mmap and socket but others would need to be implemented or expanded/modified. I created a list of missing syscalls, constants and structs. Most of the syscalls, etc were added in 4.18 with some additions and modifications in later kernel versions.
xdp_options, used by getsockopt(...,XDP_OPTIONS,...)
If this is something you are interested in adding, I'd be happy to work on PR(s) to implement it but I would require some guidance:
Some syscall parameters/returns come in two versions, how should this be implemented?
Should kernel versions required for syscalls be listed?
I'm unsure how testing can be done for things like setsockopt as I don't think there is a syscall to check their result.
For {get,set}sockopt and bind I can orient myself at already existing syscalls in rustix but for if_indextoname and if_nametoindex, I'm unsure how to implement them.
The text was updated successfully, but these errors were encountered:
Hi,
I'm experimenting with AF_XDP and would love to use
rustix
instead oflibc
. For the BPF side of things, I useaya
, so only the non-BPF related syscalls remain. Some syscalls are already supported likemmap
andsocket
but others would need to be implemented or expanded/modified. I created a list of missing syscalls, constants and structs. Most of the syscalls, etc were added in 4.18 with some additions and modifications in later kernel versions.Syscalls:
setsockopt(fd, SOL_XDP, XDP_UMEM_REG, umem_reg, sizeof(umem_reg))
,umem_reg
see structssetsockopt(fs, SOL_XDP, XDP_UMEM_FILL_RING, fill_size, sizeof(fill_size))
,fill_size
=u32
(https://github.com/torvalds/linux/blob/v6.6/net/xdp/xsk.c#L944)setsockopt(fs, SOL_XDP, XDP_UMEM_COMPLETION_RING, comp_size, sizeof(comp_size))
,comp_size
=u32
setsockopt(fs, SOL_XDP, XDP_RX_RING, rx_size, sizeof(rx_size))
,rx_size
=u32
setsockopt(fs, SOL_XDP, XDP_TX_RING, tx_size, sizeof(tx_size))
tx_size
=u32
getsockopt(fd, SOL_XDP, XDP_MMAP_OFFSETS, *xdp_mmap_offsets, &optlen)
,xdp_mmap_offsets
see structsgetsockopt(fd, SOL_XDP, XDP_STATISTICS, *xdp_statistics, &optlen)
,xdp_statistics
see structsgetsockopt(fd, SOL_XDP, XDP_OPTIONS, *xdp_options, &optlen)
,xdp_options
see structsbind(fd, *sockaddr_xdp, sizeof(sockaddr_xdp))
,sockaddr_xdp
see structs,bind
with various addresses is already supported but not withsockaddr_xdp
if_indextoname
if_nametoindex
(optional)Constants:
AF_XDP
PF_XDP
same asAF_XDP
SOL_XDP
Structs:
bind(fd, *sockaddr_xdp, sizeof(sockaddr_xdp))
xdp_mmap_offsets
getsockopt(...,XDP_MMAP_OFFSETS,...)
setsockopt(...,XDP_UMEM_REG,...)
mmap
assizeof(xdp_desc)
forXDP_PGOFF_{RX,TX}_RING
getsockopt(...,XDP_STATISTICS,...)
getsockopt(...,XDP_OPTIONS,...)
If this is something you are interested in adding, I'd be happy to work on PR(s) to implement it but I would require some guidance:
setsockopt
as I don't think there is a syscall to check their result.{get,set}sockopt
andbind
I can orient myself at already existing syscalls inrustix
but forif_indextoname
andif_nametoindex
, I'm unsure how to implement them.The text was updated successfully, but these errors were encountered: