aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/mem-phys-addr.py
diff options
context:
space:
mode:
authorGilad Sever <[email protected]>2023-06-21 13:42:10 +0300
committerDaniel Borkmann <[email protected]>2023-06-21 23:48:41 +0200
commit9a5cb79762e0eda17ca15c2a6eaca4622383c21c (patch)
treea9137c40bfc2e27d47359eadf6d4e0e9891ae9af /tools/perf/scripts/python/mem-phys-addr.py
parent97fbfeb86917bdbe9c41d5143e335a929147f405 (diff)
bpf: Fix bpf socket lookup from tc/xdp to respect socket VRF bindings
When calling bpf_sk_lookup_tcp(), bpf_sk_lookup_udp() or bpf_skc_lookup_tcp() from tc/xdp ingress, VRF socket bindings aren't respoected, i.e. unbound sockets are returned, and bound sockets aren't found. VRF binding is determined by the sdif argument to sk_lookup(), however when called from tc the IP SKB control block isn't initialized and thus inet{,6}_sdif() always returns 0. Fix by calculating sdif for the tc/xdp flows by observing the device's l3 enslaved state. The cg/sk_skb hooking points which are expected to support inet{,6}_sdif() pass sdif=-1 which makes __bpf_skc_lookup() use the existing logic. Fixes: 6acc9b432e67 ("bpf: Add helper to retrieve socket in BPF") Signed-off-by: Gilad Sever <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Reviewed-by: Shmulik Ladkani <[email protected]> Reviewed-by: Eyal Birger <[email protected]> Acked-by: Stanislav Fomichev <[email protected]> Cc: David Ahern <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/mem-phys-addr.py')
0 files changed, 0 insertions, 0 deletions