Skip to content

Commit 447ff50

Browse files
committed
Add support for nvswitch mode to nvcdi API
Signed-off-by: Evan Lezar <[email protected]>
1 parent 6412bca commit 447ff50

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pkg/nvcdi/gated.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ func (l *gatedlib) getModeDiscoverer() (discover.Discover, error) {
6161
return discover.NewGDSDiscoverer(l.logger, l.driverRoot, l.devRoot)
6262
case ModeMofed:
6363
return discover.NewMOFEDDiscoverer(l.logger, l.driverRoot)
64+
case ModeNvswitch:
65+
return discover.NewNvSwitchDiscoverer(l.logger, l.devRoot)
6466
default:
6567
return nil, fmt.Errorf("unrecognized mode")
6668
}

pkg/nvcdi/mode.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ const (
4242
// ModeCSV configures the CDI spec generator to generate a spec based on the contents of CSV
4343
// mountspec files.
4444
ModeCSV = Mode("csv")
45-
// ModeImex configures the CDI spec generated to generate a spec for the available IMEX channels.
45+
// ModeImex configures the CDI spec generator to generate a spec for the available IMEX channels.
4646
ModeImex = Mode("imex")
47+
// ModeNvswitch configures the CDI spec generator to generate a spec for the available nvswitch devices.
48+
ModeNvswitch = Mode("nvswitch")
4749
)
4850

4951
type modeConstraint interface {
@@ -69,6 +71,7 @@ func getModes() modes {
6971
ModeManagement,
7072
ModeMofed,
7173
ModeNvml,
74+
ModeNvswitch,
7275
ModeWsl,
7376
}
7477
lookup := make(map[Mode]bool)

0 commit comments

Comments
 (0)