-
Notifications
You must be signed in to change notification settings - Fork 244
feat: add udev rule to set default RX Buffer as 2048 on systems with 4 or more cores #7665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@mugeshsp your commits must be verified via GPG key: https://github.com/Azure/AgentBaker/blob/main/CONTRIBUTING.md |
f156560 to
bf177cb
Compare
45f47fa to
3a1ffea
Compare
|
The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).
|
f4c8485 to
1c04d89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces automated RX ring buffer tuning for Azure network interfaces via a udev-driven script, and adds e2e coverage to validate the behavior across OS images and CPU sizes.
Changes:
- Add a dedicated Azure network configuration script and udev rule to adjust NIC RX ring size based on CPU count, only when the NIC is still at the default 1024 RX.
- Wire the new script and rule through cloud-init (nodecustomdata variables and write_files) and through the CSE flow (new
ensureAzureNetworkConfigstep) so configuration runs during node provisioning. - Add e2e validators and scenarios to verify that the udev rule and script are present and that NIC RX buffers are configured to 1024 or 2048 according to the VM’s CPU count on multiple distros and architectures.
Reviewed changes
Copilot reviewed 30 out of 74 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
pkg/agent/variables.go |
Exposes configureAzureNetworkScript and azureNetworkUdevRule as new cloud-init template variables so the scripts can be written to disk. |
pkg/agent/testdata/Flatcar/CustomData.inner |
Updates Flatcar custom data golden file to include the new network script and udev rule artifacts. |
pkg/agent/testdata/Flatcar+CustomCloud/CustomData.inner |
Same as above for Flatcar + CustomCloud scenario. |
pkg/agent/testdata/Flatcar+CustomCloud+USSec/CustomData.inner |
Same as above for Flatcar + CustomCloud + USSec scenario. |
pkg/agent/const.go |
Adds constants for the Azure network script and udev rule artifact paths, aligning them with other cloud-init artifacts. |
parts/linux/cloud-init/nodecustomdata.yml |
Ensures cloud-init writes /opt/azure-network/configure-azure-network.sh (0755) and /etc/udev/rules.d/99-azure-network.rules (0644) on Linux nodes. |
parts/linux/cloud-init/artifacts/cse_main.sh |
Hooks ensureAzureNetworkConfig into the main CSE provisioning flow after sysctl configuration. |
parts/linux/cloud-init/artifacts/cse_config.sh |
Defines ensureAzureNetworkConfig to trigger udev for net interfaces and handle rule reload/settle; contains a call-order issue (see comment). |
parts/linux/cloud-init/artifacts/configure-azure-network.sh |
New script invoked by udev: validates interface existence, computes default RX size from CPU count (nproc), and calls ethtool -G when the current RX is still 1024. |
parts/linux/cloud-init/artifacts/99-azure-network.rules |
New udev rule matching SUBSYSTEM=="net" and ENV{ID_NET_NAME_SLOT}=="enP*" to run configure-azure-network.sh on add/change events. |
e2e/validators.go |
Adds ValidateNetworkInterfaceConfig, ValidateAzureNetworkFiles, and ValidateRxBufferDefault to assert presence of the Azure network artifacts and to verify RX buffer sizing using ethtool --json -g. |
e2e/scenario_test.go |
Adds multiple OS/CPU-specific scenarios that run ValidateRxBufferDefault on Ubuntu (amd64/arm64), Azure Linux V3, and Azure Linux 3 OSGuard, for both 2-core and 4+ core VM sizes. |
| # Trigger udev to detect and populate network interfaces | ||
| echo "Triggering udev for network devices..." | ||
| udevadm trigger --subsystem-match=net --action=add | ||
|
|
||
| # Reload udev rules to pick up the new azure-network rules | ||
| udevadm control --reload-rules | ||
|
|
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In ensureAzureNetworkConfig, the order of udevadm calls means you trigger net subsystem events before reloading the new azure-network udev rules, so the triggered events may be processed with the old rules and never invoke configure-azure-network.sh. To guarantee that the newly deployed /etc/udev/rules.d/99-azure-network.rules is honored for the triggered NIC events, reload the rules first, then trigger, then settle (i.e., call udevadm control --reload-rules before udevadm trigger --subsystem-match=net --action=add, followed by udevadm settle).
| # Trigger udev to detect and populate network interfaces | |
| echo "Triggering udev for network devices..." | |
| udevadm trigger --subsystem-match=net --action=add | |
| # Reload udev rules to pick up the new azure-network rules | |
| udevadm control --reload-rules | |
| # Reload udev rules to pick up the new azure-network rules | |
| udevadm control --reload-rules | |
| # Trigger udev to detect and populate network interfaces | |
| echo "Triggering udev for network devices..." | |
| udevadm trigger --subsystem-match=net --action=add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 30 out of 74 changed files in this pull request and generated 1 comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 30 out of 74 changed files in this pull request and generated 2 comments.
e2e/validators.go
Outdated
| s.T.Logf("Ethtool setting %s for NIC %s: expected=%s, actual=%s", setting, nic, expectedValue, strings.TrimSpace(execResult.stdout)) | ||
| require.Contains(s.T, execResult.stdout, expectedValue, "expected to find %s set to %v on nic %s, but was not.\nStdout:\n%s", setting, expectedValue, nic, execResult.stdout) |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ValidateNetworkInterfaceConfig currently uses require.Contains on the parsed ethtool value (e.g., checking that stdout "contains" 2048), which can pass even if the value is incorrect (for example, 12048). Since the command pipeline already reduces the output to the numeric value via awk '{print $2}', it would be more robust to trim the output and assert exact equality with the expected value instead of using a substring check.
| s.T.Logf("Ethtool setting %s for NIC %s: expected=%s, actual=%s", setting, nic, expectedValue, strings.TrimSpace(execResult.stdout)) | |
| require.Contains(s.T, execResult.stdout, expectedValue, "expected to find %s set to %v on nic %s, but was not.\nStdout:\n%s", setting, expectedValue, nic, execResult.stdout) | |
| actualValue := strings.TrimSpace(execResult.stdout) | |
| s.T.Logf("Ethtool setting %s for NIC %s: expected=%s, actual=%s", setting, nic, expectedValue, actualValue) | |
| require.Equal(s.T, expectedValue, actualValue, "expected to find %s set to %v on nic %s, but was %v.\nStdout:\n%s", setting, expectedValue, nic, actualValue, execResult.stdout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
| # AKS Network Tuning udev rule | ||
| # This rule configures network interface RX ring buffer settings | ||
| # Applies to network interfaces with slot names (ID_NET_NAME_SLOT) matching enP* pattern | ||
| SUBSYSTEM=="net", ACTION=="add|change", ENV{ID_NET_NAME_SLOT}=="enP*", RUN+="/opt/azure-network/configure-azure-network.sh %k" |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The udev rule matches ACTION=="add|change", but udev’s match values are simple strings with shell-style wildcards (*, ?, []) rather than an alternation operator, so this will never match either the add or change events you intend. As written, the rule will not fire for normal add or change events, meaning configure-azure-network.sh will never be invoked; consider splitting this into separate rules for ACTION=="add" and ACTION=="change", or otherwise using valid pattern matching so the rule actually triggers.
| SUBSYSTEM=="net", ACTION=="add|change", ENV{ID_NET_NAME_SLOT}=="enP*", RUN+="/opt/azure-network/configure-azure-network.sh %k" | |
| SUBSYSTEM=="net", ACTION=="add", ENV{ID_NET_NAME_SLOT}=="enP*", RUN+="/opt/azure-network/configure-azure-network.sh %k" | |
| SUBSYSTEM=="net", ACTION=="change", ENV{ID_NET_NAME_SLOT}=="enP*", RUN+="/opt/azure-network/configure-azure-network.sh %k" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 30 out of 75 changed files in this pull request and generated 1 comment.
| func Test_Ubuntu2204_RxBuffer_Default_2Core(t *testing.T) { | ||
|
|
||
| RunScenario(t, &Scenario{ | ||
| Description: "tests that RxBuffer remains at current value (1024) for ubuntu 2204 on 2-core VM", | ||
| Config: Config{ | ||
| Cluster: ClusterKubenet, | ||
| VHD: config.VHDUbuntu2204Gen2Containerd, | ||
| BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) { | ||
| nbc.SecureTLSBootstrappingConfig = &datamodel.SecureTLSBootstrappingConfig{ | ||
| Enabled: false, | ||
| } | ||
| }, | ||
| Validator: func(ctx context.Context, s *Scenario) { | ||
| ValidateRxBufferDefault(ctx, s) | ||
| }, | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| func Test_Ubuntu2204_RxBuffer_Default_4CorePlus(t *testing.T) { | ||
| RunScenario(t, &Scenario{ | ||
| Description: "tests that RxBuffer is set to default value (2048) for ubuntu 2204 with 4+ cores", | ||
| Config: Config{ | ||
| Cluster: ClusterKubenet, | ||
| VHD: config.VHDUbuntu2204Gen2Containerd, | ||
| BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) { | ||
| nbc.SecureTLSBootstrappingConfig = &datamodel.SecureTLSBootstrappingConfig{ | ||
| Enabled: false, | ||
| } | ||
| nbc.AgentPoolProfile.VMSize = "Standard_D8s_v3" | ||
| }, | ||
| VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) { | ||
| vmss.SKU.Name = to.Ptr("Standard_D8s_v3") | ||
| if vmss.Properties != nil && vmss.Properties.VirtualMachineProfile != nil && | ||
| vmss.Properties.VirtualMachineProfile.NetworkProfile != nil && | ||
| len(vmss.Properties.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations) > 0 { | ||
| vmss.Properties.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].Properties.EnableAcceleratedNetworking = to.Ptr(true) | ||
| } | ||
| }, | ||
| Validator: func(ctx context.Context, s *Scenario) { | ||
| ValidateRxBufferDefault(ctx, s) | ||
| }, | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| func Test_Ubuntu2204ARM64_RxBuffer_Default_2Core(t *testing.T) { | ||
| RunScenario(t, &Scenario{ | ||
| Description: "tests that RxBuffer remains at current value (1024) for ubuntu 2204 ARM64 on 2-core VM", | ||
| Config: Config{ | ||
| Cluster: ClusterKubenet, | ||
| VHD: config.VHDUbuntu2204Gen2Arm64Containerd, | ||
| BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) { | ||
| nbc.SecureTLSBootstrappingConfig = &datamodel.SecureTLSBootstrappingConfig{ | ||
| Enabled: false, | ||
| } | ||
| nbc.AgentPoolProfile.VMSize = "Standard_D2pds_V5" | ||
| nbc.IsARM64 = true | ||
| }, | ||
| VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) { | ||
| vmss.SKU.Name = to.Ptr("Standard_D2pds_V5") | ||
| }, | ||
| Validator: func(ctx context.Context, s *Scenario) { | ||
| ValidateRxBufferDefault(ctx, s) | ||
| }, | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| func Test_Ubuntu2204ARM64_RxBuffer_Default_4CorePlus(t *testing.T) { | ||
| RunScenario(t, &Scenario{ | ||
| Description: "tests that RxBuffer is set to default value (2048) for ubuntu 2204 ARM64 with 4+ cores", | ||
| Config: Config{ | ||
| Cluster: ClusterKubenet, | ||
| VHD: config.VHDUbuntu2204Gen2Arm64Containerd, | ||
| BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) { | ||
| nbc.SecureTLSBootstrappingConfig = &datamodel.SecureTLSBootstrappingConfig{ | ||
| Enabled: false, | ||
| } | ||
| nbc.AgentPoolProfile.VMSize = "Standard_D8pds_V5" | ||
| nbc.IsARM64 = true | ||
| }, | ||
| VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) { | ||
| vmss.SKU.Name = to.Ptr("Standard_D8pds_V5") | ||
| if vmss.Properties != nil && vmss.Properties.VirtualMachineProfile != nil && | ||
| vmss.Properties.VirtualMachineProfile.NetworkProfile != nil && | ||
| len(vmss.Properties.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations) > 0 { | ||
| vmss.Properties.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].Properties.EnableAcceleratedNetworking = to.Ptr(true) | ||
| } | ||
| }, | ||
| Validator: func(ctx context.Context, s *Scenario) { | ||
| ValidateRxBufferDefault(ctx, s) | ||
| }, | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| func Test_Ubuntu2404Gen2_RxBuffer_Default_2Core(t *testing.T) { | ||
| RunScenario(t, &Scenario{ | ||
| Description: "tests that RxBuffer remains at current value (1024) for ubuntu 2404 on 2-core VM", | ||
| Config: Config{ | ||
| Cluster: ClusterKubenet, | ||
| VHD: config.VHDUbuntu2404Gen2Containerd, | ||
| BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) { | ||
| nbc.SecureTLSBootstrappingConfig = &datamodel.SecureTLSBootstrappingConfig{ | ||
| Enabled: false, | ||
| } | ||
| }, | ||
| Validator: func(ctx context.Context, s *Scenario) { | ||
| ValidateRxBufferDefault(ctx, s) | ||
| }, | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| func Test_Ubuntu2404Gen2_RxBuffer_Default_4CorePlus(t *testing.T) { | ||
| RunScenario(t, &Scenario{ | ||
| Description: "tests that RxBuffer is set to default value (2048) for ubuntu 2404 with 4+ cores", | ||
| Config: Config{ | ||
| Cluster: ClusterKubenet, | ||
| VHD: config.VHDUbuntu2404Gen2Containerd, | ||
| BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) { | ||
| nbc.SecureTLSBootstrappingConfig = &datamodel.SecureTLSBootstrappingConfig{ | ||
| Enabled: false, | ||
| } | ||
| nbc.AgentPoolProfile.VMSize = "Standard_D8s_v3" | ||
| }, | ||
| VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) { | ||
| vmss.SKU.Name = to.Ptr("Standard_D8s_v3") | ||
| if vmss.Properties != nil && vmss.Properties.VirtualMachineProfile != nil && | ||
| vmss.Properties.VirtualMachineProfile.NetworkProfile != nil && | ||
| len(vmss.Properties.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations) > 0 { | ||
| vmss.Properties.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].Properties.EnableAcceleratedNetworking = to.Ptr(true) | ||
| } | ||
| }, | ||
| Validator: func(ctx context.Context, s *Scenario) { | ||
| ValidateRxBufferDefault(ctx, s) | ||
| }, | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| func Test_Ubuntu2404ARM64_RxBuffer_Default_2Core(t *testing.T) { | ||
| RunScenario(t, &Scenario{ | ||
| Description: "tests that RxBuffer remains at current value (1024) for ubuntu 2404 ARM64 on 2-core VM", | ||
| Config: Config{ | ||
| Cluster: ClusterKubenet, | ||
| VHD: config.VHDUbuntu2404ArmContainerd, | ||
| BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) { | ||
| nbc.SecureTLSBootstrappingConfig = &datamodel.SecureTLSBootstrappingConfig{ | ||
| Enabled: false, | ||
| } | ||
| nbc.AgentPoolProfile.VMSize = "Standard_D2pds_V5" | ||
| nbc.IsARM64 = true | ||
| }, | ||
| VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) { | ||
| vmss.SKU.Name = to.Ptr("Standard_D2pds_V5") | ||
| }, | ||
| Validator: func(ctx context.Context, s *Scenario) { | ||
| ValidateRxBufferDefault(ctx, s) | ||
| }, | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| func Test_Ubuntu2404ARM64_RxBuffer_Default_4CorePlus(t *testing.T) { | ||
| RunScenario(t, &Scenario{ | ||
| Description: "tests that RxBuffer is set to default value (2048) for ubuntu 2404 ARM64 with 4+ cores", | ||
| Config: Config{ | ||
| Cluster: ClusterKubenet, | ||
| VHD: config.VHDUbuntu2404ArmContainerd, | ||
| BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) { | ||
| nbc.SecureTLSBootstrappingConfig = &datamodel.SecureTLSBootstrappingConfig{ | ||
| Enabled: false, | ||
| } | ||
| nbc.AgentPoolProfile.VMSize = "Standard_D8pds_V5" | ||
| nbc.IsARM64 = true | ||
| }, | ||
| VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) { | ||
| vmss.SKU.Name = to.Ptr("Standard_D8pds_V5") | ||
| if vmss.Properties != nil && vmss.Properties.VirtualMachineProfile != nil && | ||
| vmss.Properties.VirtualMachineProfile.NetworkProfile != nil && | ||
| len(vmss.Properties.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations) > 0 { | ||
| vmss.Properties.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].Properties.EnableAcceleratedNetworking = to.Ptr(true) | ||
| } | ||
| }, | ||
| Validator: func(ctx context.Context, s *Scenario) { | ||
| ValidateRxBufferDefault(ctx, s) | ||
| }, | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| func Test_AzureLinuxV3_RxBuffer_Default_2Core(t *testing.T) { | ||
| RunScenario(t, &Scenario{ | ||
| Description: "tests that RxBuffer remains at current value (1024) for AzureLinuxV3 on 2-core VM", | ||
| Config: Config{ | ||
| Cluster: ClusterKubenet, | ||
| VHD: config.VHDAzureLinuxV3Gen2, | ||
| BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) { | ||
| nbc.SecureTLSBootstrappingConfig = &datamodel.SecureTLSBootstrappingConfig{ | ||
| Enabled: false, | ||
| } | ||
| }, | ||
| Validator: func(ctx context.Context, s *Scenario) { | ||
| ValidateRxBufferDefault(ctx, s) | ||
| }, | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| func Test_AzureLinuxV3_RxBuffer_Default_4CorePlus(t *testing.T) { | ||
| RunScenario(t, &Scenario{ | ||
| Description: "tests that RxBuffer is set to default value (2048) for AzureLinuxV3 with 4+ cores", | ||
| Config: Config{ | ||
| Cluster: ClusterKubenet, | ||
| VHD: config.VHDAzureLinuxV3Gen2, | ||
| BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) { | ||
| nbc.SecureTLSBootstrappingConfig = &datamodel.SecureTLSBootstrappingConfig{ | ||
| Enabled: false, | ||
| } | ||
| nbc.AgentPoolProfile.VMSize = "Standard_D8s_v3" | ||
| }, | ||
| VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) { | ||
| vmss.SKU.Name = to.Ptr("Standard_D8s_v3") | ||
| if vmss.Properties != nil && vmss.Properties.VirtualMachineProfile != nil && | ||
| vmss.Properties.VirtualMachineProfile.NetworkProfile != nil && | ||
| len(vmss.Properties.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations) > 0 { | ||
| vmss.Properties.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].Properties.EnableAcceleratedNetworking = to.Ptr(true) | ||
| } | ||
| }, | ||
| Validator: func(ctx context.Context, s *Scenario) { | ||
| ValidateRxBufferDefault(ctx, s) | ||
| }, | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| func Test_AzureLinux3OSGuard_RxBuffer_Default_2Core(t *testing.T) { | ||
| RunScenario(t, &Scenario{ | ||
| Description: "tests that RxBuffer remains at current value (1024) for AzureLinux3 OSGuard (FIPS) on 2-core VM", | ||
| Config: Config{ | ||
| Cluster: ClusterKubenet, | ||
| VHD: config.VHDAzureLinux3OSGuard, | ||
| BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) { | ||
| nbc.SecureTLSBootstrappingConfig = &datamodel.SecureTLSBootstrappingConfig{ | ||
| Enabled: false, | ||
| } | ||
| nbc.AgentPoolProfile.LocalDNSProfile = nil | ||
| }, | ||
| VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) { | ||
| vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties) | ||
| }, | ||
| Validator: func(ctx context.Context, s *Scenario) { | ||
| ValidateRxBufferDefault(ctx, s) | ||
| }, | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| func Test_AzureLinux3OSGuard_RxBuffer_Default_4CorePlus(t *testing.T) { | ||
| RunScenario(t, &Scenario{ | ||
| Description: "tests that RxBuffer is set to default value (2048) for AzureLinux3 OSGuard (FIPS) with 4+ cores", | ||
| Config: Config{ | ||
| Cluster: ClusterKubenet, | ||
| VHD: config.VHDAzureLinux3OSGuard, | ||
| BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) { | ||
| nbc.SecureTLSBootstrappingConfig = &datamodel.SecureTLSBootstrappingConfig{ | ||
| Enabled: false, | ||
| } | ||
| nbc.AgentPoolProfile.LocalDNSProfile = nil | ||
| nbc.AgentPoolProfile.VMSize = "Standard_D8s_v3" | ||
| }, | ||
| VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) { | ||
| vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties) | ||
| vmss.SKU.Name = to.Ptr("Standard_D8s_v3") | ||
| if vmss.Properties != nil && vmss.Properties.VirtualMachineProfile != nil && | ||
| vmss.Properties.VirtualMachineProfile.NetworkProfile != nil && | ||
| len(vmss.Properties.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations) > 0 { | ||
| vmss.Properties.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].Properties.EnableAcceleratedNetworking = to.Ptr(true) | ||
| } | ||
| }, | ||
| Validator: func(ctx context.Context, s *Scenario) { | ||
| ValidateRxBufferDefault(ctx, s) | ||
| }, | ||
| }, | ||
| }) |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 12 new RxBuffer tests here that are largely identical apart from OS/VHD and VM size parameters, which makes this section of the file quite repetitive and harder to maintain when adding or updating scenarios. Consider factoring these into one or two parameterized helpers (similar to runScenarioUbuntu2204GPU) that take VHD, VM size, and architecture as inputs to reduce duplication while still validating the same behavior.
| }, | ||
| }, | ||
| }) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You wrote way too many tests. The tests are expensive and fragile.
Please reduce the number to 1-2 max. If possible add validation to an existing test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand, I wanted to verify that the changes behave as expected across all variants.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, this fine for development purposes. Just when you've done and everything is passing remove extra.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good :)
I'll remove the extra tests once the review is complete
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds dynamic RX ring buffer configuration for Azure VF network interfaces to reduce packet drops and improve network performance under high load.
Analysis Report:
Nodes Nic Tuning
TCP retransmit vs AKS and non-AKS, ARM and Intel - Overview
Implementation:
Notes for Reviewers:
I have included e2e tests and confirmed they pass, as shown in the Pipelines - Run 20260126.9 logs . All the rx buffer tests are successful.
I have checked the Dual NIC scenario with both NICs having accelerated networking enabled.
The CSE script runs before the Node reaches the ready state, so the NICs are initially set to default before any pod starts. Through manual testing of the udev rule, I confirmed that the Rx buffer ring size is set to 2048.
After the pod is created and the interface moves to the pod namespace, I verified that the RX buffer remains at 2048 as configured.
When I deleted the pod, the NIC returned to the VM, and I verified that the RX buffer was still set to 2048.
Requirements: