• Home
  • Raw
  • Download

Lines Matching refs:cfg

184 static int tcf_bpf_init_from_ops(struct nlattr **tb, struct tcf_bpf_cfg *cfg)  in tcf_bpf_init_from_ops()  argument
213 cfg->bpf_ops = bpf_ops; in tcf_bpf_init_from_ops()
214 cfg->bpf_num_ops = bpf_num_ops; in tcf_bpf_init_from_ops()
215 cfg->filter = fp; in tcf_bpf_init_from_ops()
216 cfg->is_ebpf = false; in tcf_bpf_init_from_ops()
221 static int tcf_bpf_init_from_efd(struct nlattr **tb, struct tcf_bpf_cfg *cfg) in tcf_bpf_init_from_efd() argument
241 cfg->bpf_name = name; in tcf_bpf_init_from_efd()
242 cfg->filter = fp; in tcf_bpf_init_from_efd()
243 cfg->is_ebpf = true; in tcf_bpf_init_from_efd()
248 static void tcf_bpf_cfg_cleanup(const struct tcf_bpf_cfg *cfg) in tcf_bpf_cfg_cleanup() argument
250 struct bpf_prog *filter = cfg->filter; in tcf_bpf_cfg_cleanup()
253 if (cfg->is_ebpf) in tcf_bpf_cfg_cleanup()
259 kfree(cfg->bpf_ops); in tcf_bpf_cfg_cleanup()
260 kfree(cfg->bpf_name); in tcf_bpf_cfg_cleanup()
264 struct tcf_bpf_cfg *cfg) in tcf_bpf_prog_fill_cfg() argument
266 cfg->is_ebpf = tcf_bpf_is_ebpf(prog); in tcf_bpf_prog_fill_cfg()
270 cfg->filter = rcu_dereference_protected(prog->filter, 1); in tcf_bpf_prog_fill_cfg()
272 cfg->bpf_ops = prog->bpf_ops; in tcf_bpf_prog_fill_cfg()
273 cfg->bpf_name = prog->bpf_name; in tcf_bpf_prog_fill_cfg()
285 struct tcf_bpf_cfg cfg, old; in tcf_bpf_init() local
340 memset(&cfg, 0, sizeof(cfg)); in tcf_bpf_init()
342 ret = is_bpf ? tcf_bpf_init_from_ops(tb, &cfg) : in tcf_bpf_init()
343 tcf_bpf_init_from_efd(tb, &cfg); in tcf_bpf_init()
353 prog->bpf_ops = cfg.bpf_ops; in tcf_bpf_init()
354 prog->bpf_name = cfg.bpf_name; in tcf_bpf_init()
356 if (cfg.bpf_num_ops) in tcf_bpf_init()
357 prog->bpf_num_ops = cfg.bpf_num_ops; in tcf_bpf_init()
360 rcu_assign_pointer(prog->filter, cfg.filter); in tcf_bpf_init()