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
8 changes: 8 additions & 0 deletions internal/report/table_defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1616,6 +1616,10 @@ func nicTableValues(outputs map[string]script.ScriptOutput) []Field {
{Name: "MAC Address"},
{Name: "NUMA Node"},
{Name: "IRQBalance"},
{Name: "Adaptive RX"},
{Name: "Adaptive TX"},
{Name: "rx-usecs"},
{Name: "tx-usecs"},
}
for _, nicInfo := range allNicsInfo {
fields[0].Values = append(fields[0].Values, nicInfo.Name)
Expand All @@ -1636,6 +1640,10 @@ func nicTableValues(outputs map[string]script.ScriptOutput) []Field {
fields[9].Values = append(fields[9].Values, nicInfo.MACAddress)
fields[10].Values = append(fields[10].Values, nicInfo.NUMANode)
fields[11].Values = append(fields[11].Values, nicInfo.IRQBalance)
fields[12].Values = append(fields[12].Values, nicInfo.AdaptiveRX)
fields[13].Values = append(fields[13].Values, nicInfo.AdaptiveTX)
fields[14].Values = append(fields[14].Values, nicInfo.RxUsecs)
fields[15].Values = append(fields[15].Values, nicInfo.TxUsecs)
}
return fields
}
Expand Down
15 changes: 15 additions & 0 deletions internal/report/table_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,10 @@ type nicInfo struct {
NUMANode string
CPUAffinity string
IRQBalance string
AdaptiveRX string
AdaptiveTX string
RxUsecs string
TxUsecs string
}

func parseNicInfo(scriptOutput string) []nicInfo {
Expand All @@ -1255,9 +1259,20 @@ func parseNicInfo(scriptOutput string) []nicInfo {
"NUMA Node: ": &nic.NUMANode,
"CPU Affinity: ": &nic.CPUAffinity,
"IRQ Balance: ": &nic.IRQBalance,
"rx-usecs: ": &nic.RxUsecs,
"tx-usecs: ": &nic.TxUsecs,
}
for line := range strings.SplitSeq(nicOutput, "\n") {
line = strings.TrimSpace(line)
// Special parsing for "Adaptive RX: off TX: off" format
if strings.HasPrefix(line, "Adaptive RX: ") {
parts := strings.Split(line, "TX: ")
if len(parts) == 2 {
nic.AdaptiveRX = strings.TrimSpace(strings.TrimPrefix(parts[0], "Adaptive RX: "))
nic.AdaptiveTX = strings.TrimSpace(parts[1])
}
continue
}
for prefix, fieldPtr := range fieldMap {
if after, ok := strings.CutPrefix(line, prefix); ok {
*fieldPtr = after
Expand Down
56 changes: 56 additions & 0 deletions internal/report/table_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,18 @@ func TestParseNicInfo(t *testing.T) {
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)
}
if first.AdaptiveTX != "off" {
t.Errorf("expected AdaptiveTX 'off', got '%s'", first.AdaptiveTX)
}
if first.RxUsecs != "200" {
t.Errorf("expected RxUsecs '200', got '%s'", first.RxUsecs)
}
if first.TxUsecs != "150" {
t.Errorf("expected TxUsecs '150', got '%s'", first.TxUsecs)
}

// Spot check second NIC
second := nics[1]
Expand All @@ -669,6 +681,18 @@ func TestParseNicInfo(t *testing.T) {
if second.Link != "no" {
t.Errorf("expected Link 'no', got '%s'", second.Link)
}
if second.AdaptiveRX != "on" {
t.Errorf("expected AdaptiveRX 'on', got '%s'", second.AdaptiveRX)
}
if second.AdaptiveTX != "on" {
t.Errorf("expected AdaptiveTX 'on', got '%s'", second.AdaptiveTX)
}
if second.RxUsecs != "100" {
t.Errorf("expected RxUsecs '100', got '%s'", second.RxUsecs)
}
if second.TxUsecs != "100" {
t.Errorf("expected TxUsecs '100', got '%s'", second.TxUsecs)
}

// Spot check third NIC
third := nics[2]
Expand Down Expand Up @@ -719,6 +743,22 @@ supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no
Coalesce parameters for ens7f0np0:
Adaptive RX: off TX: off
stats-block-usecs: 0
sample-interval: 0
pkt-rate-low: 0
pkt-rate-high: 0

rx-usecs: 200
rx-frames: 0
rx-usecs-irq: 0
rx-frames-irq: 0

tx-usecs: 150
tx-frames: 0
tx-usecs-irq: 0
tx-frames-irq: 0
MAC Address: 04:32:01:f3:e1:a4
NUMA Node: 0
CPU Affinity: 124:0-143;125:0-143;126:0-143;127:0-143;128:0-143;129:0-143;130:0-143;131:0-143;132:0-143;133:0-143;134:0-143;135:0-143;136:0-143;137:0-143;138:0-143;139:0-143;140:0-143;141:0-143;142:0-143;143:0-143;144:0-143;145:0-143;146:0-143;147:0-143;148:0-143;149:0-143;150:0-143;151:0-143;152:0-143;153:0-143;154:0-143;155:0-143;156:0-143;157:0-143;158:0-143;159:0-143;160:0-143;161:0-143;162:0-143;163:0-143;164:0-143;165:0-143;166:0-143;167:0-143;168:0-143;169:0-143;170:0-143;171:0-143;172:0-143;173:0-143;174:0-143;175:0-143;176:0-143;177:0-143;178:0-143;179:0-143;180:0-143;181:0-143;182:0-143;184:0-143;185:0-143;186:0-143;187:0-143;188:0-143;189:0-143;190:0-143;191:0-143;192:0-143;193:0-143;194:0-143;195:0-143;196:0-143;197:0-143;198:0-143;
Expand Down Expand Up @@ -761,6 +801,22 @@ supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no
Coalesce parameters for ens7f1np1:
Adaptive RX: on TX: on
stats-block-usecs: 0
sample-interval: 0
pkt-rate-low: 0
pkt-rate-high: 0

rx-usecs: 100
rx-frames: 0
rx-usecs-irq: 0
rx-frames-irq: 0

tx-usecs: 100
tx-frames: 0
tx-usecs-irq: 0
tx-frames-irq: 0
MAC Address: 04:32:01:f3:e1:a5
NUMA Node: 0
CPU Affinity: 454:0-143;455:0-143;456:0-143;457:0-143;458:0-143;459:0-143;460:0-143;461:0-143;462:0-143;463:0-143;464:0-143;465:0-143;466:0-143;467:0-143;468:0-143;469:0-143;470:0-143;471:0-143;472:0-143;473:0-143;474:0-143;475:0-143;476:0-143;477:0-143;478:0-143;479:0-143;480:0-143;481:0-143;482:0-143;483:0-143;484:0-143;485:0-143;486:0-143;487:0-143;488:0-143;489:0-143;490:0-143;491:0-143;492:0-143;493:0-143;494:0-143;495:0-143;496:0-143;497:0-143;498:0-143;499:0-143;500:0-143;501:0-143;502:0-143;503:0-143;504:0-143;505:0-143;506:0-143;507:0-143;508:0-143;509:0-143;510:0-143;511:0-143;512:0-143;513:0-143;514:0-143;515:0-143;516:0-143;517:0-143;518:0-143;519:0-143;520:0-143;521:0-143;522:0-143;523:0-143;524:0-143;525:0-143;526:0-143;527:0-143;
Expand Down
3 changes: 3 additions & 0 deletions internal/script/script_defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,9 @@ rdmsr 0x2FFE
echo "Model: $(echo "$udevadm_out" | grep ID_MODEL_FROM_DATABASE= | cut -d'=' -f2)"
echo "$ethtool_out"
echo "$ethtool_i_out"
if ethtool_c_out=$(ethtool -c "$ifc" 2>/dev/null); then
echo "$ethtool_c_out"
fi
echo "MAC Address: $(cat /sys/class/net/"$ifc"/address 2>/dev/null)"
echo "NUMA Node: $(cat /sys/class/net/"$ifc"/device/numa_node 2>/dev/null)"
echo -n "CPU Affinity: "
Expand Down