Whats new in Virtio 1.1? and surrounding areas Jens Freimann Red - - PowerPoint PPT Presentation

what s new in virtio 1 1
SMART_READER_LITE
LIVE PREVIEW

Whats new in Virtio 1.1? and surrounding areas Jens Freimann Red - - PowerPoint PPT Presentation

Whats new in Virtio 1.1? and surrounding areas Jens Freimann Red Hat FOSDEM 2018 What is Virtio? Easy mechanism to provide virtual devices to guests Disk, net, gpu, ... Standard driver means compatibility across hypervisors


slide-1
SLIDE 1

What’s new in Virtio 1.1?

… and surrounding areas

Jens Freimann Red Hat FOSDEM 2018

slide-2
SLIDE 2

What is Virtio?

  • Easy mechanism to provide virtual devices to guests

– Disk, net, gpu, ...

  • Standard driver means compatibility across hypervisors

and operating systems “The purpose of VIRTIO is to ensure that virtual environments and guests have a straightforward, efficient, standard, and extensible mechanism for virtual devices, rather than boutique per-environment or per-OS mechanisms.”

slide-3
SLIDE 3

Virtio and NFV

slide-4
SLIDE 4

Virtio components

PCI CCW MMIO Feature bits Config space Virtqueues net blk ... Device types Core Transport

slide-5
SLIDE 5

Virtio components

PCI CCW MMIO Feature bits Config space

Virtqueues

net blk ... Device types Core Transport

slide-6
SLIDE 6

Packed Virtqueues

  • Motivation

– Make it easier to implement virtio in hardware – Performance gains

  • Optimize ring layout
slide-7
SLIDE 7

Split virtqueue

Avail idx Used idx Avail ring head Descriptor (addr, len, next)

Available ring Used ring

  • Located in shared memory
  • Host and guest using

shared memory to pass messages

  • Possibly on different CPUs
  • Causing cache

synchronization

slide-8
SLIDE 8

Split virtqueue

Avail idx Used idx Avail ring head buffer

Available ring Used ring

  • Located in shared memory
  • Host and guest using

shared memory to pass messages

  • Possibly on different CPUs
  • Causing cache

synchronization Descriptor (addr, len, next)

slide-9
SLIDE 9

9

Reducing the overhead

  • Information is spread across too many data

structures

  • Tighter packing will save cache misses.
  • How about packing everything in a single data

structure?

slide-10
SLIDE 10

10

Descriptor ring

  • Driver writes out available descriptors in a ring
  • Device writes out used descriptors in the same

ring

  • Descriptor: addr, len, avail, used
  • To mark a descriptor available, flip the avail bit
  • To mark a descriptor as used, flip the used bit
slide-11
SLIDE 11

11

Descriptor states

Driver Device 1 1

Write desc, set flags Avail=1, Used=0 Write desc, set flags Avail=0, Used=0 Available wrap counter = 0 Used wrap counter = 0

slide-12
SLIDE 12

12

Descriptor states

Driver Device 1 1

Write desc, set flags Avail=0, Used=1 Write desc, set flags Avail=1, Used=1 Available wrap counter = 1 Used wrap counter = 1

Ring wraps around

slide-13
SLIDE 13

13

Performance

  • PVP test setup as described in

http://www.dpdk.org/doc/guides/howto/pvp_reference_ben chmark.html

  • CPU: Intel(R) Xeon(R) CPU E5-2667 v4 @ 3.20GHz
  • Host and Guest: RHEL 7.4
  • Packet generator: T-REX
  • Acceptable loss: 0.05%
  • DPDK v17.11
  • Patches at https://github.com/jensfr/dpdk/tree/virtio-1.1-v1
slide-14
SLIDE 14

14

Performance – 64 byte packet throughput

Mpps 16 17 18 19 20 21 22 23 virtio 1.0 virtio 1.1

slide-15
SLIDE 15

15

Participate in Virtio

  • git clone https://github.com/oasis-tcs/virtio-spec

Edit :)

  • sh makeall.sh (needs xelatex, e.g. from texlive)
  • virtio-comment-subscribe@lists.oasis-open.org
  • Patch: virtio-comment@lists.oasis-open.org
  • If no comments – email, ask for a vote ballot
  • Total time: up to 2 weeks
slide-16
SLIDE 16

16

Participate in Virtio

  • git clone https://github.com/oasis-tcs/virtio-spec

Edit :)

  • sh makeall.sh (needs xelatex, e.g. from texlive)
  • virtio-comment-subscribe@lists.oasis-open.org
  • Patch: virtio-comment@lists.oasis-open.org
  • If no comments – email, ask for a vote ballot
  • Total time: up to 2 weeks
slide-17
SLIDE 17

17

vDPA – virtual Datapath Accelerator

https://events.static.linuxfound.org/sites/events/files/slides/KVM17%27- vDPA.pdf

slide-18
SLIDE 18

18

vDPA – virtual Datapath Accelerator

https://events.static.linuxfound.org/sites/events/files/slides/KVM17%27- vDPA.pdf

slide-19
SLIDE 19

19

vDPA – virtual Datapath Accelerator

https://events.static.linuxfound.org/sites/events/files/slides/KVM17%27- vDPA.pdf

slide-20
SLIDE 20

20

Vhost-pci – Fast VM-to-VM communication

http://www.linux-kvm.org/images/5/55/02x07A-Wei_Wang-Design_of-Vhost-pci.pdf

slide-21
SLIDE 21

21

Vhost-pci – Fast VM-to-VM communication

http://www.linux-kvm.org/images/5/55/02x07A-Wei_Wang-Design_of-Vhost-pci.pdf

slide-22
SLIDE 22

22

virtio-vhost-user

  • Slightly different approach to vhost-pci but same goal
  • Lets guests act as vhost device backends

– Virtual network appliances can provide virtio devices to

  • ther guests

– Provide high-performance vhost-user appliances to other

guests in the same cloud environment

  • Exitless fast VM-to-VM communication

– With poll mode drivers, even with interrupts fast because

  • f ioeventfds

https://wiki.qemu.org/Features/VirtioVhostUser

slide-23
SLIDE 23

23

virtio-vhost-user

https://wiki.qemu.org/Features/VirtioVhostUser VM 1 VM 2 vhost device backend virtio- vhost-user QEMU vhost-user QEMU virtio-net

slide-24
SLIDE 24

24

virtio-vhost-user

https://wiki.qemu.org/Features/VirtioVhostUser VM 1 VM 2 vhost device backend virtio- vhost-user QEMU vhost-user QEMU virtio-net

slide-25
SLIDE 25

25

Transparent bonding for SR-IOV devices

  • Bond a virtio device and a SR-IOV device

– When virtio and SR-IOV drivers load, look for other

NIC that matches MAC address

– Enslave NIC and bring up the slave

  • Switch over to virtio device before migration

– Link of SR-IOV device goes down

  • On target system switch back to SR-IOV device

(if available, virtio as fallback)

slide-26
SLIDE 26

26

Conclusion

  • Virtio 1.1 will be a big release, focus on

– Performance – Hardware implementation – DPDK implemenation of packed virtqueues:

<insert link>

– There is a monthly DPDK Virtio meeting where we

discuss progress, let me know if you’d like to join. jfreimann@redhat.com

slide-27
SLIDE 27

27

Questions?

jfreimann@redhat.com