Sorry for the late reply.
On Sat, Nov 21, 2020 at 11:34 AM Martin KaFai Lau wrote:
>
> On Thu, Nov 19, 2020 at 03:06:11PM +, Daniel T. Lee wrote:
> [ ... ]
>
> > static int run_bpf_prog(char *prog, int cg_id)
> > [ ... ]
> > if (!outFlag)
> > - type = BPF_CGROUP_INET_INGRES
On Fri, Nov 20, 2020 at 06:34:05PM -0800, Martin KaFai Lau wrote:
> On Thu, Nov 19, 2020 at 03:06:11PM +, Daniel T. Lee wrote:
> [ ... ]
>
> > static int run_bpf_prog(char *prog, int cg_id)
> > {
> > - int map_fd;
> > - int rc = 0;
> > + struct hbm_queue_stats qstats = {0};
> > + cha
On Thu, Nov 19, 2020 at 03:06:11PM +, Daniel T. Lee wrote:
[ ... ]
> static int run_bpf_prog(char *prog, int cg_id)
> {
> - int map_fd;
> - int rc = 0;
> + struct hbm_queue_stats qstats = {0};
> + char cg_dir[100], cg_pin_path[100];
> + struct bpf_link *link = NULL;
>
This commit refactors the existing cgroup programs with libbpf
bpf loader. Since bpf_program__attach doesn't support cgroup program
attachment, this explicitly attaches cgroup bpf program with
bpf_program__attach_cgroup(bpf_prog, cg1).
Also, to change attach_type of bpf program, this uses libbpf's