Skip to content

Commit

Permalink
Unify datapath (#3819)
Browse files Browse the repository at this point in the history
* Remove QUIC_USE_RAW_DATAPATH (logic only)

* move logic to core side

* remove QUIC_USE_RAW_DATAPATH from test

* fix googletest version and add last line

* replace from flag to function call

* fix build error

* fix build/test issues

* implement CxPlatResolveRoute for normal socket

* add Getter of Datapath feature

* fix build issues

* adopt comments

* adopt comment and fix kernel build error

* fix kernel build error

* more fix for kernel build

* Unify datapath

* DatapathTest partially work

* just unify build of both normal socket and xdp

* SOCKET: RAW{...Socket{BASE{addr}}}, DATAPATH: XDP{RAW{DATAPATH*}} <-> DATAPATH{RAW*, BASE{callbacks}}

* tmp

* add preview_feature flag back

* refactoring CxPlatIsRouteReady

* fix linux code check

* adjust func names

* fix comments

* fix IsRouteReady and clean ifdef for _KERNEL_MODE

* kernel build error

* Set RouteResolved for Rx

* fix more tests

* move global definition in header file

* kernel to avoid calling helper function

* move QuitTestIsFeatureSupported after RegistrationOpen

* supress warning

* remove QuitTestIsFeatureSupported from quic_gtest as it doesn't work as expected by dependency of MsQuicLib.Datapath

* remove raw feature check as much as possible

* ifdef for UseQTIP visibility

* tmp

* tmp

* fix merge side effects

* all tests passed

* fix tests in msquicplatformtest

* fix tcp with duonic

* update clog

* use xdp v1

* WIP cleanup

* refactoring CXPLAT_SEND_DATA

* remove mangling and function pointer

* remove unnecessary change in test

* fix comments

* cleanup

* move logic to _winuser

* use dummy raw datapath for uwp build

* dummy raw

* remove double free

* fix comments

* update dummy func

* fix perf run for TCP

* partially fix comments

* fix build error for uwp and remove duplicate variable in raw socket

* set socket before start receiving

* add dummy to clog

* add clog files for dummy

* fix dependency for cargo on windows

* remove dummy clog files

* remove AuxSocket

* add pwsh for cargo setup

* clog fix

* add include dir for cargo

* [WIP] fix cargo and qtip

* fix clog, qtip, rename private raw functions and cleanup

* experiment to avoid write overflow

* use Config->Route->DatapathType for data allocation

* more strict if conditions

* fix comments

* fix uwp build

* fix clog and artifact name

* fix back xdp dependency

* Simply build automation

* missed one

* apply unification to linux and remove QUIC_USE_XDP flag

* move types to any platform

* add abstruction layer for linux

* add clog

* add clog dependencies

* fix CodeCheck issues

* remove xdp specific artifact dir name and always install xdp deps

* add docs

* More Fixes for XDP in automation (mostly OneBranch)

---------

Co-authored-by: Nick Banks <nibanks@microsoft.com>
  • Loading branch information
ami-GS and nibanks authored Sep 23, 2023
1 parent f9d26ac commit ae3db5c
Show file tree
Hide file tree
Showing 63 changed files with 3,170 additions and 2,868 deletions.
17 changes: 0 additions & 17 deletions .azure/OneBranch.Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,6 @@ extends:
parameters:
config: Debug

- stage: build_windows_xdp
displayName: Build Windows XDP
dependsOn: []
jobs:
- template: .azure/obtemplates/build-winuser-xdp.yml@self
parameters:
config: Release
tls: schannel
- template: .azure/obtemplates/build-winuser-xdp.yml@self
parameters:
config: Release
tls: openssl
- template: .azure/obtemplates/build-winuser-xdp.yml@self
parameters:
config: Debug

- stage: build_windows
displayName: Build Windows
dependsOn: []
Expand Down Expand Up @@ -204,7 +188,6 @@ extends:
dependsOn:
- build_windows
- build_uwp
- build_windows_xdp
jobs:
- template: .azure/obtemplates/build-nuget.yml@self
${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
Expand Down
17 changes: 0 additions & 17 deletions .azure/OneBranch.PullRequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,6 @@ extends:
parameters:
config: Debug

- stage: build_windows_xdp
displayName: Build Windows XDP
dependsOn: []
jobs:
- template: .azure/obtemplates/build-winuser-xdp.yml@self
parameters:
config: Release
tls: schannel
- template: .azure/obtemplates/build-winuser-xdp.yml@self
parameters:
config: Release
tls: openssl
- template: .azure/obtemplates/build-winuser-xdp.yml@self
parameters:
config: Debug

- stage: build_windows
displayName: Build Windows
dependsOn: []
Expand Down Expand Up @@ -198,6 +182,5 @@ extends:
dependsOn:
- build_windows
- build_uwp
- build_windows_xdp
jobs:
- template: .azure/obtemplates/build-nuget.yml@self
32 changes: 5 additions & 27 deletions .azure/azure-pipelines.perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ stages:
arch: ${{ parameters.arch }}
config: Release

- ${{ if or(eq(parameters.winkernel, true), eq(parameters.winuser_schannel, true)) }}:
- ${{ if or(eq(parameters.winkernel, true), eq(parameters.winuser_schannel, true), eq(parameters.winuser_xdp, true)) }}:
- stage: build_winuser_schannel
displayName: Build Windows (Schannel)
dependsOn: []
Expand All @@ -171,33 +171,12 @@ stages:
arch: ${{ parameters.arch }}
tls: schannel
config: Release
extraPrepareArgs: -DisableTest
extraPrepareArgs: -DisableTest -InstallXdpSdk
${{ if eq(parameters.pgo_mode, false) }}:
extraBuildArgs: -DisableTest -DisableTools
${{ if eq(parameters.pgo_mode, true) }}:
extraBuildArgs: -DisableTest -DisableTools -PGO

- ${{ if eq(parameters.winuser_xdp, true) }}:
- stage: build_winuser_xdp
displayName: Build Windows (XDP)
dependsOn: []
variables:
runCodesignValidationInjection: false
jobs:
- template: ./templates/build-config-user.yml
parameters:
image: windows-latest
platform: windows
arch: ${{ parameters.arch }}
tls: schannel
config: Release
extraName: 'xdp'
extraPrepareArgs: -DisableTest -InstallXdpSdk
${{ if eq(parameters.pgo_mode, false) }}:
extraBuildArgs: -DisableTest -DisableTools -UseXdp -ExtraArtifactDir Xdp
${{ if eq(parameters.pgo_mode, true) }}:
extraBuildArgs: -DisableTest -DisableTools -UseXdp -ExtraArtifactDir Xdp -PGO

- ${{ if eq(parameters.winuser_openssl, true) }}:
- stage: build_winuser_openssl
displayName: Build Windows (OpenSSL)
Expand Down Expand Up @@ -331,7 +310,7 @@ stages:
- stage: perf_winuser_xdp
displayName: Performance Testing Windows (XDP)
dependsOn:
- build_winuser_xdp
- build_winuser_schannel
jobs:
- template: ./templates/run-performance.yml
parameters:
Expand All @@ -344,11 +323,10 @@ stages:
protocol: ${{ parameters.protocol }}
logProfile: ${{ parameters.logging }}
timeout: ${{ parameters.timeout }}
extraArtifactDir: '_Xdp'
${{ if eq(parameters.QTIP, true) }}:
extraTestArgs: -ExtraArtifactDir _Xdp -XDP -QTIP
extraTestArgs: -XDP -QTIP
${{ else }}:
extraTestArgs: -ExtraArtifactDir _Xdp -XDP
extraTestArgs: -XDP
${{ if ne(parameters.testToRun, 'all') }}:
testToRun: ${{ parameters.testToRun }}
testTypes: Remote
Expand Down
24 changes: 3 additions & 21 deletions .azure/azure-pipelines.periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ stages:
arch: x64
tls: schannel
config: Release
extraPrepareArgs: -DisableTest
extraPrepareArgs: -DisableTest -InstallXdpSdk
extraBuildArgs: -DisableTest -DisableTools -PGO

- stage: build_winuser_openssl
Expand Down Expand Up @@ -69,23 +69,6 @@ stages:
extraPrepareArgs: -DisableTest
extraBuildArgs: -DisableTest -DisableTools -PGO

- stage: build_winuser_xdp
displayName: Build Windows (XDP)
dependsOn: []
variables:
runCodesignValidationInjection: false
jobs:
- template: ./templates/build-config-user.yml
parameters:
image: windows-latest
platform: windows
arch: x64
tls: schannel
config: Release
extraName: 'xdp'
extraPrepareArgs: -DisableTest -InstallXdpSdk
extraBuildArgs: -DisableTest -DisableTools -UseXdp -ExtraArtifactDir Xdp -PGO

#
# Performance Tests
#
Expand Down Expand Up @@ -141,7 +124,7 @@ stages:
- stage: perf_winuser_xdp
displayName: Performance Testing Windows (XDP)
dependsOn:
- build_winuser_xdp
- build_winuser_schannel
jobs:
- template: ./templates/run-performance.yml
parameters:
Expand All @@ -150,8 +133,7 @@ stages:
localTls: schannel
remoteTls: schannel
arch: x64
extraArtifactDir: '_Xdp'
extraTestArgs: -ExtraArtifactDir _Xdp -XDP
extraTestArgs: -XDP
testTypes: Remote
extraArgs: -PGO
failOnRegression: 0
Expand Down
33 changes: 0 additions & 33 deletions .azure/obtemplates/build-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,6 @@ jobs:
artifact: drop_build_uwp_build_uwp_openssl_Debug
path: $(Build.SourcesDirectory)\artifacts\bin\uwp

- task: DownloadPipelineArtifact@2
inputs:
artifact: drop_build_windows_xdp_build_windows_schannel_Debug_xdp
path: $(Build.SourcesDirectory)\artifacts\bin\windows
- task: DownloadPipelineArtifact@2
inputs:
artifact: drop_build_windows_xdp_build_windows_schannel_Release_xdp
path: $(Build.SourcesDirectory)\artifacts\bin\windows
- task: DownloadPipelineArtifact@2
inputs:
artifact: drop_build_windows_xdp_build_windows_openssl_Release_xdp
path: $(Build.SourcesDirectory)\artifacts\bin\windows

- task: PowerShell@2
displayName: Package Nuget
inputs:
Expand Down Expand Up @@ -99,26 +86,6 @@ jobs:
${{ if eq(parameters.release, true) }}:
arguments: -Tls schannel -ReleaseBuild

- task: PowerShell@2
displayName: Package Nuget
inputs:
pwsh: false
filePath: scripts/package-nuget.ps1
${{ if eq(parameters.release, false) }}:
arguments: -Tls schannel -XDP
${{ if eq(parameters.release, true) }}:
arguments: -Tls schannel -ReleaseBuild -XDP

- task: PowerShell@2
displayName: Package Nuget
inputs:
pwsh: false
filePath: scripts/package-nuget.ps1
${{ if eq(parameters.release, false) }}:
arguments: -Tls openssl -XDP
${{ if eq(parameters.release, true) }}:
arguments: -Tls openssl -ReleaseBuild -XDP

- task: onebranch.pipeline.signing@1
inputs:
command: 'sign'
Expand Down
36 changes: 0 additions & 36 deletions .azure/obtemplates/build-winuser-xdp.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .azure/obtemplates/build-winuser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ jobs:
ob_sdl_binskim_break: true # https://aka.ms/obpipelines/sdl
ob_sdl_codeSignValidation_excludes: -|**\*.exe # Disable signing requirements for test executables
steps:
- task: PowerShell@2
displayName: Prepare Build Machine
target: windows_build_container2
inputs:
pwsh: true
filePath: scripts/prepare-machine.ps1
arguments: -InstallXdpSdk -ForContainerBuild
- task: PowerShell@2
displayName: x64
target: windows_build_container2
Expand Down
10 changes: 3 additions & 7 deletions .github/workflows/build-reuse-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ on:
# - openssl
# - openssl3
# - schannel
xdp:
required: false
default: ''
type: string
static:
required: false
default: ''
Expand Down Expand Up @@ -89,11 +85,11 @@ jobs:
- name: Build For Test
if: inputs.test == '-Test'
shell: pwsh
run: scripts/build.ps1 -Config ${{ inputs.config }} -Platform ${{ inputs.plat }} -Arch ${{ inputs.arch }} -Tls ${{ inputs.tls }} -DisablePerf -DynamicCRT ${{ inputs.xdp }} ${{ inputs.sanitize }}
run: scripts/build.ps1 -Config ${{ inputs.config }} -Platform ${{ inputs.plat }} -Arch ${{ inputs.arch }} -Tls ${{ inputs.tls }} -DisablePerf -DynamicCRT ${{ inputs.sanitize }}
- name: Build
if: inputs.test == ''
shell: pwsh
run: scripts/build.ps1 -Config ${{ inputs.config }} -Platform ${{ inputs.plat }} -Arch ${{ inputs.arch }} -Tls ${{ inputs.tls }} ${{ inputs.xdp }} ${{ inputs.sanitize }} ${{ inputs.static }}
run: scripts/build.ps1 -Config ${{ inputs.config }} -Platform ${{ inputs.plat }} -Arch ${{ inputs.arch }} -Tls ${{ inputs.tls }} ${{ inputs.sanitize }} ${{ inputs.static }}
- name: Filter Build Artifacts
shell: pwsh
run: |
Expand All @@ -103,5 +99,5 @@ jobs:
- name: Upload build artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: ${{ inputs.config }}-${{ inputs.plat }}-${{ inputs.os }}-${{ inputs.arch }}-${{ inputs.tls }}${{ inputs.xdp }}${{ inputs.sanitize }}${{ inputs.static }}${{ inputs.test }}
name: ${{ inputs.config }}-${{ inputs.plat }}-${{ inputs.os }}-${{ inputs.arch }}-${{ inputs.tls }}${{ inputs.sanitize }}${{ inputs.static }}${{ inputs.test }}
path: artifacts
21 changes: 4 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs:
arch: [x86, x64, arm64]
tls: [schannel, openssl, openssl3]
static: ['', '-Static']
xdp: ['', '-UseXdp']
exclude:
# OpenSSL doesn't support arm64
- tls: openssl
Expand All @@ -46,15 +45,6 @@ jobs:
# TODO: FIX: Static builds fail with UWP
- plat: uwp
static: '-Static'
# XDP not supported in UWP
- plat: uwp
xdp: '-UseXdp'
# XDP only supports x64 currently
- arch: x86
xdp: '-UseXdp'
# XDP only supports x64 currently
- arch: arm64
xdp: '-UseXdp'
uses: ./.github/workflows/build-reuse-win.yml
with:
config: ${{ matrix.config }}
Expand All @@ -63,7 +53,6 @@ jobs:
arch: ${{ matrix.arch }}
tls: ${{ matrix.tls }}
static: ${{ matrix.static }}
xdp: ${{ matrix.xdp }}

build-windows-kernel:
name: WinKernel
Expand Down Expand Up @@ -201,8 +190,6 @@ jobs:
{ plat: "uwp", tls: "openssl", arg: "-UWP" },
{ plat: "windows", tls: "openssl" },
{ plat: "windows", tls: "schannel" },
{ plat: "windows", tls: "openssl", xdp: "-UseXdp", arg: "-XDP" },
{ plat: "windows", tls: "schannel", xdp: "-UseXdp", arg: "-XDP" },
]
runs-on: windows-2022
steps:
Expand All @@ -211,19 +198,19 @@ jobs:
- name: Download Build Artifacts
uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615
with:
name: Release-${{ matrix.vec.plat }}-windows-2022-x86-${{ matrix.vec.tls }}${{ matrix.vec.xdp }}
name: Release-${{ matrix.vec.plat }}-windows-2022-x86-${{ matrix.vec.tls }}
path: artifacts
if_no_artifact_found: ignore
- name: Download Build Artifacts
uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615
with:
name: Release-${{ matrix.vec.plat }}-windows-2022-x64-${{ matrix.vec.tls }}${{ matrix.vec.xdp }}
name: Release-${{ matrix.vec.plat }}-windows-2022-x64-${{ matrix.vec.tls }}
path: artifacts
if_no_artifact_found: ignore
- name: Download Build Artifacts
uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615
with:
name: Release-${{ matrix.vec.plat }}-windows-2022-arm64-${{ matrix.vec.tls }}${{ matrix.vec.xdp }}
name: Release-${{ matrix.vec.plat }}-windows-2022-arm64-${{ matrix.vec.tls }}
path: artifacts
if_no_artifact_found: ignore
- name: Build Package
Expand All @@ -232,5 +219,5 @@ jobs:
- name: Upload build artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: Nuget-Release-${{ matrix.vec.plat }}-windows-2022-arm64-${{ matrix.vec.tls }}${{ matrix.vec.xdp }}
name: Nuget-Release-${{ matrix.vec.plat }}-windows-2022-arm64-${{ matrix.vec.tls }}
path: artifacts/dist/*.nupkg
2 changes: 1 addition & 1 deletion .github/workflows/cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ jobs:
- name: Cargo test
run: cargo test --all
- name: Cargo Publish (dry run)
run: cargo publish --dry-run
run: cargo publish --dry-run --allow-dirty
Loading

0 comments on commit ae3db5c

Please sign in to comment.