On 7/7/23 11:31 PM, Stanislav Fomichev wrote:
On 07/07, Daniel Borkmann wrote:
Add support to dump fd-based attach types via bpftool. This includes both
the tc BPF link and attach ops programs. Dumped information contain the
attach location, function entry name, program ID and link ID when applicable.
Example with tc BPF link:
# ./bpftool net
xdp:
tc:
bond0(4) bpf/ingress cil_from_netdev prog id 784 link id 10
bond0(4) bpf/egress cil_to_netdev prog id 804 link id 11
flow_dissector:
netfilter:
Example with tc BPF attach ops:
# ./bpftool net
xdp:
tc:
bond0(4) bpf/ingress cil_from_netdev prog id 654
bond0(4) bpf/egress cil_to_netdev prog id 672
flow_dissector:
netfilter:
Signed-off-by: Daniel Borkmann <daniel@xxxxxxxxxxxxx>
---
tools/bpf/bpftool/net.c | 86 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 82 insertions(+), 4 deletions(-)
diff --git a/tools/bpf/bpftool/net.c b/tools/bpf/bpftool/net.c
index 26a49965bf71..1ef1e880de61 100644
--- a/tools/bpf/bpftool/net.c
+++ b/tools/bpf/bpftool/net.c
@@ -76,6 +76,11 @@ static const char * const attach_type_strings[] = {
[NET_ATTACH_TYPE_XDP_OFFLOAD] = "xdpoffload",
};
+static const char * const attach_loc_strings[] = {
+ [BPF_TCX_INGRESS] = "bpf/ingress",
+ [BPF_TCX_EGRESS] = "bpf/egress",
Any reason we are not doing tcx/ingress & egress? To match the section
names.
Ok, will change for v4 to tcx/{ingress,egress}.