cryptodev

package
v0.0.0-...-6c4fd92 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: NIST-PD-fallback Imports: 9 Imported by: 0

Documentation

Overview

Package cryptodev contains bindings of DPDK crypto device.

Index

Constants

OpStatus values.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxSessions       int
	NQueuePairs       int
	NQueueDescriptors int
}

Config contains CryptoDev configuration.

type CryptoDev

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

CryptoDev represents a crypto device.

func CreateVDev

func CreateVDev(cfg VDevConfig) (cd *CryptoDev, e error)

CreateVDev creates a virtual crypto device.

func New

func New(dev device, cfg Config) (cd *CryptoDev, e error)

New initializes a crypto device.

func (*CryptoDev) Close

func (cd *CryptoDev) Close() error

Close releases a crypto device.

func (*CryptoDev) ID

func (cd *CryptoDev) ID() int

ID returns crypto device ID.

func (*CryptoDev) Name

func (cd *CryptoDev) Name() string

Name returns crypto device name.

func (*CryptoDev) QueuePairs

func (cd *CryptoDev) QueuePairs() []*QueuePair

QueuePairs returns a list of queue pair.

type Op

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

Op represents a crypto operation.

func (*Op) Error

func (op *Op) Error() error

Error returns an error if this operation has failed, otherwise returns nil.

func (*Op) Ptr

func (op *Op) Ptr() unsafe.Pointer

Ptr returns *C.struct_rte_crypto_op pointer.

func (*Op) Status

func (op *Op) Status() OpStatus

Status returns operation status.

type OpStatus

OpStatus indicates crypto operation status.

type OpVector

type OpVector []*Op

OpVector represents a vector of crypto operations.

type QueuePair

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

QueuePair represents a crypto device queue pair.

func (*QueuePair) CopyToC

func (qp *QueuePair) CopyToC(ptr unsafe.Pointer)

CopyToC copies settings to *C.CryptoQueuePair struct.

func (*QueuePair) DequeueBurst

func (qp *QueuePair) DequeueBurst(ops OpVector) int

DequeueBurst retrieves a burst of completed crypto operations.

func (*QueuePair) Dev

func (qp *QueuePair) Dev() *CryptoDev

Dev returns the CryptoDev.

func (*QueuePair) EnqueueBurst

func (qp *QueuePair) EnqueueBurst(ops OpVector) int

EnqueueBurst submits a burst of crypto operations.

func (*QueuePair) ID

func (qp *QueuePair) ID() int

ID returns queue pair ID.

func (*QueuePair) PrepareSha256

func (qp *QueuePair) PrepareSha256(op *Op, m *pktmbuf.Packet, offset, length int, output unsafe.Pointer)

PrepareSha256 prepares a SHA256 digest generation operation.

m[offset:offset+length] is the input to SHA256 digest function. output must have 32 bytes in C memory.

type VDevConfig

type VDevConfig struct {
	Config
	// Socket is the preferred NUMA socket.
	Socket eal.NumaSocket
	// Drivers contains preferred drivers. Default is openssl.
	Drivers []string
}

VDevConfig configures a virtual crypto device.

Jump to

Keyboard shortcuts

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