FIX: VHOST vpp 24/25824/6
authorPeter Mikus <pmikus@cisco.com>
Thu, 12 Mar 2020 13:18:18 +0000 (13:18 +0000)
committerPeter Mikus <pmikus@cisco.com>
Tue, 17 Mar 2020 11:55:42 +0000 (11:55 +0000)
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Change-Id: Id0d41a2e62ee6cce212fb2c09a0357d794426a00

resources/libraries/python/QemuManager.py
resources/libraries/python/QemuUtils.py
resources/libraries/robot/l2/l2_xconnect.robot
resources/templates/vm/init.sh

index c55e5af..a9b1b64 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -62,8 +62,8 @@ class QemuManager:
             for nf_node in range(1, nf_nodes + 1):
                 qemu_id = (nf_chain - 1) * nf_nodes + nf_node
                 name = f"{node}_{qemu_id}"
-                sock1 = f"/var/run/vpp/sock-{qemu_id}-1"
-                sock2 = f"/var/run/vpp/sock-{qemu_id}-2"
+                sock1 = f"/run/vpp/sock-{qemu_id}-1"
+                sock2 = f"/run/vpp/sock-{qemu_id}-2"
                 idx1 = (nf_chain - 1) * nf_nodes * 2 + nf_node * 2 - 1
                 vif1_mac = Topology.get_interface_mac(
                     self.nodes[node], f"vhost{idx1}"
index b1b6008..0113dc9 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -68,14 +68,10 @@ class QemuUtils:
             self._opt[u"machine_args"] = \
                 u"virt,accel=kvm,usb=off,mem-merge=off,gic-version=3"
             self._opt[u"console"] = u"ttyAMA0"
-            self._opt[u"unsafe_iommu"] = u"echo Y > /sys/module/vfio/para" \
-                                         u"meters/enable_unsafe_noiommu_mode"
         else:
             dpdk_target = u"x86_64-native"
             self._opt[u"machine_args"] = u"pc,accel=kvm,usb=off,mem-merge=off"
             self._opt[u"console"] = u"ttyS0"
-            self._opt[u"unsafe_iommu"] = u""
-
         self._testpmd_path = f"{Constants.QEMU_VM_DPDK}/" \
             f"{dpdk_target}-linux-gcc/app"
         self._vm_info = {
@@ -99,11 +95,11 @@ class QemuUtils:
         self._opt[u"vnf"] = vnf
         # Temporary files.
         self._temp = dict()
-        self._temp[u"pidfile"] = f"/var/run/qemu_{qemu_id}.pid"
+        self._temp[u"pidfile"] = f"/run/qemu_{qemu_id}.pid"
         if img == Constants.QEMU_VM_IMAGE:
             self._opt[u"vm_type"] = u"nestedvm"
-            self._temp[u"qmp"] = f"/var/run/qmp_{qemu_id}.sock"
-            self._temp[u"qga"] = f"/var/run/qga_{qemu_id}.sock"
+            self._temp[u"qmp"] = f"/run/qmp_{qemu_id}.sock"
+            self._temp[u"qga"] = f"/run/qga_{qemu_id}.sock"
         elif img == Constants.QEMU_VM_KERNEL:
             self._opt[u"img"], _ = exec_cmd_no_error(
                 node, f"ls -1 {Constants.QEMU_VM_KERNEL}* | tail -1",
@@ -237,8 +233,8 @@ class QemuUtils:
         if not kwargs[u"jumbo_frames"]:
             vpp_config.add_dpdk_no_multi_seg()
             vpp_config.add_dpdk_no_tx_checksum_offload()
-        vpp_config.add_plugin(u"disable", [u"default"])
-        vpp_config.add_plugin(u"enable", [u"dpdk_plugin.so"])
+        vpp_config.add_plugin(u"disable", u"default")
+        vpp_config.add_plugin(u"enable", u"dpdk_plugin.so")
         vpp_config.write_config(startup)
 
         # Create VPP running configuration.
@@ -327,8 +323,7 @@ class QemuUtils:
             self.create_kernelvm_config_testpmd_mac(**kwargs)
         else:
             raise RuntimeError(u"QEMU: Unsupported VNF!")
-        self.create_kernelvm_init(vnf_bin=self._opt.get(u"vnf_bin"),
-                                  unsafe_iommu=self._opt.get(u"unsafe_iommu"))
+        self.create_kernelvm_init(vnf_bin=self._opt.get(u"vnf_bin"))
 
     def get_qemu_pids(self):
         """Get QEMU CPU pids.
@@ -430,7 +425,6 @@ class QemuUtils:
             f"addr={self._vhost_id+5}.0,mq=on,vectors={2 * queues + 2},"
             f"csum={u'on' if csum else u'off'},gso={u'on' if gso else u'off'},"
             f"guest_tso4=off,guest_tso6=off,guest_ecn=off,"
-            f"mrg_rxbuf={u'on,host_mtu=9200' if jumbo_frames else u'off'},"
             f"{queue_size}"
         )
 
index c929bed..efe148c 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
 | | [Arguments] | ${dut} | ${nf_nodes}=${1}
 | |
 | | FOR | ${number} | IN RANGE | 1 | ${nf_nodes}+1
-| | | ${sock1}= | Set Variable | /var/run/vpp/sock-${number}-1
-| | | ${sock2}= | Set Variable | /var/run/vpp/sock-${number}-2
+| | | ${sock1}= | Set Variable | /run/vpp/sock-${number}-1
+| | | ${sock2}= | Set Variable | /run/vpp/sock-${number}-2
 | | | ${prev_index}= | Evaluate | ${number}-1
 | | | Configure vhost interfaces | ${nodes['${dut}']}
 | | | ... | ${sock1} | ${sock2} | ${dut}-vhost-${number}-if1
 | | ... | ${dut1} | ${subif_index_1} | TAG_REWRITE_METHOD=${tag_rewrite}
 | |
 | | Configure vhost interfaces
-| | ... | ${dut1} | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
+| | ... | ${dut1} | /run/vpp/sock-1-1 | /run/vpp/sock-1-2
 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${vhost_if1}
 | | Configure L2XC | ${dut1} | ${subif_index_1} | ${vhost_if2}
 | |
 | | Run Keyword If | '${dut2_status}' == 'PASS'
 | | ... | Configure vhost interfaces
-| | ... | ${dut2} | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
+| | ... | ${dut2} | /run/vpp/sock-1-1 | /run/vpp/sock-1-2
 | | Run Keyword If | '${dut2_status}' == 'PASS'
 | | ... | Configure L2XC | ${dut2} | ${subif_index_2} | ${vhost_if1}
 | | Run Keyword If | '${dut2_status}' == 'PASS'
 | | ... | ${dut1} | ${subif_index_1} | ${dut2} | ${subif_index_2}
 | | ... | ${tag_rewrite}
 | | Configure vhost interfaces
-| | ... | ${dut1} | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
+| | ... | ${dut1} | /run/vpp/sock-1-1 | /run/vpp/sock-1-2
 | | Configure L2XC | ${dut1} | ${dut1_if1} | ${vhost_if1}
 | | Configure L2XC | ${dut1} | ${subif_index_1} | ${vhost_if2}
 | | Configure vhost interfaces
-| | ... | ${dut2} | /var/run/vpp/sock-1-1 | /var/run/vpp/sock-1-2
+| | ... | ${dut2} | /run/vpp/sock-1-1 | /run/vpp/sock-1-2
 | | Configure L2XC | ${dut2} | ${subif_index_2} | ${vhost_if1}
 | | Configure L2XC | ${dut2} | ${dut2_if2} | ${vhost_if2}
 
index 0cf216e..8edb40f 100644 (file)
@@ -5,7 +5,7 @@ mount -t devpts -o "rw,noexec,nosuid,gid=5,mode=0620" devpts /dev/pts || true
 mount -t tmpfs -o "rw,noexec,nosuid,size=10%,mode=0755" tmpfs /run
 mount -t tmpfs -o "rw,noexec,nosuid,size=10%,mode=0755" tmpfs /tmp
 mount -t hugetlbfs -o "rw,relatime,pagesize=2M" hugetlbfs /dev/hugepages
-${unsafe_iommu}
+echo Y > /sys/module/vfio/parameters/enable_unsafe_noiommu_mode
 echo 0000:00:06.0 > /sys/bus/pci/devices/0000:00:06.0/driver/unbind
 echo 0000:00:07.0 > /sys/bus/pci/devices/0000:00:07.0/driver/unbind
 echo vfio-pci > /sys/bus/pci/devices/0000:00:06.0/driver_override