Skip to content

Commit

Permalink
Increate dma_entry_limit for TDX vfio_net_boot cases without iommufd
Browse files Browse the repository at this point in the history
Signed-off-by: Farrah Chen <[email protected]>
  • Loading branch information
fanchen2 authored and xhao22 committed Dec 10, 2024
1 parent 3667ec2 commit fd655e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions KVM/qemu/tests/vfio_net_boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

from virttest import error_context, utils_net

from avocado.utils import process
from avocado.core import exceptions
from provider import hostdev
from provider.hostdev import utils as hostdev_utils
from provider.hostdev.dev_setup import hostdev_setup
Expand All @@ -31,6 +33,12 @@ def run(test, params, env):
:type env: virttest.utils_env.Env
"""
ip_version = params["ip_version"]
vm_type = params.get("vm_secure_guest_type")
if not params.get("vm_hostdev_iommufd") and vm_type == "tdx":
dma_entry_limit_cmd = params.get("dma_cmd")
status = process.system(dma_entry_limit_cmd, shell=True)
if status:
raise exceptions.TestError("Failed to increase dma_entry_limit.")
with hostdev_setup(params) as params:
hostdev_driver = params.get("vm_hostdev_driver", "vfio-pci")
assignment_type = params.get("hostdev_assignment_type")
Expand Down
1 change: 1 addition & 0 deletions KVM/qemu/vfio_net_boot.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- ipv4:
variants:
- @default:
dma_cmd = "echo 0x200000 > /sys/module/vfio_iommu_type1/parameters/dma_entry_limit"
- iommufd:
vm_hostdev_iommufd = iommufd0
variants:
Expand Down

0 comments on commit fd655e1

Please sign in to comment.