vfconfig

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Overview

Package vfconfig provides VF config

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete added in v1.1.0

func Delete(ctx context.Context, isClient bool)

Delete deletes the VFConfig stored in per Connection.Id metadata

func Store added in v1.1.0

func Store(ctx context.Context, isClient bool, config *VFConfig)

Store sets the VFConfig stored in per Connection.Id metadata.

Types

type VFConfig

type VFConfig struct {
	// PFInterfaceName is a parent PF net interface name
	PFInterfaceName string
	// VFInterfaceName is a VF net interface name
	VFInterfaceName string
	// VFPCIAddress is a VF pci address
	VFPCIAddress string
	// VFNum is a VF num for the parent PF
	VFNum int
	// ContNetNS is a container netns id on which VF is attached
	ContNetNS netns.NsHandle
}

VFConfig is a config for VF

func Load added in v1.1.0

func Load(ctx context.Context, isClient bool) (config *VFConfig, ok bool)

Load returns the VFConfig stored in per Connection.Id metadata, or nil if no value is present. The ok result indicates whether value was found in the per Connection.Id metadata.

func LoadAndDelete added in v1.1.0

func LoadAndDelete(ctx context.Context, isClient bool) (config *VFConfig, ok bool)

LoadAndDelete deletes the VFConfig stored in per Connection.Id metadata, returning the previous value if any. The loaded result reports whether the key was present.

func LoadOrStore added in v1.1.0

func LoadOrStore(ctx context.Context, isClient bool, config *VFConfig) (value *VFConfig, ok bool)

LoadOrStore returns the existing VFConfig stored in per Connection.Id metadata if present. Otherwise, it stores and returns the given VFConfig. The loaded result is true if the value was loaded, false if stored.

Jump to

Keyboard shortcuts

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