Lines Matching full:tuple

7 static int bpf_mprog_link(struct bpf_tuple *tuple,  in bpf_mprog_link()  argument
25 tuple->link = link; in bpf_mprog_link()
26 tuple->prog = link->prog; in bpf_mprog_link()
30 static int bpf_mprog_prog(struct bpf_tuple *tuple, in bpf_mprog_prog() argument
48 tuple->link = NULL; in bpf_mprog_prog()
49 tuple->prog = prog; in bpf_mprog_prog()
53 static int bpf_mprog_tuple_relative(struct bpf_tuple *tuple, in bpf_mprog_tuple_relative() argument
60 memset(tuple, 0, sizeof(*tuple)); in bpf_mprog_tuple_relative()
62 return bpf_mprog_link(tuple, id_or_fd, flags, type); in bpf_mprog_tuple_relative()
64 * tuple link/prog is just NULLed. This is the case when before/ in bpf_mprog_tuple_relative()
69 return bpf_mprog_prog(tuple, id_or_fd, flags, type); in bpf_mprog_tuple_relative()
72 static void bpf_mprog_tuple_put(struct bpf_tuple *tuple) in bpf_mprog_tuple_put() argument
74 if (tuple->link) in bpf_mprog_tuple_put()
75 bpf_link_put(tuple->link); in bpf_mprog_tuple_put()
76 else if (tuple->prog) in bpf_mprog_tuple_put()
77 bpf_prog_put(tuple->prog); in bpf_mprog_tuple_put()
179 struct bpf_tuple *tuple) in bpf_mprog_pos_exact() argument
187 if (tuple->prog == READ_ONCE(fp->prog)) in bpf_mprog_pos_exact()
188 return tuple->link == cp->link ? i : -EBUSY; in bpf_mprog_pos_exact()
194 struct bpf_tuple *tuple) in bpf_mprog_pos_before() argument
202 if (tuple->prog == READ_ONCE(fp->prog) && in bpf_mprog_pos_before()
203 (!tuple->link || tuple->link == cp->link)) in bpf_mprog_pos_before()
206 return tuple->prog ? -ENOENT : -1; in bpf_mprog_pos_before()
210 struct bpf_tuple *tuple) in bpf_mprog_pos_after() argument
218 if (tuple->prog == READ_ONCE(fp->prog) && in bpf_mprog_pos_after()
219 (!tuple->link || tuple->link == cp->link)) in bpf_mprog_pos_after()
222 return tuple->prog ? -ENOENT : bpf_mprog_total(entry); in bpf_mprog_pos_after()
298 struct bpf_tuple *tuple, int idx) in bpf_mprog_fetch() argument
313 /* The deletion request can either be without filled tuple in which in bpf_mprog_fetch()
314 * case it gets populated here based on idx, or with filled tuple in bpf_mprog_fetch()
319 if (link && !tuple->link) in bpf_mprog_fetch()
321 WARN_ON_ONCE(tuple->prog && tuple->prog != prog); in bpf_mprog_fetch()
322 WARN_ON_ONCE(tuple->link && tuple->link != link); in bpf_mprog_fetch()
323 tuple->prog = prog; in bpf_mprog_fetch()
324 tuple->link = link; in bpf_mprog_fetch()