fix compilation error on 386

Update github.com/safchain/ethtool to fix the compilation
error on 386. Also added 386 to the tarvis yaml.

Fixes #322

Signed-off-by: Moshe Levi <moshele@mellanox.com>
This commit is contained in:
Moshe Levi
2019-05-24 23:27:17 +03:00
parent 0950a3607b
commit 2753b9af8f
7 changed files with 355 additions and 38 deletions

View File

@ -26,6 +26,7 @@
package ethtool
import (
"math"
"reflect"
"syscall"
"unsafe"
@ -128,6 +129,9 @@ func (e *Ethtool) CmdGet(ecmd *EthtoolCmd, intf string) (uint32, error) {
var speedval uint32 = (uint32(ecmd.Speed_hi) << 16) |
(uint32(ecmd.Speed) & 0xffff)
if speedval == math.MaxUint16 {
speedval = math.MaxUint32
}
return speedval, nil
}
@ -153,6 +157,9 @@ func (e *Ethtool) CmdSet(ecmd *EthtoolCmd, intf string) (uint32, error) {
var speedval uint32 = (uint32(ecmd.Speed_hi) << 16) |
(uint32(ecmd.Speed) & 0xffff)
if speedval == math.MaxUint16 {
speedval = math.MaxUint32
}
return speedval, nil
}