bpf,endpoint: introduce fib-table-id annotation#44319
Conversation
c86db15 to
0262207
Compare
|
/test |
|
Nice, I like it! Should we gate option.Config.EnableFibTableIDAnnotation and only allow it to be enabled when we have either BPF host routing enabled or netkit mode? |
|
@borkmann Good idea. Do we need to be explicit about the netkit mode, is it enough to just check BFP host routing is enabled? My thinking is, even in a case where netkit is enabled but BPF host routing is disabled (legacy), the bpf_lxc program would not go into the fib redirect path, where we now use the table id. Is my understanding off there? |
We can check for just BPF host routing. I don't think we can enable netkit with legacy, that should not be possible. And netkit itself demands BPF host routing and otherwise bails out. |
0262207 to
6f9fe36
Compare
|
/test |
|
@jrife I don't think there's much actual usage to that probe you linked. |
|
It doesn't look dead to me. It's still set based on the result of the probe here and affects whether or not the |
|
@jrife Thanks! I miss read that and didn't realize it gets plumbed into the datapath. I will add a probe in a new commit. |
Add a new annotation, 'network.cilium.io/fib-table-id', providing a fib table ID accessible via the CONFIG(fib_table_id) macro within bpf_lxc. A future commit will utilize this configuration value to perform eBPF redirects that respect a particular kernel fib table, allowing dynamic route selection for pod egress traffic. Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
When `ENABLE_HOST_ROUTING` is enabled the eBPF data path can now evaluate the `fib_table_id` config parameter. If this config parameter is set to a value other then 0 this value is used to scope the final fib lookup, routing the pod egress packet to its next hop. This enables dynamic routing on a per-pod basis. Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
6f9fe36 to
30827a7
Compare
|
@jrife added the probe. Please re-review. |
Introduce a new kernel probe to detect if the BPF_FIB_LOOKUP_TBID flag is supported for use with bpf_fib_lookup. If the flag is not available, and Cilium is configured to utilize it via the EnableFibTableIDAnnotation option, Cilium will fail to start with an error. Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
30827a7 to
309f810
Compare
|
/test |
Add a new pod annotation, 'network.cilium.io/fib-table-id', that enables dynamic pod routing.
When this pod annotation is set the corresponding table ID will be provided to the Cilium datapath.
The table ID will then be used to determine a pod's next hop via a kernel fib lookup against the provided table.
The mechanisms to manipulate the provided FIB table is not introduced in this pull request.