Matej,

There has been a long standing issue with vhost-user reconnection to QEMU. I don't recall if the QEMU folks have committed a fix for that issue, but Matus Fabian worked on it when he first started working on VPP.

cc'ing Matus for his input.

Thanks,
-daw-

On 03/31/2017 05:02 AM, Matej Klotton -X (mklotton - PANTHEON TECHNOLOGIES at Cisco) wrote:

Hi all,

Does VPP support reconnect to existing qemu’s vhost user socket?

I configured vhost-user interface on VPP (client), I started qemu, I restarted VPP and reconfigured VPP.

Before restart packet was forwarded to the VM, after restart no packet received on the VM.

VPP config:

sw_interface_set_flags sw_if_index 1 admin-up

sw_interface_set_flags sw_if_index 2 admin-up

create_vhost_user_if socket /tmp/sock1

create_vhost_user_if socket /tmp/sock2

sw_interface_set_flags sw_if_index 5 admin-up

sw_interface_set_flags sw_if_index 6 admin-up

bridge_domain_add_del bd_id 101 flood 1 uu-flood 1 forward 1 learn 1 arp-term 0

bridge_domain_add_del bd_id 102 flood 1 uu-flood 1 forward 1 learn 1 arp-term 0

sw_interface_set_l2_bridge sw_if_index 5 bd_id 101 shg 0  enable

sw_interface_set_l2_bridge sw_if_index 6 bd_id 102 shg 0  enable

sw_interface_set_l2_bridge sw_if_index 1 bd_id 101 shg 0  enable

sw_interface_set_l2_bridge sw_if_index 2 bd_id 102 shg 0  enable

root@sut1:/home/cisco# /usr/bin/qemu-system-x86_64 -smp 1,sockets=1,cores=1,threads=1 -object memory-backend-file,id=mem,size=512M,mem-path=/mnt/huge,share=on -m 512 -numa node,memdev=mem -net user,hostfwd=tcp::10022-:22 -cpu host -daemonize -enable-kvm -machine pc,accel=kvm,usb=off,mem-merge=off -net nic,macaddr=52:54:00:00:01:ff -balloon none -chardev socket,id=char1,path=/tmp/sock1,server -netdev vhost-user,id=vhost1,chardev=char1,queues=1 -device virtio-net-pci,netdev=vhost1,mac=52:54:00:00:01:01,mq=on,csum=off,gso=off,guest_tso4=off,guest_tso6=off,guest_ecn=off,mrg_rxbuf=off -chardev socket,id=char2,path=/tmp/sock2,server -netdev vhost-user,id=vhost2,chardev=char2,queues=1 -device virtio-net-pci,netdev=vhost2,mac=52:54:00:00:01:02,mq=on,csum=off,gso=off,guest_tso4=off,guest_tso6=off,guest_ecn=off,mrg_rxbuf=off -drive file=/var/lib/vm/vhost-nested.img,format=raw,cache=none,if=virtio -qmp unix:/tmp/qmp1.sock,server,nowait -chardev socket,host=127.0.0.1,port=4556,id=gnc0,server,nowait -device isa-serial,chardev=gnc0 -chardev socket,path=/tmp/qga1.sock,server,nowait,id=qga0 -device isa-serial,chardev=qga0 -monitor none -display none -vga none -pidfile /tmp/qemu1.pid

QEMU waiting for connection on: disconnected:unix:/tmp/sock1,server

QEMU waiting for connection on: disconnected:unix:/tmp/sock2,server

root@sut1:/home/cisco#

vpp# show vhost-user VirtualEthernet0/0/0

Virtio vhost-user interfaces

Global:

  coalesce frames 32 time 1e-3

Interface: VirtualEthernet0/0/0 (ifindex 5)

virtio_net_hdr_sz 10

features mask (0xffffffffffffffff):

features (0x58600000):

   VIRTIO_NET_F_GUEST_ANNOUNCE (21)

   VIRTIO_NET_F_MQ (22)

   VIRTIO_F_ANY_LAYOUT (27)

   VIRTIO_F_INDIRECT_DESC (28)

   VHOST_USER_F_PROTOCOL_FEATURES (30)

  protocol features (0x3)

   VHOST_USER_PROTOCOL_F_MQ (0)

   VHOST_USER_PROTOCOL_F_LOG_SHMFD (1)

socket filename /tmp/sock1 type client errno "Success"

rx placement:

   thread 0 on vring 1

tx placement: lock-free

   thread 0 on vring 0

Memory regions (total 1)

region fd guest_phys_addr memory_size userspace_addr mmap_offset mmap_addr

====== ===== ================== ================== ================== ================== ==================

0 26 0x0000000000000000 0x0000000020000000 0x00007f3503200000 0x0000000000000000 0x00007ff944800000

Virtqueue 0 (TX)

  qsz 256 last_avail_idx 0 last_used_idx 0

  avail.flags 0 avail.idx 256 used.flags 1 used.idx 0

  kickfd 27 callfd 28 errfd -1

Virtqueue 1 (RX)

  qsz 256 last_avail_idx 0 last_used_idx 0

  avail.flags 0 avail.idx 0 used.flags 1 used.idx 0

  kickfd 22 callfd 29 errfd -1

root@sut1:/home/cisco# service vpp restart

vat# exec show vhost-user VirtualEthernet0/0/0

Virtio vhost-user interfaces

Global:

  coalesce frames 32 time 1e-3

Interface: VirtualEthernet0/0/0 (ifindex 5)

virtio_net_hdr_sz 0

features mask (0xffffffffffffffff):

features (0x0):

  protocol features (0x0)

socket filename /tmp/sock1 type client errno "Success"

rx placement:

tx placement: spin-lock

   thread 0 on vring 0

Memory regions (total 0)

vat#

vat# exec show ver

vpp v17.04-rc0~419-gdeee5ee~b4400 built by jenkins on ubuntu1604-basebuild-4c-4g-4199 at Sun Mar 12 23:22:32 UTC 2017

root@sut1:/home/cisco# qemu-system-x86_64 --version

QEMU emulator version 2.5.0 (Debian 1:2.5+dfsg-5ubuntu10.9), Copyright (c) 2003-2008 Fabrice Bellard

Thanks,

  Matej



_______________________________________________
csit-dev mailing list
[email protected]
https://lists.fd.io/mailman/listinfo/csit-dev


_______________________________________________
vpp-dev mailing list
[email protected]
https://lists.fd.io/mailman/listinfo/vpp-dev
  • [vpp-dev] No ... Matej Klotton -X (mklotton - PANTHEON TECHNOLOGIES at Cisco)
    • Re: [vpp... Dave Wallace
      • Re: ... Maciek Konstantynowicz (mkonstan)

Reply via email to