hostclient

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package hostclient implements the client side of the cuObject RDMA DC protocol using libibverbs + mlx5 direct verbs, with no CUDA/GPU dependency.

It is the host-memory counterpart to the GPU-based NVIDIA libcuobjclient: it registers host memory, exposes a passive DC target the gateway can RDMA READ/WRITE, and produces the RDMA descriptor token the gateway expects in the S3 request headers.

Index

Constants

View Source
const DefaultDCKey uint64 = 0xffeeddcc

DefaultDCKey is the cuObjServer default Dynamic Connection key. The client DC target must use a key matching the server's DCKey tunable.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client owns a passive DC target endpoint and a single registered host buffer. A Client is not safe for concurrent use.

func NewClient

func NewClient(dev string, port uint8, gidIndex int, dcKey uint64) (*Client, error)

NewClient opens the RDMA device and builds the DC target endpoint. dev selects the device by name (e.g. "mlx5_0"); empty picks the first. port is the HCA port (usually 1). gidIndex selects the RoCE GID (see `ibv_devinfo -v`). dcKey must match the server's DCKey (DefaultDCKey by default).

func (*Client) Buffer

func (c *Client) Buffer() []byte

Buffer returns the current registered buffer as a Go slice, or nil.

func (*Client) BufferAddr

func (c *Client) BufferAddr() uint64

BufferAddr returns the virtual address of the registered buffer. This is the remote base address the gateway uses as the RDMA start offset; it matches the address encoded in Token.

func (*Client) Close

func (c *Client) Close()

Close releases the buffer and tears down the endpoint.

func (*Client) Register

func (c *Client) Register(size int) ([]byte, error)

Register allocates and registers a host buffer of the given size and returns a Go slice backed by it. The slice is valid until the next Register call or Close. Copy PUT data into the slice before the transfer; read GET data out of it afterward.

func (*Client) Token

func (c *Client) Token() (string, error)

Token returns the RDMA descriptor token for the currently registered buffer. See cumiddleware.HeaderRDMAToken for the canonical wire-format field table.

Jump to

Keyboard shortcuts

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