在 2021/6/9 上午1:02, Tanner Love 写道:
retry:
- if (!skb_flow_dissect_flow_keys_basic(NULL, skb, &keys,
+ /* only if flow dissection not already done */
+ if (!static_branch_unlikely(&sysctl_flow_dissect_vnet_hdr_key) &&
+ !skb_flow_dissect_flow_keys_basic(NULL, skb, &keys,
NULL, 0, 0, 0,
0)) {
So I still wonder the benefit we could gain from reusing the bpf flow
dissector here. Consider the only context we need is the flow keys, we
had two choices
a1) embed the vnet header checking inside bpf flow dissector
a2) introduce a dedicated eBPF type for doing that
And we have two ways to access the vnet header
b1) via pesudo __sk_buff
b2) introduce bpf helpers
I second for a2 and b2. The main motivation is to hide the vnet header
details from the bpf subsystem.
Thanks