From 4e8b1e2cdf6c0a98ec6e629883dadb2593d67c35 Mon Sep 17 00:00:00 2001 From: Nick Banks Date: Wed, 22 Nov 2023 11:47:01 -0500 Subject: [PATCH 1/5] Submodule XDP --- .gitmodules | 4 ++++ scripts/prepare-machine.ps1 | 37 +++++-------------------------------- src/platform/CMakeLists.txt | 2 +- submodules/xdp-for-windows | 1 + 4 files changed, 11 insertions(+), 33 deletions(-) create mode 160000 submodules/xdp-for-windows diff --git a/.gitmodules b/.gitmodules index 812738da24..a675f72114 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,3 +12,7 @@ [submodule "submodules/clog"] path = submodules/clog url = https://github.com/microsoft/CLOG.git +[submodule "submodules/xdp-for-windows"] + path = submodules/xdp-for-windows + url = https://github.com/microsoft/xdp-for-windows.git + branch = release/1.0 diff --git a/scripts/prepare-machine.ps1 b/scripts/prepare-machine.ps1 index c660f4fb96..06268e61fe 100644 --- a/scripts/prepare-machine.ps1 +++ b/scripts/prepare-machine.ps1 @@ -67,9 +67,6 @@ param ( [Parameter(Mandatory = $false)] [switch]$InstallJom, - [Parameter(Mandatory = $false)] - [switch]$InstallXdpSdk, - [Parameter(Mandatory = $false)] [switch]$UseXdp, @@ -123,7 +120,6 @@ if ($ForBuild) { # enabled for any possible build. $InstallNasm = $true $InstallJom = $true - $InstallXdpSdk = $true $InstallCoreNetCiDeps = $true; # For kernel signing certs } @@ -151,8 +147,6 @@ if ($ForTest) { } if ($InstallXdpDriver) { - # The XDP SDK contains XDP driver, so ensure it's downloaded. - $InstallXdpSdk = $true $InstallSigningCertificates = $true; } @@ -211,26 +205,6 @@ function Install-SigningCertificates { } } -# Downloads the latest version of XDP (for building). -function Install-Xdp-Sdk { - if (!$IsWindows) { return } # Windows only - $XdpPath = Join-Path $ArtifactsPath "xdp" - if ($Force) { - rm -Force -Recurse $XdpPath -ErrorAction Ignore | Out-Null - } - if (!(Test-Path $XdpPath)) { - Write-Host "Downloading XDP kit" - $ZipPath = Join-Path $ArtifactsPath "xdp.zip" - Invoke-WebRequest -Uri (Get-Content (Join-Path $PSScriptRoot "xdp.json") | ConvertFrom-Json).kit -OutFile $ZipPath - Write-Host "Extracting XDP kit" - Expand-Archive -Path $ZipPath -DestinationPath $XdpPath -Force - New-Item -Path "$ArtifactsPath\bin\xdp" -ItemType Directory -Force - Copy-Item -Path "$XdpPath\symbols\*" -Destination "$ArtifactsPath\bin\xdp" -Force - Copy-Item -Path "$XdpPath\bin\*" -Destination "$ArtifactsPath\bin\xdp" -Force - Remove-Item -Path $ZipPath - } -} - # Installs the XDP driver (for testing). # NB: XDP can be uninstalled via Uninstall-Xdp function Install-Xdp-Driver { @@ -250,11 +224,6 @@ function Uninstall-Xdp { Write-Host "Uninstalling XDP driver" try { msiexec.exe /x $MsiPath /quiet | Out-Null } catch {} } - $XdpPath = Join-Path $ArtifactsPath "xdp" - if (Test-Path $XdpPath) { - Write-Host "Deleting XDP kit" - rm -Force -Recurse $XdpPath -ErrorAction Ignore | Out-Null - } } # Installs DuoNic from the CoreNet-CI repo. @@ -478,6 +447,11 @@ if ($ForBuild -or $ForContainerBuild) { Write-Host "Initializing clog submodule" git submodule init submodules/clog + if (!$IsLinux) { + Write-Host "Initializing XDP-for-Windows submodule" + git submodule init submodules/xdp-for-windows + } + if ($Tls -eq "openssl") { Write-Host "Initializing openssl submodule" git submodule init submodules/openssl @@ -499,7 +473,6 @@ if ($ForBuild -or $ForContainerBuild) { if ($InstallCoreNetCiDeps) { Download-CoreNet-Deps } if ($InstallSigningCertificates) { Install-SigningCertificates } if ($InstallDuoNic) { Install-DuoNic } -if ($InstallXdpSdk) { Install-Xdp-Sdk } if ($InstallXdpDriver) { Install-Xdp-Driver } if ($UninstallXdp) { Uninstall-Xdp } if ($InstallNasm) { Install-NASM } diff --git a/src/platform/CMakeLists.txt b/src/platform/CMakeLists.txt index 6912c3c8f4..df09ac53f2 100644 --- a/src/platform/CMakeLists.txt +++ b/src/platform/CMakeLists.txt @@ -73,7 +73,7 @@ if ("${CX_PLATFORM}" STREQUAL "windows") platform PRIVATE ${EXTRA_PLATFORM_INCLUDE_DIRECTORIES} - ${PROJECT_SOURCE_DIR}/artifacts/xdp/include) + ${PROJECT_SOURCE_DIR}/submodules/xdp-for-windows/include/published/external) endif() if (MSVC AND (QUIC_TLS STREQUAL "openssl" OR QUIC_TLS STREQUAL "schannel") AND NOT QUIC_ENABLE_SANITIZERS) diff --git a/submodules/xdp-for-windows b/submodules/xdp-for-windows new file mode 160000 index 0000000000..dfd8b1de3a --- /dev/null +++ b/submodules/xdp-for-windows @@ -0,0 +1 @@ +Subproject commit dfd8b1de3a6a2783554b5e260f2890e6716080bd From 24b355bf92442ef0963467cd6153bba56aa5a280 Mon Sep 17 00:00:00 2001 From: Nick Banks Date: Wed, 22 Nov 2023 12:15:07 -0500 Subject: [PATCH 2/5] Update CMakeLists.txt --- src/platform/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/CMakeLists.txt b/src/platform/CMakeLists.txt index df09ac53f2..588442bf4e 100644 --- a/src/platform/CMakeLists.txt +++ b/src/platform/CMakeLists.txt @@ -73,7 +73,7 @@ if ("${CX_PLATFORM}" STREQUAL "windows") platform PRIVATE ${EXTRA_PLATFORM_INCLUDE_DIRECTORIES} - ${PROJECT_SOURCE_DIR}/submodules/xdp-for-windows/include/published/external) + ${PROJECT_SOURCE_DIR}/submodules/xdp-for-windows/published/external) endif() if (MSVC AND (QUIC_TLS STREQUAL "openssl" OR QUIC_TLS STREQUAL "schannel") AND NOT QUIC_ENABLE_SANITIZERS) From c12062cddb05bfa901162cf9f27bc6c99a268aad Mon Sep 17 00:00:00 2001 From: Nick Banks Date: Wed, 22 Nov 2023 13:33:33 -0500 Subject: [PATCH 3/5] Update azure-pipelines.perf.yml --- .azure/azure-pipelines.perf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/azure-pipelines.perf.yml b/.azure/azure-pipelines.perf.yml index 28496cee50..b0b8e22787 100644 --- a/.azure/azure-pipelines.perf.yml +++ b/.azure/azure-pipelines.perf.yml @@ -171,7 +171,7 @@ stages: arch: ${{ parameters.arch }} tls: schannel config: Release - extraPrepareArgs: -DisableTest -InstallXdpSdk + extraPrepareArgs: -DisableTest ${{ if eq(parameters.pgo_mode, false) }}: extraBuildArgs: -DisableTest -DisableTools ${{ if eq(parameters.pgo_mode, true) }}: From dfba295e05d25488ec6e17648e68d77c8d30f0e8 Mon Sep 17 00:00:00 2001 From: Nick Banks Date: Wed, 22 Nov 2023 15:11:32 -0500 Subject: [PATCH 4/5] Fix Cargo includes for XDP --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 7fbb7fd74d..b1bc623c5f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,6 +32,7 @@ include = [ "/submodules/openssl/ssl", "/submodules/openssl/util", "/submodules/openssl/VMS", + "/submodules/xdp-for-windows", "/scripts/build.rs", "/src/*.rs", "/src/bin", @@ -40,7 +41,6 @@ include = [ "/src/generated", "/src/manifest", "/src/platform", - "/artifacts/xdp/include", "/THIRD-PARTY-NOTICES", ] From 58aa742a6fa19e8fef776b9a3237a686e7dbdd01 Mon Sep 17 00:00:00 2001 From: Nick Banks Date: Wed, 22 Nov 2023 15:14:10 -0500 Subject: [PATCH 5/5] A few more --- Cargo.toml | 2 +- scripts/xdp.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b1bc623c5f..25152cfe64 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ include = [ "/submodules/openssl/ssl", "/submodules/openssl/util", "/submodules/openssl/VMS", - "/submodules/xdp-for-windows", + "/submodules/xdp-for-windows/published/external", "/scripts/build.rs", "/src/*.rs", "/src/bin", diff --git a/scripts/xdp.json b/scripts/xdp.json index b79346faf3..f338eea097 100644 --- a/scripts/xdp.json +++ b/scripts/xdp.json @@ -1,4 +1,3 @@ { - "kit" : "https://github.com/microsoft/xdp-for-windows/releases/download/v1.0.0/xdp-devkit-x64-1.0.0.zip", "installer": "https://github.com/microsoft/xdp-for-windows/releases/download/v1.0.0/xdp-for-windows.1.0.0.msi" }