- labeling: lwt xmit
- switching: like backbone
- unlabeling: lwt xmit
lwt xmit bpf cannot have arguments
- lpm match for a label value
- if not match, unset flowlabel
- if match, change flowlabel
- continue routing
Just set flowlabel to 0
xdp bpf
unlabel + routing: switching fallback to this when seeing 0-label or unknown label (sets label to 0 before routing)
- linux-kernel >= 4.18 (for
fib_lookup
): See BPF Features by Linux Kernel Version - bcc: for libbpf
cd flowlabel-switching/
make
See test/.
The default bpf filesystem, used for pinning bpf programs and maps, is mounted
on /sys/fs/bpf/
by iproute2
programs. However, ip netns exec
happens to
unmount /sys
before exec
, so the called program never sees that bpf
filesystem.
And it seems that bpf filesystem cannot be mounted by any command invoked with
ip netns exec
. I don't know the reason behind.
So before calling ip netns exec
, mount a bpf filesystem somewhere other than
/sys
, e.g. /run/flsw/bpffs/
, and ip netns exec
will see that filesystem.
And by setting TC_BPF_MNT
environment variable to subdirectories of the
previously mounted bpf filesystem. (iproute2 tries to mount bpf filesystem
whenever TC_BPF_MNT
is not a bpf mount point, whether it's a subdirectory of a
bpf fs or not, probably with good reason) different mount points of bpf
filesystems, we can have different bpf objects with the same name for different
netns.