Skip to content

feat: Increase DeviceLimit for TDX and SEV-SNP to 256 and update test#22

Open
jimmychiuuuu wants to merge 1 commit into
mainfrom
update-device-limit
Open

feat: Increase DeviceLimit for TDX and SEV-SNP to 256 and update test#22
jimmychiuuuu wants to merge 1 commit into
mainfrom
update-device-limit

Conversation

@jimmychiuuuu
Copy link
Copy Markdown
Collaborator

@jimmychiuuuu jimmychiuuuu commented May 29, 2026

Summary

This PR increases the DeviceLimit for intel.com/tdx and amd.com/sev-snp from 1 to 256, updates the unit tests, and upgrades the Go workspace version.

Motivation

The previous limit of 1 enforced node-level exclusivity, which blocked scheduling when multiple confidential workloads needed these devices on the same node. Since the Linux kernel supports concurrent access, we are aligning the limit with vTPM to support modern cloud-native patterns.

Changes

  • main.go: Updated DeviceLimit to workloadSharedLimit (256) for TDX and SEV-SNP.
  • deviceplugin/plugin.go: Fixed a potential resource leak where the UNIX listener and gRPC server could remain dangling if the context was cancelled before the service became ready.
  • go.mod: Upgraded Go version to 1.26 to match the Dockerfile's build environment.
  • deviceplugin/ccdevice_test.go:
    • Updated unit tests to validate the increased limits.
    • Added TestAllocateHardware to verify hardware allocation does not include vTPM mounts.
    • Added TestDiscoverMultiPaths to verify device fallback glob matching.

Test

Ran go test ./... and all tests passed successfully.

@jimmychiuuuu jimmychiuuuu force-pushed the update-device-limit branch 3 times, most recently from 26a4929 to 6869bdd Compare June 2, 2026 17:50
@jimmychiuuuu jimmychiuuuu force-pushed the update-device-limit branch from 6869bdd to 335abf6 Compare June 2, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant