Documentation ¶
Index ¶
- type ApiInfo
- type CfgOption
- type GoPktgen
- func (g *GoPktgen) AddMapping(pMap ...*gpc.Mapping)
- func (g *GoPktgen) AddPorts(pci ...string)
- func (g *GoPktgen) Core(coreID gpc.CoreID) *gpc.LogicalCore
- func (g *GoPktgen) CoreList() []gpc.LogicalCore
- func (g *GoPktgen) Destroy()
- func (g *GoPktgen) GetEtherStats(pid gpc.PortID) *gpc.EtherStats
- func (g *GoPktgen) GetLinkState(pid gpc.PortID) gpc.LinkState
- func (g *GoPktgen) GetMacAddress(pid gpc.PortID) (gpc.MacAddress, error)
- func (g *GoPktgen) GetPortDeviceInfo(pid gpc.PortID) (gpc.PortDeviceInfo, error)
- func (g *GoPktgen) GetPortInfo(pid gpc.PortID) *PortStats
- func (g *GoPktgen) GetPortStats(pid uint16) *PortStats
- func (g *GoPktgen) GetRxPercentSlice() []float64
- func (g *GoPktgen) GetTxPercentSlice() []float64
- func (g *GoPktgen) L2pConfigSet() error
- func (g *GoPktgen) LaunchThreads() error
- func (g *GoPktgen) LogicalPortEntry(pid gpc.PortID) *gpc.LogicalPort
- func (g *GoPktgen) LogicalPortList() []gpc.LogicalPort
- func (g *GoPktgen) Marshal() string
- func (g *GoPktgen) NewPortStats() *PortStats
- func (g *GoPktgen) NumQueues(pid gpc.PortID) (uint16, uint16)
- func (g *GoPktgen) PortCount() uint16
- func (g *GoPktgen) PortList() []gpc.PhysicalPort
- func (g *GoPktgen) ProcessMaps() error
- func (g *GoPktgen) SetL2pConfig(cfg *gpc.L2pConfig) int
- func (g *GoPktgen) Start() error
- func (g *GoPktgen) Stop()
- func (g *GoPktgen) UpdateStats()
- type GoPktgenApi
- type GoPktgenOption
- type LibInfo
- type PortStats
- type System
- func (cs *System) CoreList() string
- func (cs *System) FilePrefix() string
- func (cs *System) GetArgsDPDK() ([]string, error)
- func (cs *System) InMemory() bool
- func (cs *System) LogTTY() int
- func (cs *System) MappingCount() int
- func (cs *System) Mappings() []*gpc.Mapping
- func (cs *System) MemorySize() uint64
- func (cs *System) NumChannels() uint16
- func (cs *System) NumRanks() uint16
- func (cs *System) PciList() []string
- func (cs *System) PortCount() int
- func (cs *System) Promiscuous() bool
- func (cs *System) SetLogTTY(ptty int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoPktgen ¶
type GoPktgen struct { GoPktgenApi // contains filtered or unexported fields }
func New ¶
func New(options ...GoPktgenOption) (*GoPktgen, error)
Create the GoPktgen instance and load the necessary libraries
func (*GoPktgen) AddMapping ¶
func (*GoPktgen) CoreList ¶
func (g *GoPktgen) CoreList() []gpc.LogicalCore
func (*GoPktgen) GetEtherStats ¶
func (g *GoPktgen) GetEtherStats(pid gpc.PortID) *gpc.EtherStats
func (*GoPktgen) GetLinkState ¶
LinkState is the function to get link status of a port
func (*GoPktgen) GetMacAddress ¶
GetMacAddress is the function to get MAC address of a port
func (*GoPktgen) GetPortDeviceInfo ¶
func (*GoPktgen) GetPortStats ¶
func (*GoPktgen) GetRxPercentSlice ¶
func (*GoPktgen) GetTxPercentSlice ¶
func (*GoPktgen) L2pConfigSet ¶
func (*GoPktgen) LaunchThreads ¶
func (*GoPktgen) LogicalPortEntry ¶
func (g *GoPktgen) LogicalPortEntry(pid gpc.PortID) *gpc.LogicalPort
func (*GoPktgen) LogicalPortList ¶
func (g *GoPktgen) LogicalPortList() []gpc.LogicalPort
func (*GoPktgen) NewPortStats ¶
func (*GoPktgen) NumQueues ¶
(L2p) NumQueues returns the number of Rx and Tx queues for a given port.
func (*GoPktgen) PortList ¶
func (g *GoPktgen) PortList() []gpc.PhysicalPort
func (*GoPktgen) ProcessMaps ¶
func (*GoPktgen) Start ¶
Start initializes and starts the GoPktgen system. It performs the following steps:
- Calls the scrollScreen function to clear the terminal screen.
- Initializes the DPDK system using the provided log path.
- Attaches to the EAL message channel with the default channel name. If the attachment fails, it sleeps for half a second and tries again.
- Initializes the physical port information.
- Creates the threads using the attached message channel.
- Returns an error if any step fails.
func (*GoPktgen) UpdateStats ¶
func (g *GoPktgen) UpdateStats()
type GoPktgenApi ¶
type GoPktgenApi struct { AddArgv func(arg string) int // Add a argv value L2pConfig func(cfg unsafe.Pointer) int // Add L2p configuration Startup func(log_path string) int // Start function with log_path Shutdown func() int // Stop function PortSetInfo func(portCfg *gpc.PortConfig) int // Set port information PortGetInfo func(portID gpc.PortID) *gpc.PortConfig // Get port information PortFreeInfo func(cfg *gpc.PortConfig) // Free port information structure PortStats func(portID gpc.PortID, stats unsafe.Pointer) int // Get port statistics PortLinkStatus func(portID gpc.PortID) uint64 // Get link status encoded as a uint64 PortMacAddress func(portID gpc.PortID, mac unsafe.Pointer) int // Get port MAC address PortDeviceInfo func(portID gpc.PortID, info unsafe.Pointer) int // Get port device information ChannelCreate func(name string, size uint32) uintptr // MsgChan initialize ChannelAttach func(name string) uintptr // MsgChan attach ChannelDestroy func(mc uintptr) int // MsgChan destroy ChannelRecv func(mc uintptr, data unsafe.Pointer, len int) int // MsgChan receive data burst ChannelSend func(mc uintptr, data unsafe.Pointer, len int) int // MsgChan send data burst }
GoPktgen API functions
type GoPktgenOption ¶
type GoPktgenOption func(*GoPktgen)
func WithBasePath ¶
func WithBasePath(basePath string) GoPktgenOption
func WithLibNames ¶
func WithLibNames(libNames []string) GoPktgenOption
func WithLogPath ¶
func WithLogPath(ttyID int) GoPktgenOption
type PortStats ¶
type PortStats struct { TimeStamp time.Time // Current time per port to calculate rates LinkStatus gpc.LinkState // Link status of the port CurrStats gpc.PortStatistics // Port statistics PrevStats gpc.PortStatistics // Port statistics RateStats gpc.PortStatistics // Port statistics RxPPS uint64 // Rx packets per second TxPPS uint64 // Tx packets per second RxMbitsPS uint64 // Rx Mbits per second TxMbitsPS uint64 // Tx Mbits per second MaxRxPPS uint64 // Maximum Rx packets received per second MaxTxPPS uint64 // Maximum Tx packets transmitted per second MaxRxMbitPS uint64 // Maximum Rx Mbits per second per second MaxTxMbitPS uint64 // Maximum Tx Mbits per second per second RxPacketRate float64 // Rx percent rate per second TxPacketRate float64 // Tx percent rate per second }
type System ¶
type System struct {
// contains filtered or unexported fields
}
func (*System) FilePrefix ¶
func (*System) GetArgsDPDK ¶
Return the command-line arguments for starting DPDK.
func (*System) MappingCount ¶
func (*System) MemorySize ¶
func (*System) NumChannels ¶
func (*System) Promiscuous ¶
Click to show internal directories.
Click to hide internal directories.