Jumbo in the size mix (MTU 9000 + module jumbo pinned), check-first module config trusting GET reads, cable diag async at startup through the reset path, MODULES table dissolved into SETTINGS/LINKS, per-driver NIC counter sets, comment cleanup
This commit is contained in:
@@ -214,6 +214,38 @@ type flagsIfreq struct {
|
||||
_ [22]byte
|
||||
}
|
||||
|
||||
type mtuIfreq struct {
|
||||
name [unix.IFNAMSIZ]byte
|
||||
mtu int32
|
||||
_ [20]byte
|
||||
}
|
||||
|
||||
func checkMTU(fd int, ifname string, want int32) checkResult {
|
||||
res := checkResult{item: ifname + " mtu"}
|
||||
var ifr mtuIfreq
|
||||
copy(ifr.name[:], ifname)
|
||||
if _, _, errno := unix.Syscall(unix.SYS_IOCTL, uintptr(fd),
|
||||
uintptr(unix.SIOCGIFMTU), uintptr(unsafe.Pointer(&ifr))); errno != 0 {
|
||||
res.err = errno
|
||||
return res
|
||||
}
|
||||
if ifr.mtu == want {
|
||||
res.state = fmt.Sprintf("%d", want)
|
||||
return res
|
||||
}
|
||||
was := ifr.mtu
|
||||
ifr.mtu = want
|
||||
if _, _, errno := unix.Syscall(unix.SYS_IOCTL, uintptr(fd),
|
||||
uintptr(unix.SIOCSIFMTU), uintptr(unsafe.Pointer(&ifr))); errno != 0 {
|
||||
res.err = errno
|
||||
res.state = fmt.Sprintf("could not set %d", want)
|
||||
return res
|
||||
}
|
||||
res.fixed = true
|
||||
res.state = fmt.Sprintf("was %d, now %d (link reset)", was, want)
|
||||
return res
|
||||
}
|
||||
|
||||
type ethtoolRingparam struct {
|
||||
cmd uint32
|
||||
rxMaxPending uint32
|
||||
@@ -258,6 +290,7 @@ const (
|
||||
wantRxRing = 8160
|
||||
wantTxRing = 4096
|
||||
wantIdleLatency = 10
|
||||
wantMTU = 9000
|
||||
)
|
||||
|
||||
type checkResult struct {
|
||||
@@ -714,6 +747,7 @@ func configureSystem(ifnames []string, ethertypes []uint16) []checkResult {
|
||||
out := []checkResult{checkGovernor(wantGovernor), checkIdleLatency(wantIdleLatency)}
|
||||
for _, ifname := range ifnames {
|
||||
out = append(out, checkLinkUp(fd, ifname))
|
||||
out = append(out, checkMTU(fd, ifname, wantMTU))
|
||||
out = append(out, clearFlowRules(fd, ifname))
|
||||
|
||||
// Ring changes reprogram the queues, so flow rules pointing at those
|
||||
|
||||
Reference in New Issue
Block a user