rdmamode

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package rdmamode resolves which RDMA paths a gateway runs and orders their shutdown. It is deliberately free of cgo so the behavior is testable on any build platform.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mode

func Mode(rdmaIP string, rcEnable bool) (v1, v2 bool)

Mode resolves which RDMA paths run: the cuObject v1 backend follows the legacy --rdma-ip contract, and the hipobj-rc-v2 control routes follow --rdma-rc-enable. Neither flag implies the other.

func V1ValidationError

func V1ValidationError(s V1Settings) string

V1ValidationError describes the first invalid v1 setting, or the empty string when every setting is valid. Stale v1 values in the environment must not block v2-only or plain-S3 startup, so the gateway consults this only when v1 is on.

func V2ValidationError added in v1.9.0

func V2ValidationError(s V2Settings) string

V2ValidationError describes the first invalid v2 setting, or the empty string when every setting is valid. Stale v2 values in the environment must not block v1-only or plain-S3 startup, so the gateway consults this only when v2 is on.

func WrapBackendShutdownAfterRC

func WrapBackendShutdownAfterRC(be backend.Backend, rc Closer) backend.Backend

WrapBackendShutdownAfterRC returns be with a Shutdown that closes rc first.

func WrapShutdownOnce

func WrapShutdownOnce(be backend.Backend) backend.Backend

WrapShutdownOnce returns be with an idempotent Shutdown.

Types

type BackendShutdownAfterRC

type BackendShutdownAfterRC struct {
	backend.Backend
	// contains filtered or unexported fields
}

BackendShutdownAfterRC forwards a backend and closes the RC service before the wrapped backend shuts down. The RC handlers reference the backend and IAM service, so the RC service must stop accepting and drain before either dependency is closed by the gateway lifecycle. The whole shutdown, including the delegated backend call, runs exactly once: several closers (the gateway lifecycle and a deferred rollback in the startup path) may call Shutdown on the same instance, and the wrapped backends are not guaranteed to be idempotent.

func (*BackendShutdownAfterRC) SetOpsDrainer added in v1.9.0

func (b *BackendShutdownAfterRC) SetOpsDrainer(d OpsDrainer)

SetOpsDrainer installs the operational publication drainer. The route handler that owns the publications is built after this wrapper (it needs the wrapped backend), so the drainer arrives via this setter; installs after Shutdown ran are dropped, since the drain window has passed.

func (*BackendShutdownAfterRC) Shutdown

func (b *BackendShutdownAfterRC) Shutdown()

Shutdown closes the RC service, drains operational publications, then shuts the wrapped backend down, once. The drain runs AFTER the RC close: closing RC quiesces the native reaper (every teardown callback has returned by the time Close returns), so no producer can enqueue behind the drain - enqueue-then-worker-exit stranding is impossible by ordering rather than by locking.

type Closer

type Closer interface{ Close() }

Closer is the close operation of the RC session service. It is idempotent.

type OpsDrainer added in v1.9.0

type OpsDrainer interface{ Shutdown() }

OpsDrainer drains operational publications (audit records, events) that the RC teardown path queued before the RC service closes, so nothing is left waiting on sinks that are about to close. It is idempotent.

type ShutdownOnceBackend

type ShutdownOnceBackend struct {
	backend.Backend
	// contains filtered or unexported fields
}

ShutdownOnceBackend makes a backend Shutdown idempotent. The gateway startup path defers a rollback close while the gateway lifecycle also shuts its backend down; a bare backend has no idempotency guarantee of its own.

func (*ShutdownOnceBackend) Shutdown

func (b *ShutdownOnceBackend) Shutdown()

Shutdown closes the wrapped backend at most once.

type V1Settings

type V1Settings struct {
	Port        uint
	RetryCount  uint
	PoolBufSize int
	PoolBufCnt  int
	TunablesSet bool
	NumDCIs     int
	CQDepth     uint
}

V1Settings carries the cuObject v1 tunings that are validated only while the v1 backend runs.

type V2Settings added in v1.9.0

type V2Settings struct {
	MaxSessions         uint64
	MaxUserSessions     uint64
	MaxStagingBytes     uint64
	MaxUserStagingBytes uint64
	MaxQPs              uint64
	MaxUserQPs          uint64
	MaxReadySlots       uint64
	TPrepMs             uint64
	TExecMs             uint64
}

V2Settings carries the hipobj-rc-v2 tunings that are validated only while the RC data plane runs. Counts arrive as uint64 from the CLI and narrow to uint32 at the DeviceOpts boundary, so the range is checked before the narrowing cast. Timeouts feed deadline arithmetic (nowMs + timeout), so an upper bound keeps the sum from wrapping.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL