From ccd4f921bf191e21cf087e126a97fbcee42232c0 Mon Sep 17 00:00:00 2001 From: gamemann Date: Fri, 12 Nov 2021 19:54:55 +0000 Subject: [PATCH] Add comments. --- src/xdpfw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/xdpfw.c b/src/xdpfw.c index 0e8fc1b..9cdb59c 100644 --- a/src/xdpfw.c +++ b/src/xdpfw.c @@ -160,6 +160,7 @@ int loadbpfobj(const char *filename, int ifidx) struct bpf_object *obj = NULL; int err; + // Load the BPF object file itself. err = bpf_prog_load_xattr(&attrs, &obj, &fd); if (err) @@ -171,6 +172,7 @@ int loadbpfobj(const char *filename, int ifidx) struct bpf_program *prog; + // Load the BPF program itself by section name and try to retrieve FD. prog = bpf_object__find_program_by_title(obj, "xdp_prog"); fd = bpf_program__fd(prog); @@ -181,6 +183,7 @@ int loadbpfobj(const char *filename, int ifidx) return fd; } + // Retrieve BPF maps. filtersmap = findmapfd(obj, "filters_map"); statsmap = findmapfd(obj, "stats_map");