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

24 Коммитов

Автор SHA1 Сообщение Дата
Dhiren Vispute 946a9d4efb
Disable extension restart for test (#3225)
Co-authored-by: Dhiren Vispute <Dhiren.Vispute@microsoft.com>
2024-02-05 16:26:36 +00:00
Anurag Saxena 3f5e0ba1ba
Separate out undocked components. (#3055)
* remove not-needed includes

* fix

* fix

* update sample extension

* change include path

* export store APIs from ebpfapi.dll

* fix analyze build

* update dependencies

* add undocked projects

* undock sample_ext driver

* fix build

* more undocking

* fix build

* remove undocked projects from fuzzerdebug

* fix nuget

* remove usersim from export_program_info

* fix configuration manager

* fix tests

* skip building undocked samples for FuzzerDebug builds

* fix build

* try cicd changes

* fix cicd yml

* update export_program_info to not clean up all entries

* code cleanup

* delete global helpers from the store

* code cleanup

* export *delete* store APIs from ebpfapi

* code cleanup

* CR comments

* cr comments

* remove ansi APIs

* CR comments

* cr comments

* fix CI failure

* fix rebase build issues

* change default custom type to bind

* some more fixes

* fix tests

* fix tests

* update expected files

* fix bpf2c tests

* run export_program_info

* fix headers

* CR comments
2023-12-07 21:10:19 +00:00
Alan Jowett 041d402eeb
Fix build break from VS 2022 17.8.2 (#3104)
* Fix build break from VS 2022 17.8.2

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Fix conflicting C++ versions

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* New depenedency on kernel32.dll

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Pickup latests usersim

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

---------

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
2023-12-07 00:58:33 +00:00
Sharmi 5cc488fb08
Increase MAX_TAIL_CALL_CNT to 33 tail calls (#2826)
* Initial Commit

* Added tail call max exceed native test case

* Initial commit

* Initial commit

* Added bpf2c_tests/expected changed files

* Fixed the return value in bind_tailcall_max_native_test

* Addressed PR comments

* Update tests/unit/libbpf_test.cpp

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

* Update tests/unit/libbpf_test.cpp

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

* tests/unit/libbpf_test.cpp

* Moved MAX_TAIL_CALL_CNT to ebpf_structs.h as suggested

* Removed MAX_TAIL_CALL_CNT in api_test and stress_tests_km file

* Add the generated expected file for tail_call_max_exceed

* Removed MAX_TAIL_CALL_CNT from bpf_helpers.h

---------

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2023-09-11 16:55:56 +00:00
Dave Thaler c947ca63b9
Make runtime binaries not depend on usersim (#2783)
* build ebpfcore under usersim

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Work around analysis warnings

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix installer project

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Temporarily use ubpf branch with memory fix

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* WIP

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* WIP

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Create project for files shared between ebpfapi and the ebpf runtime

Move existing files from libs/platform either to:
* libs/shared, if meant to be common between user-mode and ebpf runtime
* libs/runtime, if meant to be used by the ebpf runtime only (whether in
  user or kernel mode)

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Move ebpf_tracelog.c to shared

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Create shared_user and shared_kernel projects

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* WIP

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* WIP

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Remove usersim from ebpfsvc

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Update to cxplat branch of usersim

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Use cxplat_utf8_string

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Cleanup

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix build errors

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix ebpf_allocate_with_tag

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fixes

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Bug fixes

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix use of ebpf_reallocate to not pass a null pointer

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix printf tests

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix memory leaks

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Temporary change to help debug double-free in test

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Update to latest usersim

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix analysis warnings

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Update to latest usersim

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Update usersim to latest

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Change native module to use latest usersim

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Update nuget package

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Only call cxplat_cleanup if cxplat_initialize succeeds

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>

* Revert setup_build.vcxproj change

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Update usersim to latest

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

---------

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
2023-09-05 17:57:21 +00:00
Sharmi 888ab8e4d3
Fix bindmonitor_tail_call_invoke_program_test test case with 31 MAX tail calls (#2802)
* Reduce tail calls to 31

* Updated readme file

* Regenerated the changed test case
2023-08-30 19:50:50 +00:00
Dhiren Vispute 7cc11a45b9
enable explicit clean-up prior to process exit (#2782)
Co-authored-by: Dhiren Vispute <Dhiren.Vispute@microsoft.com>
2023-08-23 22:13:53 +00:00
Dave Thaler b7f82b66c5
Remove cmake build (#2764)
Other projects can now consume ebpf-for-windows in binary form,
using either nuget or MSI install.  We no longer need to build
ebpf-for-windows both ways, so removing the cmake build to free
up build resources and reduce the development cost of maintaining
both msbuild and cmake builds.

Fixes #2743

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2023-08-18 00:48:10 +00:00
Dave Thaler a29064a1fe
Convert usersim to a DLL (#2683)
* Use usersim as DLL

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Convert usersim to a DLL

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Make cmake build clear program info state like VS build does

PR #1192 updated the vcxproj file but not the corresponding CMakeLists.txt file
for export_program_info

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Pick up latest usersim fix

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix deadlock in epoch_test_stale_items test

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Don't throw exceptions in unit tests

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix single instance hook initialization in test cases

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix deadlock in performance test

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Add usersim.dll to installer files

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

---------

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2023-07-27 18:36:05 +00:00
Dave Thaler 792d41cd2f
Update use of usersim library to use Ke* DPC APIs (#2662)
* Update usersim library for DPC API support

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Flush queued DPCs before terminating usersim platform

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix fault injection test

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix test bugs found by fault injection

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Use usersim Ke*Timer apis

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix bad uses of REQUIRE in netebpfext_unit constructors/destructors

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix mismatched initiate/terminate calls

Move Test-FaultInjection.ps1 to the usersim repo

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Use REQUIRE instead of throwing exceptions from unit tests

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Don't use REQUIRE in constructors

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix memory leak bug in netebpf_ext_helper destructor

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix reference count leak in net_ebpf_extension_sock_ops_flow_established_classify

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

---------

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2023-07-18 06:47:46 +00:00
Dave Thaler a90097517e
More usersim library cleanup (#2636)
* More usersim library cleanup

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix analyze warning

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Use TraceLogging for printk

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix analysis warnings

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix deadlock in core_helper_fuzzer

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Update usersim library

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix call to RpcStringFreeA

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

---------

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2023-07-06 23:41:58 +00:00
Dave Thaler ec27659adf
Move usersim code into a separate repo (#2596)
* Use usersim repo

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Remove DISPATCH test code from _preprocess_load_native_module

Per Anurag: the code was added earlier to execute the 2 paths in
native module, and it is not needed anmore IIRC, as the "DISPATCH"
code has been removed now from the native module

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Bug fixes

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Unify some APIs

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix warnings and clean up code

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* updated

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

---------

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2023-06-27 15:26:46 +00:00
Dhiren Vispute 10735e577c
Fix double-load issue (#2552)
Co-authored-by: Dhiren Vispute <dhiren.vispute@microsoft.com>
2023-06-07 17:02:43 +00:00
Dhiren Vispute 595e96150d
Fix cgroup/connect<4|6> usage (#2546)
Co-authored-by: Dhiren Vispute <dhiren.vispute@microsoft.com>
2023-06-07 15:58:06 +00:00
Dave Thaler 87b6520c34
Remove JIT and interpreter code from NativeOnly builds (#2475)
* Remove JIT and interpreter code from NativeOnly builds

Fixes #2030
Fixes #2488

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Try conditional project references

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Various test fixes

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Native-only fixes to deploy-ebpf.ps1

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Native-only support for setup-ebpf.ps1

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Native-only support for api_test.exe

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Add connect_redirect_tests to deploy-ebpf.ps1

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* PR feedback from Anurag

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

---------

Signed-off-by: Dave Thaler <dthaler@microsoft.com>
2023-06-07 15:49:03 +00:00
Sharmi 8adab0de10
stress test for tail calls (#2518)
* Add stress test for tail calls

* Added the code generated bindmonitor_mt_tailcall files

* Added the test case description to readme.md

* Update tests/stress/km/stress_tests_km.cpp

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

* Update tests/stress/km/stress_tests_km.cpp

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

* Addressed PR comments and Fixed merge conflicts with latest

* Fixed function name

* Regenerated the expected files, after the macro MAX TAIL CNT change done yesterday

* Update tests/stress/readme.md

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

* Removed clean_up tail call

* Add bind in loop

* updated the readme

* Addressed PR comments

* Changed LOG_VERBOSE to LOG_ERROR

* Updated readme and addressed PR comment

---------

Co-authored-by: Dave Thaler <dthaler@microsoft.com>
2023-06-07 05:21:47 +00:00
Gianni Trevisiol d6bcf1958c
Refactor eBPFCore tracing to use less stack space. (#2501)
* refactor ebpfcore tracing

* feedback
2023-05-31 17:26:09 +00:00
Dhiren Vispute b054f0fb32
tweak extension stop/restart, better handling of test runtime (#2519)
Co-authored-by: Dhiren Vispute <dhiren.vispute@microsoft.com>
2023-05-26 02:59:13 +00:00
Alan Jowett f084c9d4c3
Remove unneeded nuget package (#2507)
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
2023-05-24 14:38:32 +00:00
Gianni Trevisiol 5950a9785b
Load/Attach/Unload programs only once for connect_redirect tests. (#2450)
* draft

* comments, rename

* nit

* test

* nit

* test

* test

* aggregate globals

* Fix C26495 warnings

* debug

* test

* debug

* debug instrument

* instrument

* comment

* debug

* fix hints and address_info leak

* fix leak

* wip

* fix

* fix

* tests

* Finalize and remove instrumentation.

* Merge bpf_object_ptr definitions

* feedback

* nit

* fixed SAL annotation

* feedback

* nit

* revert
2023-05-17 17:32:04 +00:00
Dhiren Vispute 574d41b49c
Code clean-up, duplicate code refactoring (#2467)
Co-authored-by: Dhiren Vispute <dhiren.vispute@microsoft.com>
2023-05-16 02:29:28 +00:00
Dhiren Vispute c0e0804456
Ensure non-zero helper function count before using it in allocation computations. (#2393) 2023-05-02 00:50:34 +00:00
Dhiren Vispute 83567d6270
Add Multi-threaded stress tests (kernel mode). (#2240) 2023-04-25 21:00:44 +00:00
Dhiren Vispute f6bf814608
Add User mode multi-threaded stress tests (#2195)
* Add User mode multi-threaded stress tests

* Schedule nightly multi-threaded stress tests (user mode)

* Add missing event check
2023-03-21 19:00:42 +00:00