Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traffic-gen, customize-vm: Align with VM-under-test #224

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions vms/traffic-gen/scripts/customize-vm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ disable_services() {
done
}

# Setup hugepages in cmdline
setup_hugepages() {
mkdir -p /mnt/huge
echo "hugetlbfs /mnt/huge hugetlbfs defaults,pagesize=1GB 0 0" >> /etc/fstab

grubby --update-kernel=ALL --args="default_hugepagesz=1GB hugepagesz=1G hugepages=1"
}

# Enable unsafe noiommu mode
set_unsafe_no_io_mmu_mode() {
echo "options vfio enable_unsafe_noiommu_mode=1" > /etc/modprobe.d/vfio-noiommu.conf
}

# Install trex package
install_trex() {
local TREX_URL=https://trex-tgn.cisco.com/trex/release
Expand All @@ -44,20 +57,7 @@ install_trex() {
rm ${TREX_ARCHIVE_NAME}
}

# Setup hugepages in cmdline
setup_hugepages() {
mkdir -p /mnt/huge
echo "hugetlbfs /mnt/huge hugetlbfs defaults,pagesize=1GB 0 0" >> /etc/fstab

grubby --update-kernel=ALL --args="default_hugepagesz=1GB hugepagesz=1G hugepages=1"
}

# Enable unsafe noiommu mode
set_unsafe_no_io_mmu_mode() {
echo "options vfio enable_unsafe_noiommu_mode=1" > /etc/modprobe.d/vfio-noiommu.conf
}

disable_services
setup_hugepages
install_trex
set_unsafe_no_io_mmu_mode
install_trex
Loading