Skip to content

Commit

Permalink
Merge branch 'master' into IPU_9_to_10
Browse files Browse the repository at this point in the history
  • Loading branch information
MiriamDeng authored Nov 15, 2024
2 parents a3da8f2 + 21d9934 commit c778d5e
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 10 deletions.
20 changes: 16 additions & 4 deletions generic/tests/pktgen_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,19 @@ def init_vm_and_login(test, params, env, result_file, pktgen_runner):
_pin_vm_threads(params.get("numa_node"))
guest_ver = session_serial.cmd_output(guest_ver_cmd)
result_file.write("### guest-kernel-ver :%s" % guest_ver)

if pktgen_runner.is_version_lt_rhel7(session_serial.cmd("uname -r")):
pktgen_runner.install_package(
guest_ver.strip(), vm=vm, session_serial=session_serial
)
if guest_ver.count("64k"):
pktgen_runner.install_package(
guest_ver.strip(),
pagesize="64k",
vm=vm,
session_serial=session_serial,
)
else:
pktgen_runner.install_package(
guest_ver.strip(), vm=vm, session_serial=session_serial
)
return vm, session_serial

# get parameter from dictionary
Expand All @@ -97,7 +106,10 @@ def init_vm_and_login(test, params, env, result_file, pktgen_runner):

pktgen_runner = pktgen_utils.PktgenRunner()
if pktgen_runner.is_version_lt_rhel7(process.getoutput("uname -r")):
pktgen_runner.install_package(host_ver)
if host_ver.count("64k"):
pktgen_runner.install_package(host_ver, pagesize="64k")
else:
pktgen_runner.install_package(host_ver)

vdpa_net_test = None
vm = None
Expand Down
7 changes: 5 additions & 2 deletions provider/pktgen_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,14 @@ def run_test(self, script, cmd, runner, interface, timeout):
mpps_results = "%.2f" % mpps_results
return mpps_results

def install_package(self, ver, vm=None, session_serial=None):
def install_package(self, ver, pagesize=None, vm=None, session_serial=None):
"""Check module pktgen, install kernel-modules-internal package"""

output_cmd = process.getoutput
kernel_ver = "kernel-modules-internal-%s" % ver
if pagesize:
kernel_ver = "kernel-%s-modules-internal-%s" % (pagesize, ver.split("+")[0])
else:
kernel_ver = "kernel-modules-internal-%s" % ver
cmd_download = "cd /tmp && brew download-build %s --rpm" % kernel_ver
cmd_install = "cd /tmp && rpm -ivh %s.rpm --force --nodeps" % kernel_ver
output_cmd(cmd_download)
Expand Down
4 changes: 4 additions & 0 deletions provider/virt_storage/storage_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ def refresh_protocol_by_params(self, params):
discard = params.get("image_discard_request", "unmap")
self.protocol.set_param("auto-read-only", auto_readonly)
self.protocol.set_param("discard", discard)
# image_aio:native requires cache.direct:on
if params.get("image_aio") == "native":
self.protocol.set_param("cache.direct", "on")
self.protocol.set_param("cache.no-flush", "off")

def info(self):
out = dict()
Expand Down
9 changes: 7 additions & 2 deletions qemu/tests/block_with_iommu.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def run(test, params, env):
1. Add "intel_iommu=on" to kernel line of q35 guest.
2. Boot a guest with virtio-scsi with iommu_platform=on.
3. Verify IOMMU enabled in the guest.
4. Reload kernel then reboot guest.
4. Execute a simple I/O in the disk
5. Reload kernel then reboot guest.
:param test: QEMU test object.
:param params: Dictionary with the test parameters.
Expand Down Expand Up @@ -60,6 +61,10 @@ def verify_iommu_enabled():
session = vm.wait_for_login(timeout=360)
verify_iommu_enabled()

session.cmd(params.get("dd_cmd"))

if params.get("reload_kernel_cmd"):
reload_kernel(session)
vm.reboot(session)

session = vm.reboot(session, timeout=360)
session.cmd(params.get("dd_cmd"))
1 change: 1 addition & 0 deletions qemu/tests/cfg/block_with_iommu.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
virtio_dev_disable_modern = off
check_key_words = "DMAR: IOMMU enabled;"
check_key_words += "DMAR: Intel(R) Virtualization Technology for Directed I/O"
dd_cmd = "dd if=/dev/urandom of=/home/dd_test oflag=direct bs=1M count=10"
variants:
- @default:
- reload_kernel:
Expand Down
4 changes: 2 additions & 2 deletions qemu/tests/cfg/hotplug_mem_simple.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
- hotplug_mem_simple:
type = hotplug_mem_simple
mem = 2048
mem = 4096
slots_mem = 1
maxmem_mem = 4096M
maxmem_mem = 8192M
guest_numa_nodes = "node0"
mem_devs = "mem0"
use_mem_mem0 = "no"
Expand Down
1 change: 1 addition & 0 deletions qemu/tests/cfg/rh_kselftests_vm.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
s390x:
kvm_module_parameters = 'hpage=1'
whitelist = "hugetlb_fault_after_madv"
vm_mem_share = yes
setup_hugepages = yes
tests_execution_cmd = "cd ${kselftests_path}/mm && sh run_vmtests.sh -t hugetlb"
9 changes: 9 additions & 0 deletions qemu/tests/cfg/vfio_net_boot.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
variants ip_version:
- ipv4:
- ipv6:
variants:
- @default:
# multi hostdev will be bound to the same iommufd
- iommufd:
vm_hostdev_iommufd = iommufd0
# multi hostdev will be bound to different iommufd
- multi_iommufd:
vm_hostdev_iommufd_hostdev1 = iommufd0
vm_hostdev_iommufd_hostdev2 = iommufd1
variants:
- @default:
- virtio_iommu:
Expand Down

0 comments on commit c778d5e

Please sign in to comment.