dpdk

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultLogWriter io.Writer = nil
)

Functions

func BindCpuCore

func BindCpuCore(core int)

BindCpuCore 协程绑核

func Exit

func Exit()

Exit 停止dpdk

func Log added in v1.0.6

func Log(msg string)

func Run

func Run(config *Config)

Run 启动dpdk

func Rx

func Rx(port_index int) chan []byte

Rx 获取网口RX管道

func Tx

func Tx(port_index int) chan []byte

Tx 获取网口TX管道

Types

type Config

type Config struct {
	GolangCpuCoreList []int  // golang侧使用的核心编号列表 每个网口两个核心
	StatsLog          bool   // 收发包统计日志
	DpdkCpuCoreList   []int  // dpdk侧使用的核心编号列表 主线程第一个核心 杂项线程第二个核心 每个网口两个核心
	DpdkMemChanNum    int    // dpdk内存通道数
	PortIdList        []int  // 使用网口id列表
	RingBufferSize    int    // 环状缓冲区大小
	DebugLog          bool   // 收发包调试日志
	IdleSleep         bool   // 空闲睡眠 降低cpu占用
	SingleCore        bool   // 单核模式 物理单核机器需要开启
	KniBypass         bool   // kni旁路目标ip 只接收来自目标ip的包 其他的包全部送到kni网卡
	KniBypassTargetIp string // kni旁路目标ip地址
}

Jump to

Keyboard shortcuts

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