Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-22795

While vhost-user interface is transmitting packets, the VM will freeze if we reconnect the interface

    • None
    • Moderate
    • 1
    • rhel-sst-virtualization-networking
    • ssg_virtualization
    • None
    • QE ack
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • Virtio-Net Sprint 8 - December
    • None
    • None
    • x86_64
    • Linux
    • None

      What were you trying to do that didn't work?
      The VM freezes when vhost-user interface is reconneted when transmitting packets

      Please provide the package NVR for which bug is seen:
      5.14.0-411.el9.x86_64
      qemu-kvm-8.2.0-2.el9.x86_64
      libvirt-10.0.0-1.el9.x86_64

      How reproducible:
      100%

      Steps to reproduce
      1. start a ovs-dpdk whose queue number is 4

      # ovs-vsctl show 
      8ef054c6-9ebc-4f8c-bb14-ff093c9c5100
          Bridge ovsbr0
              datapath_type: netdev
              Port ovsbr0
                  Interface ovsbr0
                      type: internal
              Port dpdk0
                  Interface dpdk0
                      type: dpdk
                      options: {dpdk-devargs="0000:5e:00.0", n_rxq="4", n_txq="4"}
              Port vhost-user0
                  Interface vhost-user0
                      type: dpdkvhostuserclient
                      options: {vhost-server-path="/tmp/vhostuser0.sock"}
          Bridge ovsbr1
              datapath_type: netdev
              Port ovsbr1
                  Interface ovsbr1
                      type: internal
              Port vhost-user1
                  Interface vhost-user1
                      type: dpdkvhostuserclient
                      options: {vhost-server-path="/tmp/vhostuser1.sock"}
              Port dpdk1
                  Interface dpdk1
                      type: dpdk
                      options: {dpdk-devargs="0000:5e:00.1", n_rxq="4", n_txq="4"}
      

      2. start a VM with 4Q vhost-user interface

       <interface type='vhostuser'>
            <mac address='18:66:da:5f:dd:22'/>
            <source type='unix' path='/tmp/vhostuser0.sock' mode='server'/>
            <target dev='vhost-user0'/>
            <model type='virtio'/>
            <driver name='vhost' queues='4' rx_queue_size='1024' tx_queue_size='1024' iommu='on' ats='on'>
              <host mrg_rxbuf='on'/>
            </driver>
            <alias name='net1'/>
            <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
          </interface>
      
          <interface type='vhostuser'>
            <mac address='18:66:da:5f:dd:23'/>
            <source type='unix' path='/tmp/vhostuser1.sock' mode='server'/>
            <target dev='vhost-user1'/>
            <model type='virtio'/>
            <driver name='vhost' queues='4' rx_queue_size='1024' tx_queue_size='1024' iommu='on' ats='on'>
              <host mrg_rxbuf='on'/>
            </driver>
            <alias name='net2'/>
            <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
          </interface>
      

      3. start a dpdk-testpmd with in the VM

      # dpdk-testpmd  --socket-mem 1024 -l 1,2,3,4,5 --proc-type auto --file-prefix tx --  --port-topology=chained  --disable-rss -i --txq=4 --nb-cores=2 --auto-start --forward-mode=txonly
      

      4. do high-speed throughput tests against

      5. reconnect the ovs-dpdk on the host

      Expected results
      The VM works well

      Actual results
      The VM freezes

      Additional info:
      The ovs-dpdk script I used :

      #!/bin/bash
      set -e
      echo "killing old ovs process"
      pkill -f ovs-vswitchd || true
      sleep 5
      pkill -f ovsdb-server || true
      echo "probing ovs kernel module"
      modprobe -r openvswitch || true
      modprobe openvswitch
      
      echo "clean env"
      DB_FILE=/etc/openvswitch/conf.db
      rm -rf /var/run/openvswitch
      mkdir /var/run/openvswitch
      rm -f $DB_FILE
      echo "init ovs db and boot db server"
      export DB_SOCK=/var/run/openvswitch/db.sock
      ovsdb-tool create /etc/openvswitch/conf.db /usr/share/openvswitch/vswitch.ovsschema
      ovsdb-server --remote=punix:$DB_SOCK --remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach --log-file
      ovs-vsctl --no-wait init
      
      ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-socket-mem="1024,1024"
      ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-lcore-mask="0x1"
      ovs-vsctl --no-wait set Open_vSwitch . other_config:vhost-iommu-support=true
      ovs-vsctl --no-wait set Open_vSwitch . other_config:vhost-postcopy-support=true
      ovs-vsctl --no-wait set Open_vSwitch . other_config:pmd-cpu-mask=0x15554
      ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true
      ovs-vswitchd unix:$DB_SOCK --pidfile --detach --log-file=/var/log/openvswitch/ovs-vswitchd.log
      ovs-vsctl --if-exists del-br ovsbr0
      ovs-vsctl add-br ovsbr0 -- set bridge ovsbr0 datapath_type=netdev
      ovs-vsctl add-port ovsbr0 dpdk0 -- set Interface dpdk0 type=dpdk options:dpdk-devargs=0000:5e:00.0 options:n_rxq=4  options:n_txq=4 
      ovs-vsctl add-port ovsbr0 vhost-user0 -- set Interface vhost-user0 type=dpdkvhostuserclient options:vhost-server-path=/tmp/vhostuser0.sock
      ovs-ofctl del-flows ovsbr0
      ovs-ofctl add-flow ovsbr0 "in_port=1,idle_timeout=0 actions=output:2"
      ovs-ofctl add-flow ovsbr0 "in_port=2,idle_timeout=0 actions=output:1"
      ovs-vsctl --if-exists del-br ovsbr1
      ovs-vsctl add-br ovsbr1 -- set bridge ovsbr1 datapath_type=netdev
      ovs-vsctl add-port ovsbr1 dpdk1 -- set Interface dpdk1 type=dpdk options:dpdk-devargs=0000:5e:00.1   options:n_rxq=4  options:n_txq=4
      ovs-vsctl add-port ovsbr1 vhost-user1 -- set Interface vhost-user1 type=dpdkvhostuserclient options:vhost-server-path=/tmp/vhostuser1.sock
      ovs-ofctl del-flows ovsbr1
      ovs-ofctl add-flow ovsbr1 "in_port=1,idle_timeout=0 actions=output:2"
      ovs-ofctl add-flow ovsbr1 "in_port=2,idle_timeout=0 actions=output:1"
      

              lulu-redhat-name Cindy Lu
              yanghliu@redhat.com YangHang Liu
              Cindy Lu Cindy Lu
              YangHang Liu YangHang Liu
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: