Skip to content

Commit

Permalink
Merge pull request #224 from orelmisan/reorder-traffic-gen-customize-vm
Browse files Browse the repository at this point in the history
Traffic-gen, customize-vm: Align with VM-under-test
  • Loading branch information
RamLavi authored Jan 25, 2024
2 parents 475bf7a + 2e4df10 commit 6561c9a
Showing 1 changed file with 14 additions and 14 deletions.
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

0 comments on commit 6561c9a

Please sign in to comment.