spdkenv

package
v0.0.0-...-2e1dda9 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: NIST-PD-fallback Imports: 20 Imported by: 0

Documentation

Overview

Package spdkenv contains bindings of SPDK environment and threads.

Index

Constants

This section is empty.

Variables

Version is SPDK version.

Functions

func CaptureJSON

func CaptureJSON(f func(w unsafe.Pointer), ptr any) (e error)

CaptureJSON invokes a function that writes to *C.struct_spdk_json_write_ctx, and unmarshals what's been written.

func InitEnv

func InitEnv() error

InitEnv initializes the SPDK environment.

func InitFinal

func InitFinal() (e error)

InitFinal finishes initializing SPDK.

func InitMainThread

func InitMainThread(ret chan<- any)

InitMainThread creates a main thread, and launches on the current goroutine. This must be invoked on the MainLCore. This function never returns; either the main thread (*Thread) or an error is sent to `ret`.

func JSONObject

func JSONObject(f func(w unsafe.Pointer)) func(w unsafe.Pointer)

JSONObject can be used with CaptureJSON to wrap the output in a JSON object.

func RPC

func RPC(method string, args, reply any) (e error)

RPC calls a method on SPDK RPC server.

Types

type Thread

type Thread struct {
	ealthread.ThreadWithCtrl

	RcuReadSide *urcu.ReadSide
	// contains filtered or unexported fields
}

Thread represents an SPDK thread.

func NewThread

func NewThread() (*Thread, error)

NewThread creates an SPDK thread. The caller needs to assign it a DPDK lcore and launch it.

func (*Thread) Close

func (th *Thread) Close() error

Close stops the thread and deallocates data structures.

func (*Thread) Post

func (th *Thread) Post(fn cptr.Function)

Post asynchronously posts a function to be run on the SPDK thread.

func (*Thread) Ptr

func (th *Thread) Ptr() unsafe.Pointer

Ptr return *C.struct_spdk_thread pointer.

func (*Thread) ThreadRole

func (th *Thread) ThreadRole() string

ThreadRole returns "SPDK" used in lcore allocator.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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