bpf: Call __bpf_sk_lookup()/__bpf_skc_lookup() directly via TC hookpoint
authorGilad Sever <gilad9366@gmail.com>
Wed, 21 Jun 2023 10:42:09 +0000 (13:42 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jul 2023 14:21:11 +0000 (16:21 +0200)
commitc7415c521abdc1d174d8b03dca62ae847ba1c49c
tree13f0ce6168bfb77d11c479481554657d854628fd
parent5e9b38de6633f9fa1893490454acda9f21896a0d
bpf: Call __bpf_sk_lookup()/__bpf_skc_lookup() directly via TC hookpoint

[ Upstream commit 97fbfeb86917bdbe9c41d5143e335a929147f405 ]

skb->dev always exists in the tc flow. There is no need to use
bpf_skc_lookup(), bpf_sk_lookup() from this code path.

This change facilitates fixing the tc flow to be VRF aware.

Signed-off-by: Gilad Sever <gilad9366@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Reviewed-by: Eyal Birger <eyal.birger@gmail.com>
Acked-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/bpf/20230621104211.301902-3-gilad9366@gmail.com
Stable-dep-of: 9a5cb79762e0 ("bpf: Fix bpf socket lookup from tc/xdp to respect socket VRF bindings")
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/filter.c