Git Product home page Git Product logo

ebpf-for-windows-demo's Introduction

eBPF for Windows Demos

This repository is the home for various demo projects built on top of ebpf-for-windows platform.

Use the Getting Started guide for first time setup of this project.

Following links contain more details and the setup steps for the different demo projects.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

ebpf-for-windows-demo's People

Contributors

alan-jowett avatar dependabot[bot] avatar dthaler avatar dv-msft avatar microsoftopensource avatar poornagmsft avatar saxena-anurag avatar shpalani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ebpf-for-windows-demo's Issues

CI/CD build warnings

https://github.com/microsoft/ebpf-for-windows-demo/actions/runs/4106279517/jobs/7084298668

The "Restore NuGet packages for ebpf-for-windows-demo" step gives

WARNING: Project file D:\a\ebpf-for-windows-demo\ebpf-for-windows-demo\external\Catch2\build\src\Catch2WithMain.vcxproj cannot be found.
WARNING: Project file D:\a\ebpf-for-windows-demo\ebpf-for-windows-demo\external\Catch2\build\src\Catch2.vcxproj cannot be found.

because the "Create catch2 project for ebpf-for-windows-demo" step comes after it.
The order should be swapped to get rid of the warnings.

Create a test .o file for Cilium demo

ebpf-for-windows-demo.sln should also generate "test" .o files for both SNAT and DSR scenario, which can be used for testing / verification purpose.

Fix cilium XDP demo

It looks like after moving to nuget package, the XDP demo does not work on the final test setup. Compilation of Cilium XDP program fails due to

  1. missing header files
  2. Some redefinitions.

Add CI/CD test to load the eBPF programs

Request: Add a CICD test that can test the loading of the eBPF programs, to ensure this does not regress in the future.

Currently, the user has to manually ensure loading of eBPF programs works.

Add dependabot

So updates to the ebpf-for-windows repo will result in a PR against the demo project that verifies the demo still builds.

Add basic CI/CD tests

  • Verify that things compile
  • Add a CI/CD test to test that the ebpf program passes verification

We should add at least minimal CI/CD tests to prevent regressions

An error occurs when building ebpf-for-windows-demo.sln.

What is the error "Program type not found for section name sockops"?

The build error is shown below

5>CustomBuild:
          Project "F:\Git_backup\ebpf-for-windows-demo\x64\Release\conn_track_km\conn_track.vcxproj" on node 1 (default target).
          DriverBuildNotifications:
            Building 'conn_track_km' with toolset 'WindowsKernelModeDriver10.0' and the 'Desktop' target platform.
            Using KMDF 1.15.
          PrepareForBuild:
            Creating the "x64\Release\" directory.
            Structured output is available. The format of compiler diagnostics reflects the error hierarchy. For more information, see https://aka.ms/cpp/structured-output.
            Creating the directory "x64\Release\conn_track_km.tlog\".
          InitializeBuildStatus:
            Creating "x64\Release\conn_track_km.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
            Connecting (touching) to "x64\Release\conn_track_km.tlog\unsuccessfulbuild".
          PreBuildEvent:
            F:\Git_backup\ebpf-for-windows-demo\packages\eBPF-for-Windows.0.11.0\build\native\bin\bpf2c --bpf conn_track
          .o --sys conn_track_driver.c
            :VCEnd
      6>Link:
          All 369 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
          You have generated code.

5>CustomBuild:
            Program type not found for section name sockops
      5>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets
        (156,5): error MSB3073: "F:\Git_backup\ebpf-for-windows-demo\packages\eBPF-for-Windows.0.11.0\build\native\bin\b
        pf2c --bpf conn_track.o --sys conn_track_driver.c [F:\Git_backup\ebpf-for-windows-demo\x64\Release\conn_track_
        km\conn_track.vcxproj] [F:\Git_backup\ebpf-for-windows-demo\connection_tracker\bpf\bpf.vcxproj]
      5>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets
        (156,5): error MSB3073: :VCEnd" command terminated (code: 1). [F:\Git_backup\ebpf-for-windows-demo\x64\Release\conn_track_
        km\conn_track.vcxproj] [F:\Git_backup\ebpf-for-windows-demo\connection_tracker\bpf\bpf.vcxproj]
          Built the project "F:\Git_backup\ebpf-for-windows-demo\x64\Release\conn_track_km\conn_track.vcxproj" (default target). - failure

          Build failed.

          "F:\Git_backup\ebpf-for-windows-demo\x64\Release\conn_track_km\conn_track.vcxproj" (default target)(1)->
          (PreBuildEvent target) ->
      5>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets
        (156,5): error MSB3073: "F:\Git_backup\ebpf-for-windows-demo\packages\eBPF-for-Windows.0.11.0\build\native\bin\b
        pf2c --bpf conn_track.o --sys conn_track_driver.c [F:\Git_backup\ebpf-for-windows-demo\x64\Release\conn_track_
        km\conn_track.vcxproj] [F:\Git_backup\ebpf-for-windows-demo\connection_tracker\bpf\bpf.vcxproj]
      5>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets
        (156,5): error MSB3073: :VCEnd" command terminated (code: 1). [F:\Git_backup\ebpf-for-windows-demo\x64\Release\conn_track_
        km\conn_track.vcxproj] [F:\Git_backup\ebpf-for-windows-demo\connection_tracker\bpf\bpf.vcxproj]

              0 warnings
              1 error

The build environment is as follows.

  • Windows 11 Pro 23H2 22631.3296
  • visual studio professional 2022 17.9.5

sdk & wdk information

image

Updating and downgrading to the latest version of the eBPF-for-Windows nuget package does not change the error.

eBPF For Windows Demo - Connection Tracking fails

reference page: https://github.com/microsoft/ebpf-for-windows-demo/blob/main/connection_tracker/README.md

Running: cd out && powershell -NonInteractive -ExecutionPolicy Unrestricted %EBPF_ROOT%\bin\Convert-BpfToNative.ps1 -ProgramName conn_track.o

Fails with: Project "C:\Users\User\repos\ebpf-for-windows-demo\connection_tracker\bpf\out\conn_track.vcxproj" on
node 1 (default targets).
C:\Users\User\repos\ebpf-for-windows-demo\connection_tracker\bpf\out\conn_track.vcxproj(1,2134): erro
r MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBui
ld\Microsoft\VC\v170\Microsoft.Cpp.Default.props" was not found. Confirm that the expression in the I
mport declaration "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\V
C\v170\Microsoft.Cpp.Default.props" is correct, and that the file exists on disk.
Done Building Project "C:\Users\User\repos\ebpf-for-windows-demo\connection_tracker\bpf\out\conn_trac
k.vcxproj" (default targets) -- FAILED.

The path: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\V
C\v170\Microsoft.Cpp.Default.props
does not exist.

Also, I searched for Microsoft.Cpp.Default.props
which also does not exist on the disk.

How to proceed?

run error

when i run .\conn_tracker.exe. I got error
Press Ctrl-C to shutdown
bpf_object__load for conn_track.sys failed: 0

what‘s mean 0

Update bpf_xdp ebpf program to latest

bpf_xdp.c (a standalone Load balance) in cilium/bpf/
bpf_xdp.c was written 2 years back.
This issue is created to bring

  1. bpf_xdp.c to latest
  2. ensure end-to-end connectivity and functionality stated in the L4LB cilium demo.

Wrong map name being used for IPv6

In multiple locations the same map is being used irrespective of ipv4 condition (both then/else blocks map to same map name).
It looks like LB6_SERVICES_MAP_V2 map should be used in the “else” path.

Line with the issue:

const char* map_name = ipv4 ? LB4_SERVICES_MAP_V2 : LB4_SERVICES_MAP_V2;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.