diff options
author | Xiong Zhang <xiong.y.zhang@intel.corp-partner.google.com> | 2020-02-13 19:36:49 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-04-04 05:57:05 +0000 |
commit | 4cbcc26f5c34d8254a9f98e065a923abb194ba8b (patch) | |
tree | 5f68084f0bbca71efbabb5996b79813d7eccd04b /src/plugin | |
parent | 664cc3ca49cb58d5bf7d936686fd211d6dd728bf (diff) | |
download | crosvm-4cbcc26f5c34d8254a9f98e065a923abb194ba8b.tar crosvm-4cbcc26f5c34d8254a9f98e065a923abb194ba8b.tar.gz crosvm-4cbcc26f5c34d8254a9f98e065a923abb194ba8b.tar.bz2 crosvm-4cbcc26f5c34d8254a9f98e065a923abb194ba8b.tar.lz crosvm-4cbcc26f5c34d8254a9f98e065a923abb194ba8b.tar.xz crosvm-4cbcc26f5c34d8254a9f98e065a923abb194ba8b.tar.zst crosvm-4cbcc26f5c34d8254a9f98e065a923abb194ba8b.zip |
Virtio-net: Add multi queues in multi threads
In order to support 2 vq pairs for virtio-net, this patch create 2 sockets in one tap interface, 2 vq pairs(rx/tx) and 2 threads in device model, So one vq pair has one thread and one socket in tap corresponding. On my SkyLake desktop with crosvm and ubuntu 18.04 guest: If run one iperf server on host and one iperf client in guest, 2 vq pairs has the same netwrok bandwidth as 1 vq pair, the bandwidth is 5.99Gbits/sec If run two iperf server on host and two iperf client in guest, In 1 vq pair mode, two iperf cliens bandwidth are 3.19Gbits/sec and 3.18Gbits/sec. In 2 vq pairs mode, two iperf clients bandwidth are 4.87Gbits/sec and 4.86Gbits/sec. So 2 vq pairs improve net bandwidth 52.7% compared with 1 vq pair in this case. BUG=chromium:1064482 TEST=Run iperf test in guest Change-Id: I1fa14d7e24085552dc828a89a883d4a2ada34789 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2099754 Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Xiong Zhang <xiong.y.zhang@intel.corp-partner.google.com> Reviewed-by: Stephen Barber <smbarber@chromium.org>
Diffstat (limited to 'src/plugin')
-rw-r--r-- | src/plugin/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugin/mod.rs b/src/plugin/mod.rs index 1c7027f..ae7e19c 100644 --- a/src/plugin/mod.rs +++ b/src/plugin/mod.rs @@ -662,7 +662,7 @@ pub fn run_config(cfg: Config) -> Result<()> { if let Some(host_ip) = cfg.host_ip { if let Some(netmask) = cfg.netmask { if let Some(mac_address) = cfg.mac_address { - let tap = Tap::new(false).map_err(Error::TapOpen)?; + let tap = Tap::new(false, false).map_err(Error::TapOpen)?; tap.set_ip_addr(host_ip).map_err(Error::TapSetIp)?; tap.set_netmask(netmask).map_err(Error::TapSetNetmask)?; tap.set_mac_address(mac_address) |