Граф коммитов

8 Коммитов

Автор SHA1 Сообщение Дата
saxena-anurag 1bbbc41233
add auto-pinning option for maps. (#612)
* add auto-pinning option

* Apply suggestions from code review

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* Configure custom pin_root_path using bpf_object_open_opts

* use new api for map-in-map, remove pinning restriction for inner map, remove workaround for inner map id

* code cleanup

* cr comments

* Apply suggestions from code review

Co-authored-by: Dave Thaler <dthaler@microsoft.com>

* fix bad merge

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-10-01 09:01:39 -06:00
Dave Thaler 0a1555956e
Add map-in-map type checking (#451)
* Add map-in-map type checking

This PR enforces that all inner maps must be of the same type
as the inner map template used for verification.  Other fields
might need to match too, and if so those will be updated in
a subsequent PR once it is confirmed which fields must match.

A few pieces of this PR related to map_id are prerequisites
for issue #396 which will add IDs for programs, maps, and links.

Finally, there are multiple definitions of bpf_map, since the
version used to write eBPF programs is different from what is
stored in memory (which uses map IDs) so to avoid confusion in
code and allow the compiler to do type checking to catch some
bugs, this splits ebpf_map_definition_t into two, one for
in_memory and one for in_file (meaning in an eBPF program).
This will also allow the future PR for issue 396 to be more
understandable, but also aids clarity in some parts of this PR.

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2021-08-30 19:14:08 -07:00
Dave Thaler f45e80d385
Add map-in-map support (#408)
* Add map-in-map support

Replace UM ebpf_map_update/delete_element with libbpf-compliant
bpf_map_update/delete_elem

This adds the basic functionality needed for #375

Not in this PR, but in a subsequent PR:
* ensure that all inner maps match the one specified by inner_map_idx,
  much like prog_types have to match in a prog_array.
* ensure that putting a prog_array in an array of maps adheres to the
  prog_array contract that any associated progs have to match the
  type of the calling program.
* read a map id not fd when UM reads the value (will be done together
  with issue #396 since also affects prog_arrays)

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2021-08-23 18:46:24 -07:00
saxena-anurag 014ee34392
Add eBPF UM APIs (#368)
* parse map names from elf file
* add apis, change test code

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-08-10 17:04:07 -07:00
saxena-anurag cf2ef87325
Move program load to ebpfsvc (#245)
* remove duplicate windows_helpers.cpp, refactor

* remove commented code

* move program load to service

* cleanup commented code

* remove commented code

* cr comments

* make device handle init optional

* cr comments

* change return type of some functions

* fix

* cr comments

* cr comments, cover more error conditions in windows_error_to_ebpf_result

* cr comments

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
2021-06-07 15:22:04 -06:00
saxena-anurag 3a8e5dd7cd
remove duplicate windows_helpers.cpp, refactor (#236)
* remove duplicate windows_helpers.cpp, refactor

* remove commented code

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-05-28 15:29:41 -07:00
Alan Jowett 4c64214af7
Change resolve_maps_in_byte_code to send handles for resolution only when needed. (#230)
* Add LLVM for code generation proposal

* Revert "Add LLVM for code generation proposal"

This reverts commit cd896afd94.

* Eliminate duplicate map resolutions

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2021-05-27 13:56:06 -07:00
saxena-anurag 4b2384479d
refactor api.lib to api.lib, common.lib, service.lib (#219)
* refactor api.lib to api.lib, common.lib, service.lib

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2021-05-25 14:11:13 -07:00