ring

package
v0.0.0-...-8fa78e2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SingleConsumer specifies that default dequeue operation will exhibit 'single-consumer' behaviour.
	SingleConsumer uint = C.RING_F_SC_DEQ
	// SingleProducer specifies that default enqueue operation will exhibit 'single-producer' behaviour.
	SingleProducer = C.RING_F_SP_ENQ
	// ExactSize specifies how to handle ring size during Create/Init. Ring is to hold exactly requested number of
	// entries. Without this flag set, the ring size requested must be a power of 2, and the usable space will be that
	// size - 1. With the flag, the requested size will be rounded up to the next power of two, but the usable space will
	// be exactly that requested. Worst case, if a power-of-2 size is requested, half the ring space will be wasted.
	ExactSize = C.RING_F_EXACT_SZ
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params struct {
	Size     uint
	NumaNode uint32
}

type Ring

type Ring struct {
	*device.Device
	// contains filtered or unexported fields
}

Ring represents a Ring device

func Lookup

func Lookup(name string, clean func()) (*Ring, error)

Lookup searches a ring from its name in RTE_TAILQ_RING, i.e. among those created with rte_ring_create. Returns a partly initialized ring object

func (*Ring) BindToPipelineInputPort

func (r *Ring) BindToPipelineInputPort(pl *pipeline.Pipeline, portID int, rxq uint16, bsz uint) error

bind to given pipeline input port index. A ring has 1 queue so only queue number 0 is valid.

func (*Ring) BindToPipelineOutputPort

func (r *Ring) BindToPipelineOutputPort(pl *pipeline.Pipeline, portID int, txq uint16, bsz uint) error

bind to given pipeline output port index. A ring has 1 queue so only queue number 0 is valid.

func (*Ring) Free

func (r *Ring) Free() error

Free deletes the current Ring record and calls the clean callback function given at init

func (*Ring) Init

func (r *Ring) Init(name string, params *Params, clean func()) error

Create and initialize Ring device

func (*Ring) Ring

func (r *Ring) Ring() unsafe.Pointer

func (*Ring) Size

func (r *Ring) Size() uint

type SwxPortRingParams

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

func (*SwxPortRingParams) FreeParams

func (e *SwxPortRingParams) FreeParams()

func (*SwxPortRingParams) GetReaderParams

func (e *SwxPortRingParams) GetReaderParams() unsafe.Pointer

func (*SwxPortRingParams) GetWriterParams

func (e *SwxPortRingParams) GetWriterParams() unsafe.Pointer

func (*SwxPortRingParams) PortName

func (e *SwxPortRingParams) PortName() string

func (*SwxPortRingParams) PortType

func (e *SwxPortRingParams) PortType() string

Jump to

Keyboard shortcuts

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