Measure cable length from hardware transmit and receive timestamps
This commit is contained in:
@@ -196,7 +196,8 @@ func checkFlowRules(fd int, ifname string, ethertypes []uint16) checkResult {
|
||||
return res
|
||||
}
|
||||
|
||||
type ethtoolIfreq struct {
|
||||
// The ifreq shape used by every ioctl that passes its payload by pointer.
|
||||
type dataIfreq struct {
|
||||
name [unix.IFNAMSIZ]byte
|
||||
data unsafe.Pointer
|
||||
_ [16]byte
|
||||
@@ -283,7 +284,7 @@ func (r checkResult) detail() string {
|
||||
}
|
||||
|
||||
func ethtoolCall(fd int, ifname string, data unsafe.Pointer) error {
|
||||
var ifr ethtoolIfreq
|
||||
var ifr dataIfreq
|
||||
if len(ifname) >= unix.IFNAMSIZ {
|
||||
return fmt.Errorf("interface name %q too long", ifname)
|
||||
}
|
||||
@@ -482,6 +483,7 @@ func configureSystem(ifnames []string, ethertypes []uint16) []checkResult {
|
||||
}
|
||||
out = append(out, checkCarrier(ifname, carrierWait))
|
||||
out = append(out, checkCoalesce(fd, ifname, wantCoalesceUsecs, wantCoalesceUsecs))
|
||||
out = append(out, checkTimestamping(fd, ifname))
|
||||
out = append(out, checkFlowRules(fd, ifname, ethertypes))
|
||||
}
|
||||
return out
|
||||
|
||||
Reference in New Issue
Block a user