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

[RFE][vDPA] VM with vdpa interface can start successfully with different settings from libvirt and vdpa tool

    • rhel-sst-virtualization-networking
    • ssg_virtualization
    • 1
    • False
    • Hide

      None

      Show
      None
    • None
    • Virtio-Net Sprint 3 - July, Virtio-Net Sprint 4 - August, Virtio-Net Sprint 4 - August 2
    • None
    • None
    • If docs needed, set a value
    • None

      Description of problem:
      VM with vdpa interface can start successfully with different settings from libvirt and vdpa tool

      Version-Release number of selected component (if applicable):
      libvirt-8.9.0-2.el9.x86_64
      qemu-kvm-7.1.0-5.el9.x86_64

      How reproducible:
      100%

      Steps to Reproduce:
      Vdpa tool can set the mac and queue size for the vdpa device. But for vhost-vdpa, when we use libvirt to start the guest, libvirt can set mac and queue size as well. Only the values set by the vdpa tool will be honored in the guest’s os. If the two settings are different, it can be confusing and different mac setting will break the VM networking.

      1. Start a vm with vdpa interface set as below:
      (the vdpa device initialized by vdpa tool was set by "vdpa dev add name vdpa0 mgmtdev pci/$pci_addr mac 00:11:22:33:44:00 max_vqp 8")

      # virsh dumpxml vdpa | grep /interface -B7
          <interface type='vdpa'>
            <mac address='52:54:00:9a:aa:31'/>
            <source dev='/dev/vhost-vdpa-0'/>
            <model type='virtio'/>
            <driver queues='4'/>
            <alias name='net0'/>
            <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
          </interface>
      PS: libvirt will generate a random mac address if not it is not set
      
      # virsh domiflist vdpa
       Interface   Type   Source              Model    MAC
      --------------------------------------------------------------------
       -           vdpa   /dev/vhost-vdpa-0   virtio   52:54:00:9a:aa:31
      
      Qemu cmd line:
      -add-fd set=0,fd=24,opaque=net0-vdpa \
      -netdev vhost-vdpa,vhostdev=/dev/fdset/0,queues=4,id=hostnet0 \
      -device '{"driver":"virtio-net-pci","mq":true,"vectors":10,"netdev":"hostnet0","id":"net0","mac":"52:54:00:9a:aa:31","bus":"pci.1","addr":"0x0"}' \
      
      # vdpa -jp dev config show
      {
          "config": {
              "vdpa0": {
                  "mac": "00:11:22:33:44:00",
                  "link ": "up",
                  "link_announce ": false,
                  "max_vq_pairs": 8,
                  "mtu": 1500,
                  "negotiated_features": [ "CSUM","GUEST_CSUM","HOST_TSO4","HOST_TSO6","STATUS","CTRL_VQ","MQ","CTRL_MAC_ADDR","VERSION_1","ACCESS_PLATFORM" ]
              }
          }
      }
      

      2. Start the vm, and check on guest, the value set by vdpa tool will be honored

      # ip l show enp1s0
      2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
          link/ether 00:11:22:33:44:00 brd ff:ff:ff:ff:ff:ff
      
      # ethtool -l enp1s0
      Channel parameters for enp1s0:
      Pre-set maximums:
      RX:		n/a
      TX:		n/a
      Other:		n/a
      Combined:	8
      Current hardware settings:
      RX:		n/a
      TX:		n/a
      Other:		n/a
      Combined:	8
      

      Actual results:
      If we set a different queue size or mac address with the vdpa tool for the vdpa interface, the vm can start successfully, but libvirt settings will not be honored. It can be confusing.

      Expected results:
      The vm fail to start if the settings from libvirt and vdpa tool are different

      Additional info:

              lulu-redhat-name Cindy Lu
              yalzhang@redhat.com Yalan Zhang
              Cindy Lu Cindy Lu
              Lei Yang Lei Yang
              Votes:
              0 Vote for this issue
              Watchers:
              15 Start watching this issue

                Created:
                Updated: