Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 286556c0 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'bpf-prog-map-ID'



Martin KaFai Lau says:

====================
Introduce bpf ID

This patch series:
1) Introduce ID for both bpf_prog and bpf_map.
2) Add bpf commands to iterate the prog IDs and map
   IDs of the system.
3) Add bpf commands to get a prog/map fd from an ID
4) Add bpf command to get prog/map info from a fd.
   The prog/map info is a jump start in this patchset
   and it is not meant to be a complete list.  They can
   be extended in the future patches.

v3:
- I suspect v2 may not have applied cleanly.
  In particular, patch 1 has conflict with a recent
  change in struct bpf_prog_aux introduced at a similar time frame:
  8726679a ("bpf: teach verifier to track stack depth")
  v3 should have fixed it.

v2:
Compiler warning fixes:
- Remove lockdep_is_held() usage.  Add comment
  to explain the lock situation instead.
- Add static for idr related variables
- Add __user to the uattr param in bpf_prog_get_info_by_fd()
  and bpf_map_get_info_by_fd().
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 8ea4fae9 95b9afd3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -900,6 +900,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
	bpf_jit_binary_lock_ro(header);
	prog->bpf_func = (void *)ctx.image;
	prog->jited = 1;
	prog->jited_len = image_size;

out_off:
	kfree(ctx.offset);
+1 −0
Original line number Diff line number Diff line
@@ -1052,6 +1052,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)

	fp->bpf_func = (void *)image;
	fp->jited = 1;
	fp->jited_len = alloclen;

	bpf_flush_icache(bpf_hdr, (u8 *)bpf_hdr + (bpf_hdr->pages * PAGE_SIZE));

+1 −0
Original line number Diff line number Diff line
@@ -1329,6 +1329,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
	bpf_jit_binary_lock_ro(header);
	fp->bpf_func = (void *) jit.prg_buf;
	fp->jited = 1;
	fp->jited_len = jit.size;
free_addrs:
	kfree(jit.addrs);
out:
+1 −0
Original line number Diff line number Diff line
@@ -1560,6 +1560,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)

	prog->bpf_func = (void *)ctx.image;
	prog->jited = 1;
	prog->jited_len = image_size;

out_off:
	kfree(ctx.offset);
+1 −0
Original line number Diff line number Diff line
@@ -1167,6 +1167,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
		bpf_jit_binary_lock_ro(header);
		prog->bpf_func = (void *)image;
		prog->jited = 1;
		prog->jited_len = proglen;
	} else {
		prog = orig_prog;
	}
Loading