Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions internal/kmmmodule/kmmmodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,11 @@ func (km *kmmModule) setKMMModuleLoader(ctx context.Context, mod *kmmv1beta1.Mod
}

// Use ionic_rdma as the main module (topmost module in the dependency chain)
// KMM's modulesLoadingOrder expects: [topmost module, then what it depends on, etc.]
// Dependency chain: ionic_rdma -> ionic -> pds_core -> tawk_ipc
// For unloading, KMM will reverse this order automatically
// KMM's modulesLoadingOrder expects: [topmost module, then soft deps it needs]
// ionic is a hard kernel dependency of ionic_rdma (handled by depmod/modprobe
// automatically) and must NOT be in modulesLoadingOrder — including it prevents
// KMM from unloading pds_core and tawk_ipc via the softdep reverse chain.
// Only soft dependencies (not tracked by depmod) belong in this list.
moduleName := networkDriverModuleName
var modulesLoadingOrder []string

Expand All @@ -289,13 +291,12 @@ func (km *kmmModule) setKMMModuleLoader(ctx context.Context, mod *kmmv1beta1.Mod
modulesLoadingOrder = mod.Spec.ModuleLoader.Container.Modprobe.ModulesLoadingOrder
kmlog.Info(fmt.Sprintf("Preserving existing modulesLoadingOrder for upgrade: %v", modulesLoadingOrder))
} else {
// New installation: use correct module loading order
// ionic_rdma is the topmost module, followed by its dependencies
// New installation: only list soft dependencies that depmod doesn't know about.
// ionic is omitted because it is a hard kernel dependency of ionic_rdma.
modulesLoadingOrder = []string{
networkDriverModuleName, // ionic_rdma (topmost module)
ionicModuleName, // ionic (ionic_rdma depends on this)
pdsCoreModuleName, // pds_core (ionic depends on this)
tawkIPCModuleName, // tawk_ipc (pds_core depends on this)
pdsCoreModuleName, // pds_core (soft dep)
tawkIPCModuleName, // tawk_ipc (soft dep)
}
kmlog.Info(fmt.Sprintf("Using new modulesLoadingOrder for fresh installation: %v", modulesLoadingOrder))
}
Expand Down
2 changes: 0 additions & 2 deletions internal/kmmmodule/kmmmodule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ var _ = PDescribe("setKMMModuleLoader", func() {
expectedMod.Spec.ModuleLoader.Container.Modprobe.ModuleName = networkDriverModuleName
expectedMod.Spec.ModuleLoader.Container.Modprobe.ModulesLoadingOrder = []string{
networkDriverModuleName,
ionicModuleName,
pdsCoreModuleName,
tawkIPCModuleName,
}
Expand Down Expand Up @@ -410,7 +409,6 @@ var _ = PDescribe("setKMMModuleLoader", func() {
expectedMod.Spec.ModuleLoader.Container.Modprobe.ModuleName = networkDriverModuleName
expectedMod.Spec.ModuleLoader.Container.Modprobe.ModulesLoadingOrder = []string{
networkDriverModuleName,
ionicModuleName,
pdsCoreModuleName,
tawkIPCModuleName,
}
Expand Down
Loading