Skip to content

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

Merged
jimmychiuuuu merged 1 commit into
mainfrom
update-device-limit
Jun 6, 2026
Merged

feat: Increase DeviceLimit for TDX and SEV-SNP to 256 and update test#22
jimmychiuuuu merged 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.
  • Passed E2E functional and concurrency tests (successfully deployed 2 unprivileged pods concurrently on a single node, completing 100 iterations of direct hardware attestation IOCTLs for both TDX and SEV-SNP without contention).

@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
@jimmychiuuuu jimmychiuuuu merged commit f3b50f9 into main Jun 6, 2026
11 checks passed
@jimmychiuuuu jimmychiuuuu deleted the update-device-limit branch June 6, 2026 00:23
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.

2 participants