mirror of
https://github.com/vishvananda/netlink.git
synced 2025-10-05 07:46:51 +08:00
implemented handling of uint64 for HTB class rate/ceil
This commit is contained in:

committed by
Alessandro Boch

parent
3bf47faadc
commit
2dd616d00b
@@ -176,6 +176,12 @@ func classPayload(req *nl.NetlinkRequest, class Class) error {
|
|||||||
options.AddRtAttr(nl.TCA_HTB_PARMS, opt.Serialize())
|
options.AddRtAttr(nl.TCA_HTB_PARMS, opt.Serialize())
|
||||||
options.AddRtAttr(nl.TCA_HTB_RTAB, SerializeRtab(rtab))
|
options.AddRtAttr(nl.TCA_HTB_RTAB, SerializeRtab(rtab))
|
||||||
options.AddRtAttr(nl.TCA_HTB_CTAB, SerializeRtab(ctab))
|
options.AddRtAttr(nl.TCA_HTB_CTAB, SerializeRtab(ctab))
|
||||||
|
if htb.Rate >= uint64(1<<32) {
|
||||||
|
options.AddRtAttr(nl.TCA_HTB_RATE64, nl.Uint64Attr(htb.Rate))
|
||||||
|
}
|
||||||
|
if htb.Ceil >= uint64(1<<32) {
|
||||||
|
options.AddRtAttr(nl.TCA_HTB_CEIL64, nl.Uint64Attr(htb.Ceil))
|
||||||
|
}
|
||||||
case "hfsc":
|
case "hfsc":
|
||||||
hfsc := class.(*HfscClass)
|
hfsc := class.(*HfscClass)
|
||||||
opt := nl.HfscCopt{}
|
opt := nl.HfscCopt{}
|
||||||
@@ -306,6 +312,10 @@ func parseHtbClassData(class Class, data []syscall.NetlinkRouteAttr) (bool, erro
|
|||||||
htb.Quantum = opt.Quantum
|
htb.Quantum = opt.Quantum
|
||||||
htb.Level = opt.Level
|
htb.Level = opt.Level
|
||||||
htb.Prio = opt.Prio
|
htb.Prio = opt.Prio
|
||||||
|
case nl.TCA_HTB_RATE64:
|
||||||
|
htb.Rate = native.Uint64(datum.Value[0:8])
|
||||||
|
case nl.TCA_HTB_CEIL64:
|
||||||
|
htb.Ceil = native.Uint64(datum.Value[0:8])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return detailed, nil
|
return detailed, nil
|
||||||
|
@@ -268,7 +268,8 @@ func TestHtbClassAddHtbClassChangeDel(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
htbclassattrs := HtbClassAttrs{
|
htbclassattrs := HtbClassAttrs{
|
||||||
Rate: 1234000,
|
Rate: uint64(1<<32) + 10,
|
||||||
|
Ceil: uint64(1<<32) + 20,
|
||||||
Cbuffer: 1690,
|
Cbuffer: 1690,
|
||||||
}
|
}
|
||||||
class := NewHtbClass(classattrs, htbclassattrs)
|
class := NewHtbClass(classattrs, htbclassattrs)
|
||||||
|
Reference in New Issue
Block a user