Skip to content

Commit efbe1df

Browse files
authored
Update ebpf to 0.17, Update vc_redist version in scripts (#564)
* update ebpf to 0.17 * update headers * remove deleted batch param args * update scripts * add debug log * debug log * fix * update to vc_redist v17
1 parent d536bb2 commit efbe1df

File tree

6 files changed

+26
-43
lines changed

6 files changed

+26
-43
lines changed

src/xdp.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<XdpMinorVersion>1</XdpMinorVersion>
66
<XdpPatchVersion>0</XdpPatchVersion>
77
<!-- Project-wide properties -->
8-
<EbpfPackagePath>$(SolutionDir)packages\eBPF-for-Windows.0.15.1\</EbpfPackagePath>
8+
<EbpfPackagePath>$(SolutionDir)packages\eBPF-for-Windows.0.17.0\</EbpfPackagePath>
99
<WiXPackagePath>$(SolutionDir)packages\wix.3.14.1\</WiXPackagePath>
1010
<FnPackagePath>$(SolutionDir)artifacts\fn\devkit-0.4.4\</FnPackagePath>
1111
</PropertyGroup>

src/xdp/ebpfstore.h

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ static const ebpf_context_descriptor_t EbpfXdpContextDescriptor = {
2424
// XDP helper function prototype descriptors.
2525
static const ebpf_helper_function_prototype_t EbpfXdpHelperFunctionPrototype[] = {
2626
{
27-
.header = {
28-
.version = EBPF_HELPER_FUNCTION_PROTOTYPE_CURRENT_VERSION,
29-
.size = EBPF_HELPER_FUNCTION_PROTOTYPE_CURRENT_VERSION_SIZE
30-
},
27+
.header = EBPF_HELPER_FUNCTION_PROTOTYPE_HEADER,
3128
.helper_id = XDP_EXT_HELPER_FUNCTION_START + 1,
3229
.name = "bpf_xdp_adjust_head",
3330
.return_type = EBPF_RETURN_TYPE_INTEGER,
@@ -39,28 +36,22 @@ static const ebpf_helper_function_prototype_t EbpfXdpHelperFunctionPrototype[] =
3936
};
4037

4138
static const ebpf_program_type_descriptor_t EbpfXdpProgramTypeDescriptor = {
42-
.header = {
43-
.version = EBPF_PROGRAM_TYPE_DESCRIPTOR_CURRENT_VERSION,
44-
.size = EBPF_PROGRAM_TYPE_DESCRIPTOR_CURRENT_VERSION_SIZE
45-
},
39+
.header = EBPF_PROGRAM_TYPE_DESCRIPTOR_HEADER,
4640
.name = "xdp",
4741
.context_descriptor = &EbpfXdpContextDescriptor,
4842
.program_type = EBPF_PROGRAM_TYPE_XDP_INIT,
4943
.bpf_prog_type = BPF_PROG_TYPE_XDP
5044
};
5145

5246
const ebpf_program_info_t EbpfXdpProgramInfo = {
53-
.header = {
54-
.version = EBPF_PROGRAM_INFORMATION_CURRENT_VERSION,
55-
.size = EBPF_PROGRAM_INFORMATION_CURRENT_VERSION_SIZE
56-
},
47+
.header = EBPF_PROGRAM_INFORMATION_HEADER,
5748
.program_type_descriptor = &EbpfXdpProgramTypeDescriptor,
5849
.count_of_program_type_specific_helpers = RTL_NUMBER_OF(EbpfXdpHelperFunctionPrototype),
5950
.program_type_specific_helper_prototype = EbpfXdpHelperFunctionPrototype,
6051
};
6152

6253
#define DECLARE_XDP_SECTION(_section_name) \
63-
{ EBPF_PROGRAM_SECTION_INFORMATION_CURRENT_VERSION, EBPF_PROGRAM_SECTION_INFORMATION_CURRENT_VERSION_SIZE }, \
54+
EBPF_PROGRAM_SECTION_INFORMATION_HEADER, \
6455
(const wchar_t*)_section_name, &EBPF_PROGRAM_TYPE_XDP, &EBPF_ATTACH_TYPE_XDP, \
6556
BPF_PROG_TYPE_XDP, BPF_XDP
6657

src/xdp/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="eBPF-for-Windows" version="0.15.1" targetFramework="native" developmentDependency="true" />
3+
<package id="eBPF-for-Windows" version="0.17.0" targetFramework="native" developmentDependency="true" />
44
<package id="Microsoft.Build.Tasks.Git" version="1.0.0" targetFramework="native" developmentDependency="true" />
55
<package id="Microsoft.SourceLink.AzureRepos.Git" version="1.0.0" targetFramework="native" developmentDependency="true" />
66
<package id="Microsoft.SourceLink.Common" version="1.0.0" targetFramework="native" developmentDependency="true" />

src/xdp/program.c

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -320,21 +320,16 @@ XdpInspectEbpfStartBatch(
320320
)
321321
{
322322
const EBPF_EXTENSION_CLIENT *Client;
323-
const VOID *ClientBindingContext;
324323
ebpf_result_t EbpfResult;
325324

326325
ASSERT(XdpProgramIsEbpf(Program));
327326

328327
Client = (const EBPF_EXTENSION_CLIENT *)Program->Rules[0].Ebpf.Target;
329-
ClientBindingContext = EbpfExtensionClientGetClientContext(Client);
330328

331329
ebpf_program_batch_begin_invoke_function_t EbpfBatchBegin =
332330
EbpfExtensionClientGetProgramDispatch(Client)->ebpf_program_batch_begin_invoke_function;
333331

334-
EbpfResult =
335-
EbpfBatchBegin(
336-
ClientBindingContext, sizeof(InspectionContext->EbpfContext),
337-
&InspectionContext->EbpfContext);
332+
EbpfResult = EbpfBatchBegin(sizeof(InspectionContext->EbpfContext), &InspectionContext->EbpfContext);
338333

339334
return EbpfResult == EBPF_SUCCESS;
340335
}
@@ -347,18 +342,16 @@ XdpInspectEbpfEndBatch(
347342
)
348343
{
349344
const EBPF_EXTENSION_CLIENT *Client;
350-
const VOID *ClientBindingContext;
351345
ebpf_result_t EbpfResult;
352346

353347
ASSERT(XdpProgramIsEbpf(Program));
354348

355349
Client = (const EBPF_EXTENSION_CLIENT *)Program->Rules[0].Ebpf.Target;
356-
ClientBindingContext = EbpfExtensionClientGetClientContext(Client);
357350

358351
ebpf_program_batch_end_invoke_function_t EbpfBatchEnd =
359352
EbpfExtensionClientGetProgramDispatch(Client)->ebpf_program_batch_end_invoke_function;
360353

361-
EbpfResult = EbpfBatchEnd(ClientBindingContext, &InspectionContext->EbpfContext);
354+
EbpfResult = EbpfBatchEnd(&InspectionContext->EbpfContext);
362355

363356
ASSERT(EbpfResult == EBPF_SUCCESS);
364357
}
@@ -648,19 +641,13 @@ static const VOID *EbpfXdpHelperFunctions[] = {
648641
};
649642

650643
static const ebpf_helper_function_addresses_t XdpHelperFunctionAddresses = {
651-
.header = {
652-
.version = EBPF_HELPER_FUNCTION_ADDRESSES_CURRENT_VERSION,
653-
.size = EBPF_HELPER_FUNCTION_ADDRESSES_CURRENT_VERSION_SIZE
654-
},
644+
.header = EBPF_HELPER_FUNCTION_ADDRESSES_HEADER,
655645
.helper_function_count = RTL_NUMBER_OF(EbpfXdpHelperFunctions),
656646
.helper_function_address = (UINT64 *)EbpfXdpHelperFunctions
657647
};
658648

659649
static const ebpf_program_data_t EbpfXdpProgramData = {
660-
.header = {
661-
.version = EBPF_PROGRAM_DATA_CURRENT_VERSION,
662-
.size = EBPF_PROGRAM_DATA_CURRENT_VERSION_SIZE
663-
},
650+
.header = EBPF_PROGRAM_DATA_HEADER,
664651
.program_info = &EbpfXdpProgramInfo,
665652
.program_type_specific_helper_function_addresses = &XdpHelperFunctionAddresses,
666653
.context_create = XdpCreateContext,
@@ -675,10 +662,7 @@ static const NPI_MODULEID EbpfXdpProgramInfoProviderModuleId = {
675662
};
676663

677664
static const ebpf_attach_provider_data_t EbpfXdpHookAttachProviderData = {
678-
.header = {
679-
.version = EBPF_ATTACH_PROVIDER_DATA_CURRENT_VERSION ,
680-
.size = EBPF_ATTACH_PROVIDER_DATA_CURRENT_VERSION_SIZE
681-
},
665+
.header = EBPF_ATTACH_PROVIDER_DATA_HEADER,
682666
.supported_program_type = EBPF_PROGRAM_TYPE_XDP_INIT,
683667
.bpf_attach_type = BPF_XDP,
684668
.link_type = BPF_LINK_TYPE_XDP,

tools/common.ps1

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function Get-EbpfInstallPath {
109109
}
110110

111111
function Get-EbpfMsiVersion {
112-
return "0.15.1"
112+
return "0.17.0"
113113
}
114114

115115
# Returns the eBPF package type.
@@ -124,10 +124,18 @@ function Get-EbpfPackageType {
124124
# Return the eBPF package name.
125125
function Get-EbpfPackageName {
126126
if ($UseJitEbpf) {
127-
return "Build-x64-Release.zip"
127+
return "Build-x64.Release.zip"
128128
}
129129

130-
return "Build-x64-native-only-NativeOnlyRelease.zip"
130+
return "Build-x64-native-only.NativeOnlyRelease.zip"
131+
}
132+
133+
function Get-EbpfDirectoryName {
134+
if ($UseJitEbpf) {
135+
return "Build-x64 Release"
136+
}
137+
138+
return "Build-x64-native-only NativeOnlyRelease"
131139
}
132140

133141
# Returns the eBPF MSI full path

tools/prepare-machine.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@ function Extract-Ebpf-Msi {
118118
$EbpfPackageFullPath = "$ArtifactsDir\ebpf.zip"
119119
$EbpfMsiFullPath = Get-EbpfMsiFullPath
120120
$EbpfMsiDir = Split-Path $EbpfMsiFullPath
121-
$EbpfPackageType = Get-EbpfPackageType
121+
$EbpfDirectoryName = Get-EbpfDirectoryName
122122

123123
Write-Debug "Extracting eBPF MSI from Release package"
124124

125125
# Extract the MSI from the package.
126126
pushd $ArtifactsDir
127+
dir
127128
Expand-Archive -Path $EbpfPackageFullPath -Force
128-
Expand-Archive -Path "$ArtifactsDir\ebpf\build-$EbpfPackageType.zip" -Force
129-
xcopy "$ArtifactsDir\build-$EbpfPackageType\$EbpfPackageType\ebpf-for-windows.msi" /F /Y $EbpfMsiDir
129+
xcopy "$ArtifactsDir\ebpf\$EbpfDirectoryName\ebpf-for-windows.msi" /F /Y $EbpfMsiDir
130130
popd
131131
}
132132

@@ -233,7 +233,7 @@ function Setup-VcRuntime {
233233
Remove-Item -Force "$ArtifactsDir\vc_redist.x64.exe" -ErrorAction Ignore
234234

235235
# Download and install.
236-
Invoke-WebRequest-WithRetry -Uri "https://aka.ms/vs/16/release/vc_redist.x64.exe" -OutFile "$ArtifactsDir\vc_redist.x64.exe"
236+
Invoke-WebRequest-WithRetry -Uri "https://aka.ms/vs/17/release/vc_redist.x64.exe" -OutFile "$ArtifactsDir\vc_redist.x64.exe"
237237
& $ArtifactsDir\vc_redist.x64.exe /install /passive | Write-Verbose
238238
}
239239
}

0 commit comments

Comments
 (0)