Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions cmd/report/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ var (
flagMemory bool
flagDimm bool
flagNic bool
flagNetIrq bool
flagNetConfig bool
flagDisk bool
flagFilesystem bool
Expand Down Expand Up @@ -108,9 +107,8 @@ const (
flagSSTName = "sst"
flagMemoryName = "memory"
flagDimmName = "dimm"
flagNicName = "nic"
flagNetConfigName = "netconfig"
flagNetIrqName = "netirq"
flagNicName = "nic"
flagDiskName = "disk"
flagFilesystemName = "filesystem"
flagGpuName = "gpu"
Expand Down Expand Up @@ -171,9 +169,8 @@ var categories = []common.Category{
{FlagName: flagElcName, FlagVar: &flagElc, Help: "Efficiency Latency Control Settings", TableNames: []string{report.ElcTableName}},
{FlagName: flagMemoryName, FlagVar: &flagMemory, Help: "Memory Configuration", TableNames: []string{report.MemoryTableName}},
{FlagName: flagDimmName, FlagVar: &flagDimm, Help: "DIMM Population", TableNames: []string{report.DIMMTableName}},
{FlagName: flagNicName, FlagVar: &flagNic, Help: "Network Cards", TableNames: []string{report.NICTableName, report.NICPacketSteeringTableName}},
{FlagName: flagNetConfigName, FlagVar: &flagNetConfig, Help: "Network Configuration", TableNames: []string{report.NetworkConfigTableName}},
{FlagName: flagNetIrqName, FlagVar: &flagNetIrq, Help: "Network IRQ to CPU Mapping", TableNames: []string{report.NetworkIRQMappingTableName}},
{FlagName: flagNicName, FlagVar: &flagNic, Help: "Network Cards", TableNames: []string{report.NICTableName, report.NICCpuAffinityTableName, report.NICPacketSteeringTableName}},
{FlagName: flagDiskName, FlagVar: &flagDisk, Help: "Storage Devices", TableNames: []string{report.DiskTableName}},
{FlagName: flagFilesystemName, FlagVar: &flagFilesystem, Help: "File Systems", TableNames: []string{report.FilesystemTableName}},
{FlagName: flagGpuName, FlagVar: &flagGpu, Help: "GPUs", TableNames: []string{report.GPUTableName}},
Expand Down
57 changes: 29 additions & 28 deletions internal/report/table_defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ const (
ElcTableName = "Efficiency Latency Control"
MemoryTableName = "Memory"
DIMMTableName = "DIMM"
NICTableName = "NIC"
NetworkIRQMappingTableName = "Network IRQ Mapping"
NetworkConfigTableName = "Network Configuration"
NICTableName = "NIC"
NICCpuAffinityTableName = "NIC CPU Affinity"
NICPacketSteeringTableName = "NIC Packet Steering"
DiskTableName = "Disk"
FilesystemTableName = "Filesystem"
Expand Down Expand Up @@ -367,35 +367,36 @@ var tableDefinitions = map[string]TableDefinition{
FieldsFunc: dimmTableValues,
InsightsFunc: dimmTableInsights,
HTMLTableRendererFunc: dimmTableHTMLRenderer},
NICTableName: {
Name: NICTableName,
HasRows: true,
NetworkConfigTableName: {
Name: NetworkConfigTableName,
HasRows: false,
MenuLabel: NetworkMenuLabel,
ScriptNames: []string{
script.SysctlScriptName,
script.IRQBalanceScriptName,
},
FieldsFunc: networkConfigTableValues},
NICTableName: {
Name: NICTableName,
HasRows: true,
ScriptNames: []string{
script.NicInfoScriptName,
},
FieldsFunc: nicTableValues},
NetworkConfigTableName: {
Name: NetworkConfigTableName,
HasRows: false,
NICCpuAffinityTableName: {
Name: NICCpuAffinityTableName,
HasRows: true,
ScriptNames: []string{
script.SysctlScriptName,
script.NicInfoScriptName,
},
FieldsFunc: networkConfigTableValues},
FieldsFunc: nicCpuAffinityTableValues},
NICPacketSteeringTableName: {
Name: NICPacketSteeringTableName,
HasRows: true,
ScriptNames: []string{
script.NicInfoScriptName,
},
FieldsFunc: nicPacketSteeringTableValues},
NetworkIRQMappingTableName: {
Name: NetworkIRQMappingTableName,
HasRows: true,
ScriptNames: []string{
script.NicInfoScriptName,
},
FieldsFunc: networkIRQMappingTableValues},
DiskTableName: {
Name: DiskTableName,
HasRows: true,
Expand Down Expand Up @@ -1637,7 +1638,6 @@ func nicTableValues(outputs map[string]script.ScriptOutput) []Field {
{Name: "MTU", Description: "Maximum Transmission Unit. The largest size packet or frame, specified in octets (eight-bit bytes), that can be sent in a packet- or frame-based network such as the Internet."},
{Name: "TX Queues"},
{Name: "RX Queues"},
{Name: "IRQBalance", Description: "System level setting. Dynamically monitors system activity and spreads IRQs across available cores, aiming to balance CPU load, improve throughput, and reduce latency for interrupt-heavy workloads."},
{Name: "Adaptive RX", Description: "Enables dynamic adjustment of receive interrupt coalescing based on traffic patterns."},
{Name: "Adaptive TX", Description: "Enables dynamic adjustment of transmit interrupt coalescing based on traffic patterns."},
{Name: "rx-usecs", Description: "Sets the delay, in microseconds, before an interrupt is generated after receiving a packet. Higher values reduce CPU usage (by batching packets), but increase latency. Lower values reduce latency, but increase interrupt rate and CPU load."},
Expand Down Expand Up @@ -1675,11 +1675,10 @@ func nicTableValues(outputs map[string]script.ScriptOutput) []Field {
fields[12].Values = append(fields[12].Values, nicInfo.MTU)
fields[13].Values = append(fields[13].Values, nicInfo.TXQueues)
fields[14].Values = append(fields[14].Values, nicInfo.RXQueues)
fields[15].Values = append(fields[15].Values, nicInfo.IRQBalance)
fields[16].Values = append(fields[16].Values, nicInfo.AdaptiveRX)
fields[17].Values = append(fields[17].Values, nicInfo.AdaptiveTX)
fields[18].Values = append(fields[18].Values, nicInfo.RxUsecs)
fields[19].Values = append(fields[19].Values, nicInfo.TxUsecs)
fields[15].Values = append(fields[15].Values, nicInfo.AdaptiveRX)
fields[16].Values = append(fields[16].Values, nicInfo.AdaptiveTX)
fields[17].Values = append(fields[17].Values, nicInfo.RxUsecs)
fields[18].Values = append(fields[18].Values, nicInfo.TxUsecs)
}
return fields
}
Expand All @@ -1700,14 +1699,14 @@ func nicPacketSteeringTableValues(outputs map[string]script.ScriptOutput) []Fiel
// XPS row
if nicInfo.TXQueues != "0" {
fields[0].Values = append(fields[0].Values, nicInfo.Name)
fields[1].Values = append(fields[1].Values, "xps_cpus")
fields[1].Values = append(fields[1].Values, "XPS")
fields[2].Values = append(fields[2].Values, formatQueueCPUMappings(nicInfo.XPSCPUs, "tx-"))
}

// RPS row
if nicInfo.RXQueues != "0" {
fields[0].Values = append(fields[0].Values, nicInfo.Name)
fields[1].Values = append(fields[1].Values, "rps_cpus")
fields[1].Values = append(fields[1].Values, "RPS")
fields[2].Values = append(fields[2].Values, formatQueueCPUMappings(nicInfo.RPSCPUs, "rx-"))
}
}
Expand Down Expand Up @@ -1741,12 +1740,12 @@ func formatQueueCPUMappings(mappings map[string]string, prefix string) string {
}

if len(queueMappings) == 0 {
return "N/A"
return ""
}
return strings.Join(queueMappings, " | ")
}

func networkIRQMappingTableValues(outputs map[string]script.ScriptOutput) []Field {
func nicCpuAffinityTableValues(outputs map[string]script.ScriptOutput) []Field {
nicIRQMappings := nicIRQMappingsFromOutput(outputs)
if len(nicIRQMappings) == 0 {
return []Field{}
Expand All @@ -1772,6 +1771,7 @@ func networkConfigTableValues(outputs map[string]script.ScriptOutput) []Field {
{Name: "net.core.netdev_max_backlog"},
{Name: "net.ipv4.tcp_max_syn_backlog"},
{Name: "net.core.somaxconn"},
{Name: "IRQ Balance"},
}
// load the params into a map so we can easily look them up
sysctlParams := make(map[string]string)
Expand All @@ -1788,13 +1788,14 @@ func networkConfigTableValues(outputs map[string]script.ScriptOutput) []Field {
}
}
// add the values to the fields
for i := range fields {
for i := range fields[:len(fields)-1] {
if val, ok := sysctlParams[fields[i].Name]; ok {
fields[i].Values = append(fields[i].Values, val)
} else {
fields[i].Values = append(fields[i].Values, "")
}
}
fields[len(fields)-1].Values = append(fields[len(fields)-1].Values, strings.TrimSpace(outputs[script.IRQBalanceScriptName].Stdout))
return fields
}

Expand Down
2 changes: 0 additions & 2 deletions internal/report/table_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,6 @@ type nicInfo struct {
MACAddress string
NUMANode string
CPUAffinity string
IRQBalance string
AdaptiveRX string
AdaptiveTX string
RxUsecs string
Expand Down Expand Up @@ -1294,7 +1293,6 @@ func parseNicInfo(scriptOutput string) []nicInfo {
"MAC Address: ": &nic.MACAddress,
"NUMA Node: ": &nic.NUMANode,
"CPU Affinity: ": &nic.CPUAffinity,
"IRQ Balance: ": &nic.IRQBalance,
"rx-usecs: ": &nic.RxUsecs,
"tx-usecs: ": &nic.TxUsecs,
"MTU: ": &nic.MTU,
Expand Down
3 changes: 0 additions & 3 deletions internal/report/table_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,9 +654,6 @@ func TestParseNicInfo(t *testing.T) {
if first.CPUAffinity == "" {
t.Errorf("expected non-empty CPUAffinity")
}
if first.IRQBalance != "Disabled" {
t.Errorf("expected IRQBalance 'Disabled', got '%s'", first.IRQBalance)
}
if first.AdaptiveRX != "off" {
t.Errorf("expected AdaptiveRX 'off', got '%s'", first.AdaptiveRX)
}
Expand Down
6 changes: 5 additions & 1 deletion internal/script/script_defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const (
TransparentHugePagesScriptName = "transparent huge pages"
NumaBalancingScriptName = "numa balancing"
NicInfoScriptName = "nic info"
IRQBalanceScriptName = "irq balance"
DiskInfoScriptName = "disk info"
HdparmScriptName = "hdparm"
DfScriptName = "df"
Expand Down Expand Up @@ -779,7 +780,6 @@ rdmsr 0x2FFE
printf "%s:%s;" "$int" "$cpu"
done
printf "\n"
echo "IRQ Balance: $(pgrep irqbalance >/dev/null 2>&1 && echo "Enabled" || echo "Disabled")"
echo "TX Queues: $(ls -d /sys/class/net/"$ifc"/queues/tx-* | wc -l)"
echo "RX Queues: $(ls -d /sys/class/net/"$ifc"/queues/rx-* | wc -l)"
for q in /sys/class/net/"$ifc"/queues/tx-*; do
Expand All @@ -798,6 +798,10 @@ done
Depends: []string{"ethtool"},
Superuser: true,
},
IRQBalanceScriptName: {
Name: IRQBalanceScriptName,
ScriptTemplate: "pgrep irqbalance >/dev/null 2>&1 && echo 'Enabled' || echo 'Disabled'",
},
DiskInfoScriptName: {
Name: DiskInfoScriptName,
ScriptTemplate: `echo "NAME|MODEL|SIZE|MOUNTPOINT|FSTYPE|RQ-SIZE|MIN-IO|FIRMWARE|ADDR|NUMA|LINKSPEED|LINKWIDTH|MAXLINKSPEED|MAXLINKWIDTH"
Expand Down