def create_vm_base(): base = QemuNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") base.bootwait = 30 base.netserver_core = 3 # base.netserver_nice = -10 base.mem = 1024 * 6 return base
def main(trace=False): vm = QemuNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") vm.ethernet_dev = vm.QEMU_VIRTIO if trace: vm.exe = ORIG_QEMU_TRACE vm.setup() vm.run() input("Press any enter to close VM") vm.teardown()
def create_vms(): base = QemuNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_baseline = deepcopy(base) e1000_baseline.ethernet_dev = e1000_baseline.QEMU_E1000 e1000_baseline.name = "E1000-baseline" e1000_best_orig_driver = QemuE1000NG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_best_orig_driver.name = "E1000-original" e1000_best_orig_driver.is_io_thread_nice = False e1000_best_orig_driver.e1000_options["NG_interrupt_mul"] = 10 e1000_best_orig_driver.e1000_options["NG_interrupt_mode"] = 0 e1000_best_orig_driver.bootwait = 10 e1000_clean_tx = deepcopy(e1000_best_orig_driver) e1000_clean_tx.kernel_cmdline_additional = "e1000.NG_flags=2" e1000_clean_tx.name = "E1000-clean_tx" e1000_skb_orphan = deepcopy(e1000_best_orig_driver) e1000_skb_orphan.kernel_cmdline_additional = "e1000.NG_flags=1" e1000_skb_orphan.name = "E1000-skb_orphan" e1000_both = deepcopy(e1000_best_orig_driver) e1000_both.kernel_cmdline_additional = "e1000.NG_flags=3" e1000_both.name = "E1000-both" return (e1000_baseline, e1000_best_orig_driver, e1000_clean_tx, e1000_skb_orphan, e1000_both)
def create_vms(): base = QemuNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_baseline = deepcopy(base) e1000_baseline.ethernet_dev = e1000_baseline.QEMU_E1000 e1000_baseline.name = "E1000-baseline" virtio = deepcopy(base) virtio.ethernet_dev = virtio.QEMU_VIRTIO virtio.name = "virtio" virtio_vhost = deepcopy(virtio) virtio_vhost.name += "_vhost" virtio_vhost.vhost = True virtio_batch = deepcopy(virtio) virtio_batch.name = "virtio_batch" virtio_batch.e1000_options["NG_notify_batch"] = "on" e1000_para_halt = QemuE1000NGBest(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_para_halt.name = "e1000-parahalt" regular_vms = [ # e1000_baseline, virtio, #virtio_batch, #e1000_para_halt, ] return tuple(regular_vms)
def create_vms(): base = QemuNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_baseline = deepcopy(base) e1000_baseline.ethernet_dev = e1000_baseline.QEMU_E1000 e1000_baseline.name = "E1000-baseline" e1000_best_interrupt = QemuE1000NG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_best_interrupt.name = "E1000-int_mul" e1000_best_interrupt.is_io_thread_nice = False # e1000_best_interrupt.kernel = r"../linux/arch/x86/boot/bzImage" # e1000_best_interrupt.initrd = r"/homes/bdaviv/repos/msc-ng/vm-files/kernels/initrd.img-4.14.4-ng+" e1000_best_interrupt.e1000_options["NG_interrupt_mul"] = 10 e1000_best_interrupt.e1000_options["NG_interrupt_mode"] = 0 e1000_best_interrupt.bootwait = 10 e1000_best_lq = deepcopy(e1000_best_interrupt) e1000_best_lq.name = "e1000-int_mul-largeQ" e1000_best_lq.large_queue = True # e1000_best_lq.static_itr = True e1000_skb_orphan = deepcopy(e1000_best_interrupt) e1000_skb_orphan.kernel_cmdline_additional = "e1000.NG_flags=1" e1000_skb_orphan.name = "E1000-skb_orphan" e1000_timer_itr = deepcopy(e1000_skb_orphan) e1000_timer_itr.e1000_options["NG_interrupt_mode"] = 2 e1000_timer_itr.name = "E1000-timer_itr" # e1000_timer_itr.e1000_options["NG_parabatch"] = "on" e1000_timer_itr_lq_4096 = deepcopy(e1000_timer_itr) e1000_timer_itr_lq_4096.name = "E1000-timer_itr-lq1024" e1000_timer_itr_lq_4096.large_queue = True e1000_timer_itr_lq_4096.queue_size = 4096 e1000_timer_itr_parabatch = deepcopy(e1000_skb_orphan) e1000_timer_itr_parabatch.e1000_options["NG_interrupt_mode"] = 2 e1000_timer_itr_parabatch.name = "E1000-timer_itr-parabatch" e1000_timer_itr_parabatch.e1000_options["NG_parabatch"] = "on" # e1000_timer_itr_parabatch.large_queue = True # e1000_timer_itr_parabatch.queue_size = 4096 e1000_delay_timer = list() for i in range(610, 1400, 100): vm = deepcopy(e1000_timer_itr) vm.e1000_options["NG_interrupt_min"] = i vm.name = "e1000_delay_{}".format(i) e1000_delay_timer.append(vm) return e1000_delay_timer
def create_vms(): OLD_QEMU = r"../qemu/build/qemu-system-x86_64" OLD_KERNEL = r"/home/bdaviv/repos/e1000-improv/linux-3.13.0/arch/x86/boot/bzImage" OLD_INITRD = r"../vms/initrd.img" base_machine = QemuNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") base_machine.ethernet_dev = base_machine.QEMU_VIRTIO # e1000_QnGn_better = deepcopy(base_machine) # e1000_QnGn_better.name = "QnGn-newer" # e1000_QnGn_better.ethernet_dev = e1000_QnGn_better.QEMU_E1000_BETTER virtio_QnGn = deepcopy(base_machine) virtio_QnGn.name = "QnGn" virtio_QnGo = deepcopy(base_machine) virtio_QnGo.name = 'QnGo' virtio_QnGo.kernel = OLD_KERNEL virtio_QnGo.initrd = OLD_INITRD virtio_QoGn = deepcopy(base_machine) virtio_QoGn.name = 'QoGn' virtio_QoGn.bootwait = 30 virtio_QoGn.exe = OLD_QEMU virtio_QoGo = deepcopy(base_machine) virtio_QoGo.name = 'QoGo' virtio_QoGo.bootwait = 30 virtio_QoGo.exe = OLD_QEMU virtio_QoGo.kernel = OLD_KERNEL virtio_QoGo.initrd = OLD_INITRD return ( # e1000_QnGn_better, virtio_QnGn, virtio_QnGo, virtio_QoGn, virtio_QoGo)
def create_vms(): base = QemuNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_baseline = deepcopy(base) e1000_baseline.ethernet_dev = e1000_baseline.QEMU_E1000 e1000_baseline.name = "E1000-baseline" virtio = deepcopy(base) virtio.ethernet_dev = virtio.QEMU_VIRTIO virtio.name = "virtio" virtio_batch = deepcopy(virtio) virtio_batch.name = "virtio_batch" virtio_batch.e1000_options["NG_notify_batch"] = "on" e1000_para_halt = QemuE1000NGBest(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_para_halt.name = "e1000-parahalt" e1000_adaptive = QemuE1000NGAdaptive(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_adaptive.name = "e1000-adaptive" e1000_adaptive1 = deepcopy(e1000_adaptive) e1000_adaptive1.e1000_options["NG_interrupt_mode"] = 2 e1000_adaptive1.name = "e1000-adaptive1" regular_vms = [ # e1000_baseline, virtio, # virtio_batch, # e1000_para_halt, # e1000_adaptive, # e1000_adaptive1, ] vms=list() for vm in regular_vms: new = deepcopy(vm) new.guest_configure_commands.append("nohup '~/loop.sh < /dev/null > /dev/null 2>&1 &'") new.name += "-busy" vms.append(new) return tuple(regular_vms) + tuple(vms)
def main(directory=None, netperf_msg_size=None): trace_dir = get_dir(directory) if netperf_msg_size is None: netperf_msg_size = MSG_SIZE if ORIG_QEMU != TMP_QEMU: shutil.copyfile(ORIG_QEMU, TMP_QEMU) os.makedirs(trace_dir, exist_ok=True) netserver_start() logger.info("msg size = %s", netperf_msg_size) vm = QemuNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") vm.ethernet_dev = Qemu.QEMU_VIRTIO # vm.qemu_config["latency_itr"] = 0 vm.e1000_options["NG_notify_batch"] = "on" vm.BOOTUP_WAIT = 15 # vm.addiotional_guest_command = 'sudo ethtool -C eth0 rx-usecs 3000' local_trace = Trace(localRoot, os.path.join(trace_dir, "trace_host")) local_trace.setup() local_trace.set_buffer_size(100000) local_trace.enable_event("kvm/kvm_write_tsc_offset") # local_trace.enable_event("kvm/kvm_set_irq") # local_trace.enable_event("kvm/kvm_msi_set_irq") # local_trace.enable_event("kvm/kvm_inj_virq") # local_trace.enable_event("kvm/kvm_ioapic_set_irq") # local_trace.enable_event("kvm/kvm_exit") # local_trace.enable_event("kvm/kvm_entry") # local_trace.enable_event("kvm/kvm_userspace_exit") local_trace.set_event_filter( "sched/sched_switch", r'prev_comm ~ "*qemu*" || next_comm ~ "*qemu*"') # local_trace.enable_event("sched/sched_switch") local_trace.set_event_filter("sched/sched_wakeup", '\"comm~*qemu*\"') # local_trace.enable_event("sched/sched_wakeup") local_trace.set_event_filter("sched/sched_waking", '\"comm~*qemu*\"') # local_trace.enable_event("sched/sched_waking") # objdump -tT /tmp/qemu-system-x86_64 |grep .text|grep virtio_queue_notify_vq ## local_trace.uprobe_add("p:virtio_queue_notify_vq /tmp/qemu-system-x86_64:0x1bfba6") # local_trace.uprobe_add_event("p", "virtio_queue_notify_vq", TMP_QEMU, "virtio_queue_notify_vq") # objdump -tT /tmp/qemu-system-x86_64 |grep .text|grep kvm_vcpu_ioctl ## local_trace.uprobe_add("p:kvm_vcpu_ioctl /tmp/qemu-system-x86_64:0x16a886 cmd=%si") # local_trace.uprobe_add_event("p", "kvm_vcpu_ioctl", TMP_QEMU, "kvm_vcpu_ioctl", "cmd=%si") # local_trace.uprobe_add_event("p", "tap_write_packet", TMP_QEMU, "tap_write_packet") # local_trace.uprobe_add_event("p", "tap_recv_packets", TMP_QEMU, "tap_send") # local_trace.uprobe_add_event("r", "tap_recv_packets_end", TMP_QEMU, "tap_send") # local_trace.uprobe_add_event("p", "virtio_irq", TMP_QEMU, "virtio_irq") # local_trace.uprobe_add_event("p", "virtio_queue_notify_vq", TMP_QEMU, "virtio_queue_notify_vq") # local_trace.uprobe_add_event("p", "e1000_set_kick", TMP_QEMU, "e1000_set_kick") # local_trace.uprobe_add_event("p", "e1000_receive_batch_finished", TMP_QEMU, "e1000_receive_batch_finished") local_trace.uprobe_enable() local_trace.empty_trace() local_trace.trace_on() # local_trace.trace_to_local_file() vm.setup() vm.run() remote_trace = Trace(vm.root, os.path.join(trace_dir, "trace_guest")) remote_trace.setup() remote_trace.set_buffer_size(100000) # remote_trace.enable_event("tcp") # remote_trace.enable_event("net") # remote_trace.enable_event("irq") # remote_trace.enable_event("irq_vectors") # remote_trace.enable_event("napi") # remote_trace.enable_event("power/cpu_idle") # remote_trace.enable_event("syscalls/sys_enter_sendto") # remote_trace.enable_event("syscalls/sys_enter_recvfrom") remote_trace.enable_event("net/net_dev_xmit") # remote_trace.enable_event("irq/irq_handler_entry") # remote_trace.enable_event("e1000/e1000_pre_mem_op") # remote_trace.enable_event("e1000/e1000_post_mem_op") # remote_trace.enable_event("e1000/e1000_set_tdt") # remote_trace.enable_event("e1000/e1000_post_set_tdt") # remote_trace.kprobe_add("p:notify_begin virtqueue_kick") # remote_trace.kprobe_add("r:notify_end virtqueue_kick") # remote_trace.kprobe_enable() remote_trace.trace_on() netperf = NetPerfTCP(None, runtime=2) run_command_async("tcpdump -i tap0 -s 100 -w {} -W 1 -G 7".format( os.path.join(trace_dir, "virtio.cap"))) remote_trace.trace_marker(TRACE_BEGIN_MSG) netperf_perf = netperf.run_netperf(vm, msg_size=netperf_msg_size) remote_trace.trace_marker(TRACE_END_MSG) print("Netperf performance: %s" % (netperf_perf, )) logger.info("Netperf performance: %s", netperf_perf) remote_trace.trace_off() remote_trace.disable_all_events() local_trace.trace_off() local_trace.disable_all_events() netperf_perf = netperf.run_netperf(vm, msg_size=netperf_msg_size) print("Base Netperf performance: %s" % (netperf_perf, )) logger.info("Base Netperf performance: %s", netperf_perf) local_trace.read_trace_once(to_file=True) remote_trace.read_trace_once(to_file=True) # local_trace.trace_to_local_file_stop() local_trace.disable_all_events() # input("Press Enter to exit") vm.teardown() netserver_stop()
def create_vms(): vm_list = list() base_machine = QemuNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_baseline = deepcopy(base_machine) e1000_baseline.ethernet_dev = e1000_baseline.QEMU_E1000_BETTER e1000_baseline.name = "e1000-Baseline" iothread = deepcopy(e1000_baseline) iothread.name = "e1000-iothread" iothread.e1000_options["NG_tx_iothread"] = "on" # Checksum vm_list.append(deepcopy(iothread)) vm_list[-1].e1000_options["NG_no_checksum"] = "on" vm_list[-1].name = "e1000-Checksum" # TSO vm_list.append(deepcopy(iothread)) vm_list[-1].e1000_options["NG_no_tcp_seg"] = "on" vm_list[-1].name = "e1000-TSO" # interrupts vm_list.append(deepcopy(iothread)) vm_list[-1].e1000_options["NG_interrupt_mul"] = 1 vm_list[-1].e1000_options["NG_interrupt_mode"] = 1 vm_list[-1].name = "e1000-Interrupts" # IO thread # vm_list.append(deepcopy(iothread)) # vm_list[-1].e1000_options["NG_tx_iothread"] = "on" # vm_list[-1].name = "e1000-IO_Thread" # PCI-X vm_list.append(deepcopy(iothread)) vm_list[-1].e1000_options["NG_pcix"] = "on" vm_list[-1].name = "e1000-PCI-X" # Drop Packets vm_list.append(deepcopy(iothread)) vm_list[-1].e1000_options["NG_drop_packet"] = "on" vm_list[-1].name = "e1000-Packet_Drop" # Vector_send vm_list.append(deepcopy(iothread)) vm_list[-1].e1000_options["NG_vsend"] = "on" vm_list[-1].name = "e1000-Vector_Send" # nice vm_list.append(deepcopy(iothread)) vm_list[-1].is_io_thread_nice = True vm_list[-1].io_nice = 5 vm_list[-1].name = "e1000-nice" # # Large Queue vm_list.append(deepcopy(iothread)) vm_list[-1].large_queue = True vm_list[-1].static_itc = True vm_list[-1].name = "e1000-Large_Queues" # virtio, Again # vm_list.append(deepcopy(vm_list[0])) # vm_list[-1].e1000_options["NG_drop_packet"] = "on" # vm_list[-1].name = "Virtio-Packet_Drop" return [e1000_baseline, iothread] + vm_list
def create_vms(): base = QemuNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_baseline = deepcopy(base) e1000_baseline.ethernet_dev = e1000_baseline.QEMU_E1000 e1000_baseline.name = "E1000-baseline" virtio = deepcopy(base) virtio.ethernet_dev = virtio.QEMU_VIRTIO virtio.name = "virtio" virtio_batch = deepcopy(virtio) virtio_batch.name = "virtio_batch" virtio_batch.e1000_options["NG_notify_batch"] = "on" virtio_drop = deepcopy(virtio) virtio_drop.name = "virtio_drop" virtio_drop.e1000_options["NG_drop_packet"] = "on" e1000_best_3_13 = QemuE1000NG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_best_3_13.name = "E1000-best" e1000_best_3_13.is_io_thread_nice = False e1000_best_3_13.kernel = OLD_KERNEL e1000_best_3_13.initrd = OLD_INITRD e1000_best_interrupt_3_13 = deepcopy(e1000_best_3_13) e1000_best_interrupt_3_13.name = "E1000-Arthur_interrupt-3.13" e1000_best_interrupt_3_13.e1000_options["NG_interrupt_mul"] = 10 e1000_best_interrupt_3_13.e1000_options["NG_interrupt_mode"] = 0 e1000_best_interrupt = QemuE1000NG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_best_interrupt.name = "E1000-int_mul" e1000_best_interrupt.is_io_thread_nice = False # e1000_best_interrupt.kernel = r"../linux/arch/x86/boot/bzImage" # e1000_best_interrupt.initrd = r"/homes/bdaviv/repos/msc-ng/vm-files/kernels/initrd.img-4.14.4-ng+" e1000_best_interrupt.e1000_options["NG_interrupt_mul"] = 10 e1000_best_interrupt.e1000_options["NG_interrupt_mode"] = 0 e1000_best_interrupt.bootwait = 10 e1000_tso_offloading = deepcopy(e1000_best_interrupt) e1000_tso_offloading.e1000_options["NG_tso_offloading"] = "on" e1000_batch_interrupt = deepcopy(e1000_best_interrupt) e1000_batch_interrupt.name = "e1000-batch_itr" e1000_batch_interrupt.e1000_options["NG_interrupt_mul"] = 1 e1000_batch_interrupt.e1000_options["NG_interrupt_mode"] = 1 # e1000_batch_interrupt.e1000_options["NG_parabatch"] = "on" e1000_best_lq = deepcopy(e1000_best_interrupt) e1000_best_lq.name = "e1000-int_mul-largeQ" e1000_best_lq.large_queue = True # e1000_best_lq.static_itr = True e1000_skb_orphan = deepcopy(e1000_best_interrupt) e1000_skb_orphan.kernel_cmdline_additional = "e1000.NG_flags=1" e1000_skb_orphan.name = "E1000-skb_orphan" e1000_timer_itr = deepcopy(e1000_skb_orphan) e1000_timer_itr.e1000_options["NG_interrupt_mode"] = 2 e1000_timer_itr.name = "E1000-timer_itr" # e1000_timer_itr.e1000_options["NG_parabatch"] = "on" e1000_arthur = QemuE1000Max(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_arthur.kernel = OLD_KERNEL e1000_arthur.initrd = OLD_INITRD e1000_arthur.exe = OLD_QEMU e1000_arthur.nic_additionals = '' e1000_arthur.qemu_additionals = '-enable-e1000-pcix' e1000_arthur.name = "E1000-Arthur-old" e1000_arthur.qemu_config["drop_packet_every"] = 8000 e1000_arthur.qemu_config["drop_packet_every_avg_packet_size_min"] = 25000 e1000_arthur.qemu_config["drop_packet_every_avg_packet_size_max"] = 60000 e1000_timer_itr_lq_4096 = deepcopy(e1000_timer_itr) e1000_timer_itr_lq_4096.name = "E1000-timer_itr-lq1024" e1000_timer_itr_lq_4096.large_queue = True e1000_timer_itr_lq_4096.queue_size = 4096 e1000_timer_itr_parabatch = deepcopy(e1000_skb_orphan) e1000_timer_itr_parabatch.e1000_options["NG_interrupt_mode"] = 2 e1000_timer_itr_parabatch.name = "E1000-timer_itr-parabatch" e1000_timer_itr_parabatch.e1000_options["NG_parabatch"] = "on" # e1000_timer_itr_parabatch.large_queue = True # e1000_timer_itr_parabatch.queue_size = 4096 return ( # e1000_baseline, virtio, virtio_batch, # virtio_drop, # e1000_best_3_13, # e1000_best_interrupt_3_13, # e1000_best_interrupt, e1000_skb_orphan, e1000_timer_itr, # e1000_timer_itr_lq_4096, # e1000_timer_itr_parabatch, # e1000_batch_interrupt, # e1000_best_lq # e1000_tso_offloading, # e1000_arthur, )
def create_vms(): base = QemuNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_baseline = deepcopy(base) e1000_baseline.ethernet_dev = e1000_baseline.QEMU_E1000 e1000_baseline.name = "E1000-baseline" e1000_best_interrupt = QemuE1000NG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_best_interrupt.name = "E1000-int_mul" e1000_best_interrupt.is_io_thread_nice = False # e1000_best_interrupt.kernel = r"../linux/arch/x86/boot/bzImage" # e1000_best_interrupt.initrd = r"/homes/bdaviv/repos/msc-ng/vm-files/kernels/initrd.img-4.14.4-ng+" e1000_best_interrupt.e1000_options["NG_interrupt_mul"] = 10 e1000_best_interrupt.e1000_options["NG_interrupt_mode"] = 0 e1000_best_interrupt.bootwait = 10 e1000_skb_orphan = deepcopy(e1000_best_interrupt) e1000_skb_orphan.kernel_cmdline_additional = "e1000.NG_flags=1" e1000_skb_orphan.name = "E1000-skb_orphan" e1000_halt = deepcopy(e1000_skb_orphan) e1000_halt.name = "E1000-halt" e1000_halt.e1000_options["NG_parahalt"] = "on" # e1000_halt.e1000_options["NG_disable_iothread_lock"] = "on" # e1000_halt.e1000_options["NG_tx_iothread"] = "off" e1000_halt.e1000_options["NG_interrupt_mode"] = 0 e1000_halt.e1000_options["NG_interrupt_mul"] = 0 e1000_halt.e1000_options["mitigation"] = "off" e1000_halt_lq = deepcopy(e1000_halt) e1000_halt_lq.name += "-lq" e1000_halt_lq.large_queue = True e1000_halt_lq.queue_size = 512 e1000_halt_no_rdt_jump = deepcopy(e1000_halt) e1000_halt_no_rdt_jump.name += "-latest" e1000_halt_no_rdt_jump.e1000_options["NG_disable_rdt_jump"] = "on" e1000_halt_no_rdt_jump.e1000_options["NG_fast_iothread_kick"] = "on" e1000_halt_no_timerfd = deepcopy(e1000_halt_no_rdt_jump) e1000_halt_no_timerfd.name += "-no_timerfd" e1000_halt_no_timerfd.e1000_options["NG_disable_timerfd"] = "on" e1000_halt_no_kick2iothread = deepcopy(e1000_halt_no_rdt_jump) e1000_halt_no_kick2iothread.name += "-no_direct_kick_iothread" e1000_halt_no_kick2iothread.e1000_options["NG_fast_iothread_kick"] = "off" e1000_halt_send_vcpu = deepcopy(e1000_halt_no_rdt_jump) e1000_halt_send_vcpu.name += "-vcpu_send" e1000_halt_send_vcpu.e1000_options["NG_force_iothread_send"] = "off" e1000_halt_send_vcpu.e1000_options["NG_fast_iothread_kick"] = "off" e1000_halt_iothread_till_recv = deepcopy(e1000_halt_no_rdt_jump) e1000_halt_iothread_till_recv.name += "-iothread_to_recv" e1000_halt_iothread_till_recv.e1000_options["NG_force_iothread_send"] = "on" e1000_halt_iothread_till_recv.e1000_options["NG_fast_iothread_kick"] = "off" e1000_halt_iothread_till_recv.e1000_options["NG_force_iothread_wait_recv"] = "on" e1000_halt_no_rdt_jump_no_poll = deepcopy(e1000_halt_no_rdt_jump) e1000_halt_no_rdt_jump_no_poll.disable_kvm_poll = True e1000_halt_no_rdt_jump_no_poll.name += "-nopoll" # virtio.enabled = False # virtio_batch.enabled = False # e1000_skb_orphan.enabled = False # e1000_baseline.enabled = False # e1000_timer_itr_reg.enabled = False # e1000_skb_orphan_nolock.enabled = False # e1000_timer_itr_reg_nolock.enabled = False # e1000_halt.enabled = False # e1000_halt_lq.enabled = False return ( # e1000_skb_orphan, # latest # e1000_skb_orphan_nolock, # e1000_skb_orphan_lq_nolock, # e1000_timer_itr, # e1000_timer_itr_lq_4096, # e1000_timer_itr_parabatch, # e1000_timer_itr_reg, # latest # e1000_timer_itr_reg_lq, # e1000_timer_itr_reg_nolock, # e1000_halt, # e1000_halt_lq, e1000_halt_no_rdt_jump, e1000_halt_no_timerfd, e1000_halt_no_kick2iothread, e1000_halt_send_vcpu, e1000_halt_no_rdt_jump_no_poll, # e1000_halt_iothread_till_recv, # e1000_halt_unlock # e1000_batch_interrupt, # e1000_batch_interrupt_nolock, # e1000_best_lq # e1000_tso_offloading, # e1000_arthur, # e1000_baseline, )
def get_vms(self): qemu_e1000e = Qemu(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_e1000e.ethernet_dev = "e1000e" qemu_virtio = Qemu(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_virtio.ethernet_dev = Qemu.QEMU_VIRTIO qemu_virtio_drop_packets = QemuNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_virtio_drop_packets.ethernet_dev = Qemu.QEMU_VIRTIO qemu_virtio_drop_packets.e1000_options["NG_drop_packet"] = "on" qemu_virtio_latency = Qemu(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_virtio_latency.ethernet_dev = Qemu.QEMU_VIRTIO qemu_virtio_latency.qemu_config["latency_itr"] = 2 qemu_e1000_baseline = Qemu(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_e1000_baseline.ethernet_dev = Qemu.QEMU_E1000 qemu_e1000_arthur = QemuE1000Max(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_e1000_arthur.qemu_config["latency_itr"] = 0 qemu_e1000_arthur_nice = QemuE1000Max( disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_e1000_arthur_nice.qemu_config["latency_itr"] = 0 qemu_e1000_arthur_nice.is_io_thread_nice = True qemu_smart_itr = QemuE1000Max(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_smart_itr.qemu_config["latency_itr"] = 1 qemu_smart_itr.qemu_config["tx_packets_per_batch"] = 0 qemu_smart_itr.qemu_config["dynamic_latency_mode"] = 0 qemu_smart_itr2 = QemuE1000Max(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_smart_itr2.qemu_config["latency_itr"] = 1 qemu_smart_itr2.ethernet_dev = 'e1000-82545em' qemu_smart_itr2.addiotional_guest_command = 'sudo ethtool -C eth0 rx-usecs 3000' qemu_smart_itr3 = QemuE1000Max(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_smart_itr3.qemu_config["latency_itr"] = 2 qemu_smart_itr3.ethernet_dev = 'e1000-82545em' qemu_smart_itr3.addiotional_guest_command = 'sudo ethtool -C eth0 rx-usecs 3000' qemu_e1000_io_thread = QemuE1000Max(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_e1000_io_thread.nic_additionals = ",iothread=iothread0" # qemu_smart_itr3.ethernet_dev = 'e1000-82545em' # qemu_smart_itr3.addiotional_guest_command = 'sudo ethtool -C eth0 rx-usecs 3000' # qemu_smart_itr3.qemu_config["drop_packet_every"] = 0 # # qemu_e1000_no_new_improv = QemuE1000Max(disk_path=r"../vms/ubuntu-20.img", # guest_ip="10.10.0.43", # host_ip="10.10.0.44") # qemu_e1000_no_new_improv.qemu_config["smart_interrupt_mitigation"] = 0 # qemu_e1000_no_new_improv.qemu_config["drop_packet_every"] = 0 # # qemu_virtio_drop = QemuE1000Max(disk_path=r"../vms/ubuntu-20.img", # guest_ip="10.10.0.43", # host_ip="10.10.0.44") # qemu_virtio_drop.qemu_config["smart_interrupt_mitigation"] = 0 # qemu_virtio_drop.qemu_config["drop_packet_every"] = 0 # qemu_virtio_drop.ethernet_dev = Qemu.QEMU_VIRTIO # qemu_large_queue = QemuLargeRing(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_large_queue.is_io_thread_nice = True qemu_large_queue.qemu_config["drop_packet_every"] = 0 qemu_large_queue_itr6 = QemuLargeRing( disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_large_queue_itr6.is_io_thread_nice = True qemu_large_queue_itr6.qemu_config[ "interrupt_mitigation_multiplier"] = 6 qemu_large_queue_itr6.qemu_config["drop_packet_every"] = 0 qemu_large_queue_batch_itr = QemuLargeRing( disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_large_queue_batch_itr.is_io_thread_nice = True qemu_large_queue_batch_itr.io_nice = 4 qemu_large_queue_batch_itr.qemu_config["interrupt_mode"] = 1 qemu_large_queue_batch_itr.qemu_config["drop_packet_every"] = 0 qemu_large_queue_batch_itr.qemu_config[ "interrupt_mitigation_multiplier"] = 1000 # qemu_e1000_best_itr = QemuE1000Max(disk_path=r"../vms/ubuntu-20.img", # guest_ip="10.10.0.43", # host_ip="10.10.0.44") # qemu_e1000_best_itr.exe = r"/homes/bdaviv/repos/e1000-improv/qemu-2.2.0/build/x86_64-softmmu/qemu-system-x86_64" # self.qemu_virtio_1g = Qemu(disk_path=r"../vms/ubuntu-20.img", # guest_ip="10.10.0.43", # host_ip="10.10.0.44") # self.qemu_virtio_1g.ethernet_dev = Qemu.QEMU_VIRTIO # self.qemu_virtio_1g.mem=1024 # # self.qemu_e1000_1g = Qemu(disk_path=r"../vms/ubuntu-20.img", # guest_ip="10.10.0.43", # host_ip="10.10.0.44") # self.qemu_e1000_1g.ethernet_dev = Qemu.QEMU_E1000 # self.qemu_e1000_1g.mem= qemu_arthur_arthur = QemuE1000Max(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_arthur_arthur.ethernet_dev = qemu_arthur_arthur.QEMU_E1000 qemu_arthur_arthur.qemu_additionals = "-enable-e1000-pcix" qemu_arthur_arthur.exe = "/home/bdaviv/repos/e1000-improv/qemu-arthur/build/x86_64-softmmu/qemu-system-x86_64" qemu_arthur_arthur.qemu_config = { "no_tso_loop_on": 1, "no_tcp_csum_on": 1, "tdt_handle_on_iothread": 1, "interrupt_mitigation_multiplier": 10, "drop_packet_every": 8000, "drop_packet_every_avg_packet_size_min": 25000, "drop_packet_every_avg_packet_size_max": 60000, "zero_copy_on": 1, } qemu_ng_max = QemuE1000NG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_large_ring_ng = QemuLargeRingNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_ng_max_nocsum = QemuE1000NG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_ng_max_nocsum.e1000_options["NG_no_checksum"] = "off" qemu_large_ring_ng_nocsum = QemuLargeRingNG( disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_large_ring_ng_nocsum.e1000_options["NG_no_checksum"] = "off" qemu_virtio_nice = Qemu(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_virtio_nice.ethernet_dev = Qemu.QEMU_VIRTIO qemu_virtio_nice.is_io_thread_nice = True qemu_virtio_nice.io_nice = 5 qemu_large_ring_ng_tso_offload = QemuLargeRingNG( disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") qemu_large_ring_ng_tso_offload.e1000_options[ "NG_tso_offloading"] = "on" return [ # (qemu_virtio, "virtio-net_baseline"), (qemu_virtio_drop_packets, "qemu_virtio_drop_packets"), # (qemu_e1000e, "qemu_e1000e"), # (qemu_virtio_latency, "virito-net_smart_latency"), # working? # (qemu_virtio_nice, "qemu_virtio_nice"), # (qemu_e1000_no_new_improv, "qemu_e1000_no_new_improv"), # (qemu_e1000_baseline, "e1000_baseline"), # (qemu_e1000_newest, "qemu_e1000_newest"), # (qemu_e1000_arthur, "e1000_10x_arthur"), # (qemu_arthur_arthur, "e1000_arthur_version"), # (qemu_e1000_arthur_nice, "qemu_e1000_arthur_nice"), # (qemu_smart_itr, "qemu_smart_latency1"), # (qemu_smart_itr2, "qemu_smart_latency2"), # (qemu_smart_itr3, "e1000_smart_latency"), # working? # (qemu_e1000_io_thread, "qemu_io_thread"), # (qemu_e1000_no_new_improv, "qemu_e1000_no_new_improv") # (qemu_large_queue, "qemu_large_ring_nice"), # (qemu_large_queue_itr6, "qemu_large_ring_nice_itr6"), # (qemu_large_queue_batch_itr, "qemu_large_queue_batch_itr"), # (qemu_e1000_best_itr, "qemu_e1000_best_itr"), # (self.qemu_virtio_1g, "qemu_virtio_1G"), # (self.qemu_e1000_1g, "qemu_e1000_1G"), # (qemu_ng_max, "qemu_ng_max"), (qemu_large_ring_ng, "qemu_large_ring_ng"), # (qemu_ng_max_nocsum, "qemu_ng_max_nocsum"), # (qemu_large_ring_ng_nocsum, "qemu_large_ring_ng_nocsum"), # (qemu_large_ring_ng_tso_offload, "qemu_large_ring_ng_tso_offload"), ]
def create_vms(): base = QemuNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") base.netperf_test_params = "-C" e1000_baseline = deepcopy(base) e1000_baseline.ethernet_dev = e1000_baseline.QEMU_E1000 e1000_baseline.name = "E1000-baseline" virtio = deepcopy(base) virtio.ethernet_dev = virtio.QEMU_VIRTIO virtio.name = "virtio" virtio_batch = deepcopy(virtio) virtio_batch.name = "virtio_batch" virtio_batch.e1000_options["NG_notify_batch"] = "on" virtio_drop = deepcopy(virtio) virtio_drop.name = "virtio_drop" virtio_drop.e1000_options["NG_drop_packet"] = "on" e1000_best_interrupt = QemuE1000NG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_best_interrupt.name = "E1000-int_mul" e1000_best_interrupt.is_io_thread_nice = False # e1000_best_interrupt.kernel = r"../linux/arch/x86/boot/bzImage" # e1000_best_interrupt.initrd = r"/homes/bdaviv/repos/msc-ng/vm-files/kernels/initrd.img-4.14.4-ng+" e1000_best_interrupt.e1000_options["NG_interrupt_mul"] = 10 e1000_best_interrupt.e1000_options["NG_interrupt_mode"] = 0 e1000_best_interrupt.bootwait = 10 e1000_best_interrupt.netperf_test_params = "-C" e1000_tso_offloading = deepcopy(e1000_best_interrupt) e1000_tso_offloading.e1000_options["NG_tso_offloading"] = "on" e1000_batch_interrupt = deepcopy(e1000_best_interrupt) e1000_batch_interrupt.name = "e1000-batch_itr" e1000_batch_interrupt.e1000_options["NG_interrupt_mul"] = 1 e1000_batch_interrupt.e1000_options["NG_interrupt_mode"] = 1 # e1000_batch_interrupt.e1000_options["NG_parabatch"] = "on" e1000_best_lq = deepcopy(e1000_best_interrupt) e1000_best_lq.name = "e1000-int_mul-largeQ" e1000_best_lq.large_queue = True # e1000_best_lq.static_itr = True e1000_skb_orphan = deepcopy(e1000_best_interrupt) e1000_skb_orphan.kernel_cmdline_additional = "e1000.NG_flags=1" e1000_skb_orphan.name = "E1000-skb_orphan" e1000_skb_orphan_lq_512 = deepcopy(e1000_skb_orphan) e1000_skb_orphan_lq_512.large_queue = True e1000_skb_orphan_lq_512.queue_size = 512 e1000_skb_orphan_lq_512.name = "E1000-skb_orphan-LQ_{}".format(e1000_skb_orphan_lq_512.queue_size) e1000_skb_orphan_lq_1024 = deepcopy(e1000_skb_orphan_lq_512) e1000_skb_orphan_lq_1024.queue_size = 1024 e1000_skb_orphan_lq_1024.name = "E1000-skb_orphan-LQ_{}".format(e1000_skb_orphan_lq_1024.queue_size) e1000_timer_itr = deepcopy(e1000_skb_orphan) e1000_timer_itr.e1000_options["NG_interrupt_mode"] = 2 e1000_timer_itr.name = "E1000-timer_itr" # e1000_timer_itr.e1000_options["NG_parabatch"] = "on" e1000_timer_itr_parabatch = deepcopy(e1000_skb_orphan) e1000_timer_itr_parabatch.e1000_options["NG_interrupt_mode"] = 2 e1000_timer_itr_parabatch.name = "E1000-timer_itr-parabatch" e1000_timer_itr_parabatch.e1000_options["NG_parabatch"] = "on" # e1000_timer_itr_parabatch.large_queue = True # e1000_timer_itr_parabatch.queue_size = 4096 e1000_timer_itr_lq_4096 = deepcopy(e1000_timer_itr) e1000_timer_itr_lq_4096.name = "E1000-timer_itr-lq4096" e1000_timer_itr_lq_4096.large_queue = True e1000_timer_itr_lq_4096.queue_size = 4096 return ( # e1000_baseline, virtio, virtio_batch, # virtio_drop, # e1000_best_interrupt, e1000_skb_orphan, e1000_timer_itr, # e1000_timer_itr_lq_4096, # e1000_timer_itr_parabatch # e1000_skb_orphan_lq_512, # e1000_skb_orphan_lq_1024 )
def create_vms(): pairs = list() vm_list_e1000 = list() vm_list_virtio = list() base_machine = QemuNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") # virtio virtio = deepcopy(base_machine) virtio.ethernet_dev = QemuNG.QEMU_VIRTIO virtio.name = "virtio" vm_list_virtio.append(virtio) vm_list_virtio.append(deepcopy(vm_list_virtio[-1])) vm_list_virtio[-1].e1000_options["NG_notify_batch"] = "on" vm_list_virtio[-1].name = "virtio-batchInterrupts" # # vm_list_virtio.append(deepcopy(vm_list_virtio[-1])) # vm_list_virtio[-1].disable_kvm_poll = True # vm_list_virtio[-1].name = "virtio-noPoll" pairs.extend(pairwise(vm_list_virtio)) # e1000 baseline e1000 = deepcopy(base_machine) e1000.ethernet_dev = QemuNG.QEMU_E1000_BETTER e1000.name = "e1000-Baseline" pairs.append((virtio, e1000)) vm_list_e1000.append(deepcopy(e1000)) # Checksum vm_list_e1000.append(deepcopy(vm_list_e1000[-1])) vm_list_e1000[-1].e1000_options["NG_no_checksum"] = "on" vm_list_e1000[-1].name = "e1000-Checksum" # TSO vm_list_e1000.append(deepcopy(vm_list_e1000[-1])) vm_list_e1000[-1].e1000_options["NG_no_tcp_seg"] = "on" vm_list_e1000[-1].name = "e1000-TSO" # IO thread vm_list_e1000.append(deepcopy(vm_list_e1000[-1])) vm_list_e1000[-1].e1000_options["NG_tx_iothread"] = "on" vm_list_e1000[-1].name = "e1000-IOThread" e1000_before_interrupt_step = vm_list_e1000[-1] # Interrupts vm_list_e1000.append(deepcopy(vm_list_e1000[-1])) # vm_list_e1000[-1].e1000_options["NG_interrupt_mode"] = 3 # vm_list_e1000[-1].name = "e1000-Interrupt_adaptive" vm_list_e1000[-1].e1000_options["NG_parahalt"] = "on" vm_list_e1000[-1].e1000_options["NG_interrupt_mode"] = 0 vm_list_e1000[-1].e1000_options["NG_interrupt_mul"] = 0 vm_list_e1000[-1].e1000_options["mitigation"] = "off" vm_list_e1000[-1].name = "e1000-send_on_halt" e1000_send_on_halt = vm_list_e1000[-1] # Disable always flush TX queue RDT write vm_list_e1000.append(deepcopy(vm_list_e1000[-1])) vm_list_e1000[-1].e1000_options["NG_disable_rdt_jump"] = "on" vm_list_e1000[-1].name = "e1000-NoRDTJump" # Vector_send vm_list_e1000.append(deepcopy(vm_list_e1000[-1])) vm_list_e1000[-1].e1000_options["NG_vsend"] = "on" vm_list_e1000[-1].name = "e1000-zero_copy" # PCI-X vm_list_e1000.append(deepcopy(vm_list_e1000[-1])) vm_list_e1000[-1].e1000_options["NG_pcix"] = "on" vm_list_e1000[-1].name = "e1000-high_mem_dma" # # Eliminate ITR # vm_list_e1000.append(deepcopy(vm_list_e1000[-1])) # vm_list_e1000[-1].static_itr = True # vm_list_e1000[-1].ethernet_dev = vm_list_e1000[-1].QEMU_E1000_BETTER # vm_list_e1000[-1].name = "e1000-NoITR" # Guest TX orphan vm_list_e1000.append(deepcopy(vm_list_e1000[-1])) vm_list_e1000[-1].guest_e1000_ng_flag = 1 vm_list_e1000[-1].name = "e1000-tx_skb_orphan" # halt e1000_int_halt = deepcopy(vm_list_e1000[-1]) e1000_int_halt.e1000_options["NG_parahalt"] = "on" e1000_int_halt.e1000_options["NG_interrupt_mode"] = 0 e1000_int_halt.e1000_options["NG_interrupt_mul"] = 0 e1000_int_halt.e1000_options["mitigation"] = "off" e1000_int_halt.name = "e1000-interrupts" # Adaptive e1000_adaptive = deepcopy(vm_list_e1000[-1]) e1000_adaptive.e1000_options["NG_parahalt"] = "off" e1000_adaptive.e1000_options["mitigation"] = "on" e1000_adaptive.e1000_options["NG_interrupt_mul"] = 1 e1000_adaptive.e1000_options["NG_interrupt_mode"] = 3 e1000_adaptive.name = "e1000-adaptive-after" e1000_adaptive_partial = deepcopy(e1000_send_on_halt) e1000_adaptive_partial.e1000_options["NG_parahalt"] = "off" e1000_adaptive_partial.e1000_options["mitigation"] = "on" e1000_adaptive_partial.e1000_options["NG_interrupt_mul"] = 1 e1000_adaptive_partial.e1000_options["NG_interrupt_mode"] = 3 e1000_adaptive_partial.name = "e1000-adaptive" # Adaptive1 e1000_adaptive1 = deepcopy(vm_list_e1000[-1]) e1000_adaptive1.e1000_options["NG_parahalt"] = "off" e1000_adaptive1.e1000_options["NG_interrupt_mode"] = 2 e1000_adaptive1.e1000_options["NG_interrupt_mul"] = 1 e1000_adaptive1.e1000_options["mitigation"] = "on" e1000_adaptive1.name = "e1000-adaptive-before" # # Eliminate TXDW - ??? # vm_list_e1000.append(deepcopy(vm_list_e1000[-1])) # vm_list_e1000[-1].e1000_options["NG_disable_TXDW"] = "on" # vm_list_e1000[-1].name = "e1000-NoTXDW" # # recall RXT0 when setting RDT - ??? # vm_list_e1000.append(deepcopy(vm_list_e1000[-1])) # vm_list_e1000[-1].e1000_options["NG_recall_RXT0"] = "on" # vm_list_e1000[-1].name = "e1000-RecallRXT0" # # Fast IOthread kick # vm_list_e1000.append(deepcopy(vm_list_e1000[-1])) # vm_list_e1000[-1].e1000_options["NG_fast_iothread_kick"] = "on" # vm_list_e1000[-1].name = "e1000-fastIothread" # # Guest TX clean - ??? # vm_list_e1000.append(deepcopy(vm_list_e1000[-1])) # vm_list_e1000[-1].guest_e1000_ng_flag |= 2 # vm_list_e1000[-1].name = "e1000-txClean" # # Guest disable nic stats # vm_list_e1000.append(deepcopy(vm_list_e1000[-1])) # vm_list_e1000[-1].guest_e1000_ng_flag |= 4 # vm_list_e1000[-1].name = "e1000-noStats" pairs.extend(pairwise(vm_list_e1000)) pairs.append((vm_list_e1000[-1], e1000)) pairs.append((vm_list_e1000[-1], vm_list_virtio[-1])) pairs.append((vm_list_e1000[-1], e1000_int_halt)) pairs.append((e1000_int_halt, e1000_adaptive)) pairs.append((e1000_send_on_halt, e1000_adaptive_partial)) pairs.append((e1000_adaptive_partial, e1000_before_interrupt_step)) pairs.append((virtio, vm_list_e1000[-1])) # return vm_list_virtio + vm_list_e1000 + [e1000_int_halt, e1000_adaptive], pairs # vms = vm_list_virtio + vm_list_e1000 + [e1000_int_halt, e1000_adaptive, e1000_adaptive_partial] vms = vm_list_virtio + vm_list_e1000 + [ e1000_adaptive, e1000_adaptive_partial ] for vm in vms: vm.enabled = False # e1000_adaptive_partial.enabled = True return vms, pairs
def create_vms(): base = QemuNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_baseline = deepcopy(base) e1000_baseline.ethernet_dev = e1000_baseline.QEMU_E1000 e1000_baseline.name = "E1000-baseline" virtio = deepcopy(base) virtio.ethernet_dev = virtio.QEMU_VIRTIO virtio.name = "virtio" virtio_vhost = deepcopy(virtio) virtio_vhost.name += "_vhost" virtio_vhost.vhost = True virtio_batch = deepcopy(virtio) virtio_batch.name = "virtio_batch" virtio_batch.e1000_options["NG_notify_batch"] = "on" virtio_drop = deepcopy(virtio) virtio_drop.name = "virtio_drop" virtio_drop.e1000_options["NG_drop_packet"] = "on" e1000_best_interrupt = QemuE1000NG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_best_interrupt.name = "E1000-int_mul" e1000_best_interrupt.is_io_thread_nice = False # e1000_best_interrupt.kernel = r"../linux/arch/x86/boot/bzImage" # e1000_best_interrupt.initrd = r"/homes/bdaviv/repos/msc-ng/vm-files/kernels/initrd.img-4.14.4-ng+" e1000_best_interrupt.e1000_options["NG_interrupt_mul"] = 10 e1000_best_interrupt.e1000_options["NG_interrupt_mode"] = 0 e1000_best_interrupt.bootwait = 10 e1000_tso_offloading = deepcopy(e1000_best_interrupt) e1000_tso_offloading.e1000_options["NG_tso_offloading"] = "on" e1000_batch_interrupt = deepcopy(e1000_best_interrupt) e1000_batch_interrupt.name = "e1000-batch_itr" e1000_batch_interrupt.e1000_options["NG_interrupt_mul"] = 1 e1000_batch_interrupt.e1000_options["NG_interrupt_mode"] = 1 # e1000_batch_interrupt.e1000_options["NG_parabatch"] = "on" e1000_best_lq = deepcopy(e1000_best_interrupt) e1000_best_lq.name = "e1000-int_mul-largeQ" e1000_best_lq.large_queue = True # e1000_best_lq.static_itr = True e1000_skb_orphan = deepcopy(e1000_best_interrupt) e1000_skb_orphan.kernel_cmdline_additional = "e1000.NG_flags=1" e1000_skb_orphan.name = "E1000-skb_orphan" e1000_timer_itr = deepcopy(e1000_skb_orphan) e1000_timer_itr.e1000_options["NG_interrupt_mode"] = 2 e1000_timer_itr.name = "E1000-timer_itr" # e1000_timer_itr.e1000_options["NG_parabatch"] = "on" e1000_arthur = QemuE1000Max(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_arthur.kernel = OLD_KERNEL e1000_arthur.initrd = OLD_INITRD e1000_arthur.exe = OLD_QEMU e1000_arthur.nic_additionals = '' e1000_arthur.qemu_additionals = '-enable-e1000-pcix' e1000_arthur.name = "E1000-Arthur-old" e1000_arthur.qemu_config["drop_packet_every"] = 8000 e1000_arthur.qemu_config["drop_packet_every_avg_packet_size_min"] = 25000 e1000_arthur.qemu_config["drop_packet_every_avg_packet_size_max"] = 60000 e1000_timer_itr_lq_4096 = deepcopy(e1000_timer_itr) e1000_timer_itr_lq_4096.name = "E1000-timer_itr-lq1024" e1000_timer_itr_lq_4096.large_queue = True e1000_timer_itr_lq_4096.queue_size = 4096 e1000_timer_itr_parabatch = deepcopy(e1000_skb_orphan) e1000_timer_itr_parabatch.e1000_options["NG_interrupt_mode"] = 2 e1000_timer_itr_parabatch.name = "E1000-timer_itr-parabatch" e1000_timer_itr_parabatch.e1000_options["NG_parabatch"] = "on" # e1000_timer_itr_parabatch.large_queue = True # e1000_timer_itr_parabatch.queue_size = 4096 e1000_timer_itr_reg = deepcopy(e1000_skb_orphan) e1000_timer_itr_reg.e1000_options["NG_interrupt_mode"] = 3 e1000_timer_itr_reg.name = "E1000-timer_itr-reg" e1000_timer_itr_reg_lq = deepcopy(e1000_timer_itr_reg) e1000_timer_itr_reg_lq.name = "E1000-timer_itr-reg-q512" e1000_timer_itr_reg_lq.large_queue = True e1000_timer_itr_reg_lq.queue_size = 512 # no lock varients e1000_skb_orphan_nolock = deepcopy(e1000_skb_orphan) e1000_skb_orphan_nolock.name += "-nolock" e1000_skb_orphan_nolock.e1000_options["NG_disable_iothread_lock"] = "on" e1000_skb_orphan_lq_nolock = deepcopy(e1000_skb_orphan_nolock) e1000_skb_orphan_lq_nolock.large_queue = True e1000_skb_orphan_lq_nolock.queue_size = 512 e1000_skb_orphan_lq_nolock.name += "-lq" e1000_timer_itr_reg_nolock = deepcopy(e1000_timer_itr_reg) e1000_timer_itr_reg_nolock.name += "-nolock" e1000_timer_itr_reg_nolock.e1000_options["NG_disable_iothread_lock"] = "on" e1000_batch_interrupt_nolock = deepcopy(e1000_batch_interrupt) e1000_batch_interrupt_nolock.name += "-nolock" e1000_batch_interrupt_nolock.e1000_options[ "NG_disable_iothread_lock"] = "on" e1000_halt = deepcopy(e1000_skb_orphan) e1000_halt.name = "E1000-halt" e1000_halt.e1000_options["NG_parahalt"] = "on" # e1000_halt.e1000_options["NG_disable_iothread_lock"] = "on" # e1000_halt.e1000_options["NG_tx_iothread"] = "off" e1000_halt.e1000_options["NG_interrupt_mode"] = 0 e1000_halt.e1000_options["NG_interrupt_mul"] = 0 e1000_halt.e1000_options["mitigation"] = "off" e1000_halt_lq = deepcopy(e1000_halt) e1000_halt_lq.name += "-lq" e1000_halt_lq.large_queue = True e1000_halt_lq.queue_size = 512 e1000_halt_unlock = deepcopy(e1000_halt) e1000_halt_unlock.name += "-unlocked" e1000_halt_unlock.e1000_options["NG_disable_iothread_lock"] = "on" e1000_halt_no_rdt_jump = deepcopy(e1000_halt) e1000_halt_no_rdt_jump.name += "-no_rdt_jump" e1000_halt_no_rdt_jump.e1000_options["NG_disable_rdt_jump"] = "on" e1000_halt_no_rdt_jump.e1000_options["NG_fast_iothread_kick"] = "on" e1000_halt_no_rdt_jump.disable_kvm_poll = True e1000_halt_no_rdt_jump_lq = deepcopy(e1000_halt_no_rdt_jump) e1000_halt_no_rdt_jump_lq.name += "-lq" e1000_halt_no_rdt_jump_lq.large_queue = True e1000_halt_no_rdt_jump_lq.queue_size = 512 virtio_batch_nopoll = deepcopy(virtio_batch) virtio_batch_nopoll.disable_kvm_poll = True virtio_batch_nopoll.name += "-nopoll" # virtio.enabled = False # virtio_batch.enabled = False # e1000_skb_orphan.enabled = False # e1000_baseline.enabled = False # e1000_timer_itr_reg.enabled = False # e1000_skb_orphan_nolock.enabled = False # e1000_timer_itr_reg_nolock.enabled = False # e1000_halt.enabled = False # e1000_halt_lq.enabled = False vms = ( virtio, virtio_batch, # virtio_drop, # virtio_vhost, virtio_batch_nopoll, # e1000_best_3_13, # e1000_best_interrupt_3_13, # e1000_best_interrupt, # e1000_skb_orphan, # latest # e1000_skb_orphan_nolock, # e1000_skb_orphan_lq_nolock, # e1000_timer_itr, # e1000_timer_itr_lq_4096, # e1000_timer_itr_parabatch, # e1000_timer_itr_reg, # latest # e1000_timer_itr_reg_lq, # e1000_timer_itr_reg_nolock, # e1000_halt, # e1000_halt_lq, # e1000_halt_no_rdt_jump, # e1000_halt_no_rdt_jump_lq, # e1000_halt_unlock # e1000_batch_interrupt, # e1000_batch_interrupt_nolock, # e1000_best_lq # e1000_tso_offloading, # e1000_arthur, # e1000_baseline, ) vms2 = list() for vm in vms: new_vm = deepcopy(vm) new_vm.name += "-2core" new_vm.io_thread_cpu = "1" vms2.append(new_vm) return vms + tuple(vms2)
def create_vms(): base = QemuNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_baseline = deepcopy(base) e1000_baseline.ethernet_dev = e1000_baseline.QEMU_E1000 e1000_baseline.name = "E1000-baseline" virtio = deepcopy(base) virtio.ethernet_dev = virtio.QEMU_VIRTIO virtio.name = "virtio" virtio_batch = deepcopy(virtio) virtio_batch.name = "virtio_batch" virtio_batch.e1000_options["NG_notify_batch"] = "on" e1000_best_interrupt = QemuE1000NG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_best_interrupt.name = "E1000-int_mul" e1000_best_interrupt.is_io_thread_nice = False # e1000_best_interrupt.kernel = r"../linux/arch/x86/boot/bzImage" # e1000_best_interrupt.initrd = r"/homes/bdaviv/repos/msc-ng/vm-files/kernels/initrd.img-4.14.4-ng+" e1000_best_interrupt.e1000_options["NG_interrupt_mul"] = 10 e1000_best_interrupt.e1000_options["NG_interrupt_mode"] = 0 e1000_best_interrupt.bootwait = 10 e1000_skb_orphan = deepcopy(e1000_best_interrupt) e1000_skb_orphan.kernel_cmdline_additional = "e1000.NG_flags=1" e1000_skb_orphan.name = "E1000-skb_orphan" e1000_timer_itr = deepcopy(e1000_skb_orphan) e1000_timer_itr.e1000_options["NG_interrupt_mode"] = 2 e1000_timer_itr.name = "E1000-timer_itr" # e1000_timer_itr.e1000_options["NG_parabatch"] = "on" e1000_timer_itr_reg = deepcopy(e1000_skb_orphan) e1000_timer_itr_reg.e1000_options["NG_interrupt_mode"] = 3 e1000_timer_itr_reg.name = "E1000-timer_itr-reg" e1000_timer_itr_reg_lq = deepcopy(e1000_timer_itr_reg) e1000_timer_itr_reg_lq.name = "E1000-timer_itr-reg-q512" e1000_timer_itr_reg_lq.large_queue = True e1000_timer_itr_reg_lq.queue_size = 512 # virtio.enabled = False # virtio_batch.enabled = False # e1000_skb_orphan.enabled = False # e1000_baseline.enabled = False # e1000_timer_itr_reg.enabled = False regular_vms = ( virtio, virtio_batch, # virtio_drop, # e1000_best_3_13, # e1000_best_interrupt_3_13, # e1000_best_interrupt, e1000_skb_orphan, # e1000_timer_itr, # e1000_timer_itr_lq_4096, # e1000_timer_itr_parabatch, e1000_timer_itr_reg, # e1000_timer_itr_reg_lq, # e1000_batch_interrupt, # e1000_best_lq # e1000_tso_offloading, # e1000_arthur, e1000_baseline, ) same_core = list() for vm in regular_vms: new_vm = deepcopy(vm) new_vm.name = vm.name + "-same_core" new_vm.netserver_core = vm.cpu_to_pin same_core.append(new_vm) return regular_vms + tuple(same_core)
def create_vms(): base = QemuNG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_baseline = deepcopy(base) e1000_baseline.ethernet_dev = e1000_baseline.QEMU_E1000 e1000_baseline.name = "E1000-baseline" virtio = deepcopy(base) virtio.ethernet_dev = virtio.QEMU_VIRTIO virtio.name = "virtio" virtio_batch = deepcopy(virtio) virtio_batch.name = "virtio_batch" virtio_batch.e1000_options["NG_notify_batch"] = "on" virtio_drop = deepcopy(virtio) virtio_drop.name = "virtio_drop" virtio_drop.e1000_options["NG_drop_packet"] = "on" e1000_best_interrupt = QemuE1000NG(disk_path=r"../vms/ubuntu-20.img", guest_ip="10.10.0.43", host_ip="10.10.0.44") e1000_best_interrupt.name = "E1000-int_mul" e1000_best_interrupt.is_io_thread_nice = False # e1000_best_interrupt.kernel = r"../linux/arch/x86/boot/bzImage" # e1000_best_interrupt.initrd = r"/homes/bdaviv/repos/msc-ng/vm-files/kernels/initrd.img-4.14.4-ng+" e1000_best_interrupt.e1000_options["NG_interrupt_mul"] = 10 e1000_best_interrupt.e1000_options["NG_interrupt_mode"] = 0 e1000_best_interrupt.bootwait = 10 e1000_tso_offloading = deepcopy(e1000_best_interrupt) e1000_tso_offloading.e1000_options["NG_tso_offloading"] = "on" e1000_batch_interrupt = deepcopy(e1000_best_interrupt) e1000_batch_interrupt.name = "e1000-batch_itr" e1000_batch_interrupt.e1000_options["NG_interrupt_mul"] = 1 e1000_batch_interrupt.e1000_options["NG_interrupt_mode"] = 1 # e1000_batch_interrupt.e1000_options["NG_parabatch"] = "on" e1000_best_lq = deepcopy(e1000_best_interrupt) e1000_best_lq.name = "e1000-int_mul-largeQ" e1000_best_lq.large_queue = True # e1000_best_lq.static_itr = True e1000_skb_orphan = deepcopy(e1000_best_interrupt) e1000_skb_orphan.kernel_cmdline_additional = "e1000.NG_flags=1" e1000_skb_orphan.name = "E1000-skb_orphan" e1000_timer_itr = deepcopy(e1000_skb_orphan) e1000_timer_itr.e1000_options["NG_interrupt_mode"] = 2 e1000_timer_itr.name = "E1000-timer_itr" # e1000_timer_itr.e1000_options["NG_parabatch"] = "on" e1000_timer_itr_lq_4096 = deepcopy(e1000_timer_itr) e1000_timer_itr_lq_4096.name = "E1000-timer_itr-lq1024" e1000_timer_itr_lq_4096.large_queue = True e1000_timer_itr_lq_4096.queue_size = 4096 e1000_timer_itr_parabatch = deepcopy(e1000_skb_orphan) e1000_timer_itr_parabatch.e1000_options["NG_interrupt_mode"] = 2 e1000_timer_itr_parabatch.name = "E1000-timer_itr-parabatch" e1000_timer_itr_parabatch.e1000_options["NG_parabatch"] = "on" # e1000_timer_itr_parabatch.large_queue = True # e1000_timer_itr_parabatch.queue_size = 4096 e1000_timer_itr_reg = deepcopy(e1000_skb_orphan) e1000_timer_itr_reg.e1000_options["NG_interrupt_mode"] = 3 e1000_timer_itr_reg.e1000_options["NG_disable_iothread_lock"] = "on" e1000_timer_itr_reg.name = "E1000-timer_itr-reg" # virtio.enabled = False # virtio_batch.enabled = False # e1000_skb_orphan.enabled = False # e1000_baseline.enabled = False # e1000_timer_itr_reg.enabled = False e1000_delay_timer = list() for i in range(0, 400, 50): vm = deepcopy(e1000_timer_itr_reg) vm.e1000_options["NG_interrupt_min"] = i vm.name = "e1000_delay_{}".format(i) e1000_delay_timer.append(vm) for i in range(400, 1000, 200): vm = deepcopy(e1000_timer_itr_reg) vm.e1000_options["NG_interrupt_min"] = i vm.name = "e1000_delay_{}".format(i) e1000_delay_timer.append(vm) for i in range(1000, 4000, 500): vm = deepcopy(e1000_timer_itr_reg) vm.e1000_options["NG_interrupt_min"] = i vm.name = "e1000_delay_{}".format(i) e1000_delay_timer.append(vm) # for i in range(2, 10, 1): # vm = deepcopy(e1000_timer_itr_reg) # vm.e1000_options["NG_interuupt_momentum"] = i # vm.e1000_options["NG_interuupt_momentum_max"] = 40 # vm.name = "e1000_delay_{}".format(i) # e1000_delay_timer.append(vm) return ( # virtio, # virtio_batch, # virtio_drop, # e1000_best_3_13, # e1000_best_interrupt_3_13, # e1000_best_interrupt, # e1000_skb_orphan, # e1000_timer_itr, e1000_timer_itr_reg, # e1000_timer_itr_lq_4096, # e1000_timer_itr_parabatch, # e1000_batch_interrupt, # e1000_best_lq # e1000_tso_offloading, # e1000_arthur, # e1000_baseline, ) + tuple(e1000_delay_timer)