mirror of
https://github.com/vishvananda/netlink
synced 2025-03-11 07:47:45 +00:00
Configure numrxqueues/numtxqueues on veth peer (fixes #536)
This commit is contained in:
parent
96dce1cb9f
commit
27f2b32dc6
@ -1282,6 +1282,12 @@ func (h *Handle) linkModify(link Link, flags int) error {
|
||||
if base.TxQLen >= 0 {
|
||||
peer.AddRtAttr(unix.IFLA_TXQLEN, nl.Uint32Attr(uint32(base.TxQLen)))
|
||||
}
|
||||
if base.NumTxQueues > 0 {
|
||||
peer.AddRtAttr(unix.IFLA_NUM_TX_QUEUES, nl.Uint32Attr(uint32(base.NumTxQueues)))
|
||||
}
|
||||
if base.NumRxQueues > 0 {
|
||||
peer.AddRtAttr(unix.IFLA_NUM_RX_QUEUES, nl.Uint32Attr(uint32(base.NumRxQueues)))
|
||||
}
|
||||
if base.MTU > 0 {
|
||||
peer.AddRtAttr(unix.IFLA_MTU, nl.Uint32Attr(uint32(base.MTU)))
|
||||
}
|
||||
|
@ -93,6 +93,12 @@ func testLinkAddDel(t *testing.T, link Link) {
|
||||
if peer.TxQLen != testTxQLen {
|
||||
t.Fatalf("TxQLen of peer is %d, should be %d", peer.TxQLen, testTxQLen)
|
||||
}
|
||||
if peer.NumTxQueues != testTxQueues {
|
||||
t.Fatalf("NumTxQueues of peer is %d, should be %d", peer.NumTxQueues, testTxQueues)
|
||||
}
|
||||
if peer.NumRxQueues != testRxQueues {
|
||||
t.Fatalf("NumRxQueues of peer is %d, should be %d", peer.NumRxQueues, testRxQueues)
|
||||
}
|
||||
if !bytes.Equal(peer.Attrs().HardwareAddr, original.PeerHardwareAddr) {
|
||||
t.Fatalf("Peer MAC addr is %s, should be %s", peer.Attrs().HardwareAddr, original.PeerHardwareAddr)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user