Skip to content

Commit

Permalink
Submodule XDP (#3967)
Browse files Browse the repository at this point in the history
  • Loading branch information
nibanks committed Nov 27, 2023
1 parent 83cd61e commit 67ce5af
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .azure/azure-pipelines.perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}:
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ include = [
"/submodules/openssl/ssl",
"/submodules/openssl/util",
"/submodules/openssl/VMS",
"/submodules/xdp-for-windows/published/external",
"/scripts/build.rs",
"/src/*.rs",
"/src/bin",
Expand All @@ -40,7 +41,6 @@ include = [
"/src/generated",
"/src/manifest",
"/src/platform",
"/artifacts/xdp/include",
"/THIRD-PARTY-NOTICES",
]

Expand Down
37 changes: 5 additions & 32 deletions scripts/prepare-machine.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ param (
[Parameter(Mandatory = $false)]
[switch]$InstallJom,

[Parameter(Mandatory = $false)]
[switch]$InstallXdpSdk,

[Parameter(Mandatory = $false)]
[switch]$UseXdp,

Expand Down Expand Up @@ -123,7 +120,6 @@ if ($ForBuild) {
# enabled for any possible build.
$InstallNasm = $true
$InstallJom = $true
$InstallXdpSdk = $true
$InstallCoreNetCiDeps = $true; # For kernel signing certs
}

Expand Down Expand Up @@ -151,8 +147,6 @@ if ($ForTest) {
}

if ($InstallXdpDriver) {
# The XDP SDK contains XDP driver, so ensure it's downloaded.
$InstallXdpSdk = $true
$InstallSigningCertificates = $true;
}

Expand Down Expand Up @@ -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 {
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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 }
Expand Down
1 change: 0 additions & 1 deletion scripts/xdp.json
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 1 addition & 1 deletion src/platform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/published/external)
endif()

if (MSVC AND (QUIC_TLS STREQUAL "openssl" OR QUIC_TLS STREQUAL "schannel") AND NOT QUIC_ENABLE_SANITIZERS)
Expand Down
1 change: 1 addition & 0 deletions submodules/xdp-for-windows
Submodule xdp-for-windows added at dfd8b1

0 comments on commit 67ce5af

Please sign in to comment.