-
Notifications
You must be signed in to change notification settings - Fork 43
Networking: Add support for multiqueue tap #475
Conversation
network.go
Outdated
@@ -523,6 +524,35 @@ func createLink(netHandle *netlink.Handle, name string, expectedLink netlink.Lin | |||
return getLinkByName(netHandle, name, expectedLink) | |||
} | |||
|
|||
func createMqLink(netHandle *netlink.Handle, name string, expectedLink netlink.Link) (netlink.Link, []*os.File, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding this function, don't you think we could add a flag for the multiqueue to createLink()
:
func createLink(netHandle *netlink.Handle, name string, expectedLink netlink.Link, mq bool)
And because the return is different, we could simply ignore the list of FDs when not in multiqueue case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sboeuf I should have removed the old method completely. It is no longer needed. We will be switching to fd based methods for all networking interfaces as far as possible. This will give us more control on how we setup the interfaces. i.e. QEMU will not be performing any networking setup internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments, but looks good.
network.go
Outdated
return nil, fds, fmt.Errorf("LinkAdd() failed for %s name %s: %s", expectedLink.Type(), name, err) | ||
} | ||
|
||
tuntapLink, ok := newLink.(*netlink.Tuntap) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not consistent with the fact you want something generic by providing expectedLink
type, but on the other hand, you cast this object into a *netlink.Tuntap
whatever the expected link type is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sboeuf Good catch will fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sboeuf fixed
qemu.go
Outdated
@@ -313,7 +313,7 @@ func (q *qemu) appendSocket(devices []ciaoQemu.Device, socket Socket) []ciaoQemu | |||
func networkModelToQemuType(model NetInterworkingModel) ciaoQemu.NetDeviceType { | |||
switch model { | |||
case ModelBridged: | |||
return ciaoQemu.TAP | |||
return ciaoQemu.MACVTAP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sboeuf The mq link uses the same connection methodology as macvtap. Hence the change. Longer term I should change the name of the ciaoQEMU type should be ciaoQemu.FD. macvtap was too specific as it is just a fd based networking connection.
I will rename/rework the qemu networking code quite a bit when adding support for vhost-user and macvlan and tc based connectivity. Will do the renaming as part of that just to avoid revendoring qemu.
632f683
to
0829996
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sboeuf did a minor rewrite. please review
network.go
Outdated
return nil, fds, fmt.Errorf("LinkAdd() failed for %s name %s: %s", expectedLink.Type(), name, err) | ||
} | ||
|
||
tuntapLink, ok := newLink.(*netlink.Tuntap) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sboeuf fixed
@chavafg can you look at why the CI is failing. There are two vendorings here. And somehow our CI is not picking them up properly
|
Revendor ciao to support multiqueue vhost 95b1aed Networking: Add vhost fd support bbed5b9 client: simplify returned type for quotas 9a7b502 client: split client library by API (& legacy) 171014b ciao-cli: Move client code to it's own package 5b228e3 ciao-cli: Ensure required fields and receivers are exported 692a492 ciao-cli: Split volume client and command handling 40d9fff ciao-cli: split client/command trace functionality 87b016b ciao-cli: Split client/command code for tenants a0683ae ciao-cli: split quotas functionality 489ebce ciao-cli: split node functionality into client and command code dd0ac20 ciao-cli: split workload functionality 4638327 ciao-cli: split instance functionality out 45f32a2 ciao-cli: create helper functions for GET/DELETE/POST and parsing 148cf25 ciao-cli: split client code out for image manipulation 4e555a6 ciao-cli: split client code for external IPs 9508a90 ciao-cli: split event code for list and delete 0a3a983 ciao-cli: with a single HTTP endpoint remove unnecessary API 545458d ciao-cli: Improve error handling in core client code 93f436a ciao-cli: remove scopedToken (residual from keystone) 3218b43 ciao-cli: ensure that the field named controllerURL really is a URL f7aa79c ciao-cli: validate that controllerURL and client certficate are set ac555b5 ciao-cli: move core client code to new struct Signed-off-by: Manohar Castelino <manohar.r.castelino@intel.com>
Revendor netlink to support multiqueue c2a3de3 tuntap: Add multiqueue support e104583 Support num{tx,rx}queues and udp6zerocsum{tx,rx} bdf753e added support for Foo-over-UDP netlink calls aa48b8c Fix CalcRtable array parameter bug 63ca7e4 Support setting and retrieving route MTU/AdvMSS f7e518d add missing log import eb7ed87 Support LWTUNNEL_ENCAP_SEG6 6174cd8 Support invert in ip rules ae21927 Exclude linux specific test code from running on other platforms 09a4632 Properly use Skip() function, add -test.v when running tests a47a543 Allow to skip tests based on min kernel version required 71fa81e Expose xfrm state's current and window statistics c29ba20 added encapsulation attributes to Iptun added encapsulation attributes to Gretun implemented Sittun struct for supporting SIT tunnels 1272825 Fix index out of range when no metadata for gretap 0e3b74d replace syscall with golang.org/x/sys/unix Signed-off-by: Manohar Castelino <manohar.r.castelino@intel.com>
0829996
to
8fa3c35
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Add support for multiqueue tap for the bridge mode. This improves the multi-q performance of bridge mode. However macvtap mode is still faster. Explicitly create vhost fd's for macvtap. This unifies the macvtap and tap implementations. Fixes containers#247 Signed-off-by: Manohar Castelino <manohar.r.castelino@intel.com>
8fa3c35
to
aa91b93
Compare
Closing this to reopen it using a different branch as the CI keeps failing due to vendoring. |
Networking: Add support for multiqueue tap
Add support for multiqueue tap for the bridge mode.
This improves the multi-q performance of bridge mode.
However macvtap mode is still faster.
Fixes #247
Requires merge of vishvananda/netlink#293 followed by netlink revendoring