* Add bpf2c_plugin
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix CMake so that it builds correctly
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Remove bpf_conformance as a submodule
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Download bpf_conformance artifact
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Extract bpf_conformance\
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix path
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Execute bpf_conformance in CI/CD
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Pickup latest artifacts"
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
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>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: saxena-anurag <43585259+saxena-anurag@users.noreply.github.com>
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>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
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>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
* Refactor netebpfext (#1351)
* refactor netebpfext to allow unit and fuzzing
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Normalize parameter casing
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Normalize types
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix release build
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix CMake build
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix NetEbpfExt_headers CMake target
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Rename unit to user
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Switch netebpfext_unit -> netebpfext_user
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Flesh out kernel thunk
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* More canonical naming and W4 clean
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix prefast issue
* Fix CMake
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix code analysis
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
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>
* Clean up fw_thunk.h (#1369)
* Clean up fw_thunk.h
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix SAL annotations
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Netebpf ext unit test (#1365)
* Add netebfpext start/stop unit tests
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Update NMR thunk and expand netebpf_ext helper
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix code-analysis issues
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>
* Remove duplicate NMR includes (#1370)
* Remove duplicate NMR includes
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback and more header cleanup
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>
* Refactor NMR user mode to be thread safe (#1371)
* Refactor NMR user mode to be thread safe
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
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>
* Add a unit test that tests classify_packet in user mode (#1379)
* Add packet test scaffolding
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* More of test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add dummy packet to test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add dummy program
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Cleanup
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix mock NMR bug
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Temporarily add printfs
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Incorporate fix for 1378
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix test bug
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add a packet-drop case to the test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Try fixing include path
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix double free of workitem
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Revert unrelated changes in ebpfcore and ebpfapi
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
Co-authored-by: Alan Jowett <alan.jowett@microsoft.com>
* Pin docker base image with hash
* Review Markups
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: Alan Jowett <alanjo@microsoft.com>
* Bump version to 0.5.0
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update version in tutorial doc
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add map ids test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Enumerate maps associated with a program
Fixes#1339
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Initialize info before calling
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Update bpftool
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Make "netsh show prog l=v" show map ids for program
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Return EFAULT if map_ids is not a valid pointer
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix warning
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* More test fixes
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix socket test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Add more checks in the socket test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix socket test
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Fix netsh
Also fix GettingStarted.md and a missing space in the logs
that were found while testing this fix.
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* Set map_ids on output
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
Signed-off-by: Dave Thaler <dthaler@microsoft.com>
* The bpf_map_lookup_elem API should correctly handle PERCPU maps.
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Use correct APIs to compute current CPU index and maximum CPU index
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback
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>
Co-authored-by: saxena-anurag <43585259+saxena-anurag@users.noreply.github.com>
* Add tests to verify BPF code generation for interpret and jit
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* PR feedback and fix build
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Fix unit tests
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>
* Implement correct division by zero behavior
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
* Simplify code gen
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>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
Co-authored-by: saxena-anurag <43585259+saxena-anurag@users.noreply.github.com>
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>
Co-authored-by: saxena-anurag <43585259+saxena-anurag@users.noreply.github.com>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>
Signed-off-by: James Sturtevant <jstur@microsoft.com>
Signed-off-by: James Sturtevant <jstur@microsoft.com>
Co-authored-by: Dave Thaler <dthaler@microsoft.com>