Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NumRxQueues/NumTxQueues is not configured on veth peer #536

Closed
alexforster opened this issue Apr 14, 2020 · 0 comments
Closed

NumRxQueues/NumTxQueues is not configured on veth peer #536

alexforster opened this issue Apr 14, 2020 · 0 comments

Comments

@alexforster
Copy link
Contributor

It does not appear possible to correctly configure the number of rx/tx queues on a veth pair.

When creating a veth pair like so:

link := nl.Veth{
	LinkAttrs: nl.LinkAttrs{
		Name:  "outer0",
		NumRxQueues: 16,
		NumTxQueues: 16,
	},
	PeerName: "inner0",
}

I would expect the outcome to be equivalent to the following ip command:

ip link add outer0 numrxqueues 16 numtxqueues 16 type veth peer inner0 numrxqueues 16 numtxqueues 16

However, this library actually performs the equivalent of the following ip command:

ip link add outer0 numrxqueues 16 numtxqueues 16 type veth peer inner0

The problem seems to be here, where the NumRxQueues/NumTxQueues attributes are not applied to the veth peer interface:

netlink/link_linux.go

Lines 1277 to 1290 in 5f2fc86

case *Veth:
data := linkInfo.AddRtAttr(nl.IFLA_INFO_DATA, nil)
peer := data.AddRtAttr(nl.VETH_INFO_PEER, nil)
nl.NewIfInfomsgChild(peer, unix.AF_UNSPEC)
peer.AddRtAttr(unix.IFLA_IFNAME, nl.ZeroTerminated(link.PeerName))
if base.TxQLen >= 0 {
peer.AddRtAttr(unix.IFLA_TXQLEN, nl.Uint32Attr(uint32(base.TxQLen)))
}
if base.MTU > 0 {
peer.AddRtAttr(unix.IFLA_MTU, nl.Uint32Attr(uint32(base.MTU)))
}
if link.PeerHardwareAddr != nil {
peer.AddRtAttr(unix.IFLA_ADDRESS, []byte(link.PeerHardwareAddr))
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant