Commit Graph

7 Commits (0a11aae1517c42622e94f5c0445127f050cf9899)

Author SHA1 Message Date
Tuetuopay 0a11aae151 maps/xdp: make maps work on kernels not supporting ProgIds
On startup, the kernel is probed for support of chained program ids for
CpuMap, DevMap and DevMapHash, and will patch maps at load time to have
the proper size. Then, at runtime, the support is checked and will error
out if a program id is passed when the kernel does not support it.
2 years ago
Tuetuopay b80cb82370 maps/xdp: use ProgramFd instead of impl AsRawFd
Not having a generic here allows to pass `None` without specifying the
actual type you don't care about.
2 years ago
Tuetuopay 5af04c4582 maps/xdp: drop the possibly-unsafe {Cpu,Dev}MapValue conversions
Making a `From` impl that hides an unsafe with some safety guarantee is
actually unsafe, because while we know how we use this impl, we don't
know how other will. And since it's on two public types, anything can
be done.
2 years ago
Tuetuopay 1450b9be63 maps/xdp: improve XDP maps documentation 2 years ago
Tuetuopay 9a706f356c xdp: add support for chained xdp programs in {cpu,dev}map
set/insert functions can now take an optional bpf program fd to run once
the packet has been redirected from the main probe
2 years ago
Tuetuopay 6350709115 aya: Update XDP maps implementations
Map impls changed since this was first written.

Fixes: 2b726c8 ("aya: Implement XDP Map Types")
2 years ago
Dave Tucker 125257780b aya: Implement XDP Map Types
This commit adds implementations for:
- xskmap
- devmap
- devmap_hash
- cpumap

Which can all be used to redirect XDP packets to various different
locations

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago