Exemple #1
0
    def get_vms(self):
        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_e1000_arthur = QemuE1000Max(disk_path=r"../vms/ubuntu-20.img",
                                         guest_ip="10.10.0.43",
                                         host_ip="10.10.0.44")
        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_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.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

        return [
            # (qemu_virtio, "qemu_virtio"),
            # (qemu_e1000_arthur, "qemu_e1000_arthur"),
            # (qemu_large_queue, "qemu_e1000_large_queue"),
            (qemu_large_queue_batch_itr, "qemu_large_queue_batch_itr")
        ]
    def get_vms(self):
        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

        return [
            (qemu_virtio, "qemu_virtio"),
        ]
Exemple #3
0
    def get_vms(self):
        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_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.is_io_thread_nice = False

        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_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_itr = list()
        for i in range(500, 1600, 100):
            for nice in (True, ):
                v = QemuLargeRing(disk_path=r"../vms/ubuntu-20.img",
                                 guest_ip="10.10.0.43",
                                 host_ip="10.10.0.44")
                v.is_io_thread_nice = nice
                v.qemu_config["interrupt_mitigation_multiplier"] = i
                v.qemu_config["drop_packet_every"] = 0
                v.qemu_config["interrupt_mode"] = 1
                qemu_large_queue_itr.append((v, "qemu_large_queueu_%s_itr_%d" % (["no_nice", "nice"][nice], i,)))

        return [
            # (qemu_virtio, "virtio-net_baseline"),
            # (qemu_e1000_baseline, "e1000_baseline"),

            # (qemu_e1000_arthur, "e1000_10x_arthur"),
            # (qemu_large_queue, "qemu_large_queue"),
        ] + qemu_large_queue_itr
    def test_after(self, vm: Qemu, title, x):
        vm.change_qemu_parameters({"count_packets_from_guest_on": 0})
        sleep(0.5)
        with open("/tmp/qemu_packets_count", "rb") as f:
            packet_count = int.from_bytes(f.read(8),
                                          byteorder='little',
                                          signed=False)
            total_size = int.from_bytes(f.read(8),
                                        byteorder='little',
                                        signed=False)

        self.packet_count_graph.add_data(title, x, packet_count)
        self.packet_size_graph.add_data(
            title, x,
            float(total_size) / (float(packet_count) + 0.01))
 def _get_value(self, vm: Qemu):
     with open("/proc/{}/sched".format(vm.get_pid())) as f:
         for line in f:
             if line.count(":") != 1:
                 continue
             k, v = (a.strip() for a in line.split(":"))
             if k == "nr_switches":
                 return int(v)
Exemple #6
0
    def get_vms(self):
        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_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.is_io_thread_nice = True
        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
        return [
            # (qemu_virtio, "qemu_virtio"),
            (qemu_e1000_arthur, "qemu_e1000_arthur"),
            (qemu_large_queue, "qemu_e1000_large_queue"),
        ]
def create_vms():
    OLD_QEMU = r"/home/bdaviv/repos/e1000-improv/qemu-arthur/build/x86_64-softmmu/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 = Qemu(disk_path=r"../vms/ubuntu-20.img",
                guest_ip="10.10.0.43",
                host_ip="10.10.0.44")
    base.kernel = OLD_KERNEL
    base.initrd = OLD_INITRD
    base.exe = OLD_QEMU

    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_drop = deepcopy(virtio)
    virtio_drop.name = "virtio_drop"
    virtio_drop.qemu_config["drop_packet_every"] = 8000
    virtio_drop.qemu_config["drop_packet_every_avg_packet_size_min"] = 9000
    virtio_drop.qemu_config["drop_packet_every_avg_packet_size_max"] = 62000

    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"
    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

    return (e1000_baseline, virtio, virtio_drop, e1000_arthur)
Exemple #8
0
 def get_vms(self):
     # ***********************
     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_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_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'
     # ***********************
     return [
         (qemu_virtio, "virtio-net_baseline"),
         (qemu_virtio_latency, "virito-net_smart_latency"),
         (qemu_e1000_baseline, "e1000_baseline"),
         (qemu_e1000_arthur, "e1000_10x"),
         (qemu_smart_itr3, "e1000_smart_latency"),
     ]
Exemple #9
0
    def get_vms(self):
        virtualbox_e1000 = VirtualBox(r"e1000_1GB", "192.168.56.101",
                                      "192.168.56.1")
        virtualbox_virtio = VirtualBox(r"virtio_1GB", "192.168.56.102",
                                       "192.168.56.1")

        vmware_e1000 = VMware(
            r"/homes/bdaviv/Shared\ VMs/Ubuntu_Linux-e1000_1GB/Ubuntu\ Linux\ -\ e1000.vmx",
            "192.168.221.128", "192.168.221.1")
        vmware_para = VMware(
            r"/homes/bdaviv/Shared\ VMs/Ubuntu_Linux-para_1GB/Ubuntu\ Linux\ -\ paravirtual_nic.vmx",
            "192.168.221.129", "192.168.221.1")

        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.mem = "1024"

        qemu_e1000 = Qemu(disk_path=r"../vms/ubuntu-20.img",
                          guest_ip="10.10.0.43",
                          host_ip="10.10.0.44")
        qemu_e1000.ethernet_dev = Qemu.QEMU_E1000
        qemu_e1000.mem = "1024"

        qemu_e1000_best = QemuE1000Max(disk_path=r"../vms/ubuntu-20.img",
                                       guest_ip="10.10.0.43",
                                       host_ip="10.10.0.44")
        qemu_e1000_best.mem = "1024"

        return [
            (virtualbox_e1000, "virtualbox_e1000"),
            (virtualbox_virtio, "virtualbox_virtio"),
            (vmware_e1000, "vmware_e1000"),
            (vmware_para, "vmware_para"),
            (qemu_virtio, "qemu_virtio"),
            (qemu_e1000, "qemu_e1000"),
            (qemu_e1000_best, "qemu_e1000_best"),
        ]
Exemple #10
0
    def get_vms(self):
        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.io_thread_cpu = "1"

        qemu_e1000 = Qemu(disk_path=r"../vms/ubuntu-20.img",
                          guest_ip="10.10.0.43",
                          host_ip="10.10.0.44")
        qemu_e1000.ethernet_dev = Qemu.QEMU_E1000
        qemu_e1000.io_thread_cpu = "1"

        qemu_e1000_best = QemuE1000Max(disk_path=r"../vms/ubuntu-20.img",
                                       guest_ip="10.10.0.43",
                                       host_ip="10.10.0.44")
        qemu_e1000_best.io_thread_cpu = "1"

        # 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=1024

        return [
            (qemu_virtio, "qemu_virtio_base"),
            (qemu_e1000, "qemu_e1000_base"),
            (qemu_e1000_best, "qemu_e1000"),
            # (self.qemu_virtio_1g, "qemu_virtio_1G"),
            # (self.qemu_e1000_1g, "qemu_e1000_1G"),
        ]
def main(directory=None):
    shutil.copyfile(ORIG_QEMU, TMP_QEMU)
    vm = Qemu(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"] = 2

    local_trace = Trace(localRoot, "/tmp/trace_host")
    local_trace.setup()

    local_trace.enable_event("kvm/kvm_write_tsc_offset")
    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")

    # 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_enable()

    local_trace.empty_trace()
    local_trace.trace_on()
    local_trace.trace_to_local_file()

    vm.setup()
    vm.run()

    remote_trace = Trace(vm.root, "/tmp/trace_guest")
    remote_trace.setup()
    remote_trace.kprobe_add("p:notify_begin vp_notify")
    remote_trace.kprobe_add("r:notify_end vp_notify")
    remote_trace.kprobe_enable()
    remote_trace.trace_on()

    netperf = NetPerfLatency(None, runtime=2)
    netperf_perf = netperf.run_netperf(vm, msg_size=64)
    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=64)
    print("Netperf performance: %s" % (netperf_perf, ))
    logger.info("Netperf performance: %s", netperf_perf)

    remote_trace.read_trace_once(to_file=True)
    local_trace.trace_to_local_file_stop()

    local_trace.disable_all_events()

    # input()
    vm.teardown()

    if directory:
        os.makedirs(directory, exist_ok=True)
        shutil.copy("/tmp/trace_guest", directory)
        shutil.copy("/tmp/trace_host", directory)
def main(directory=None):
    trace_dir = get_dir(directory)

    shutil.copyfile(ORIG_QEMU, TMP_QEMU)
    os.makedirs(trace_dir, exist_ok=True)
    vm = Qemu(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"] = 2
    vm.is_io_thread_nice = False
    vm.BOOTUP_WAIT = 15

    local_trace = Trace(localRoot, os.path.join(trace_dir, "trace_host"))
    local_trace.setup()

    local_trace.enable_event("kvm/kvm_write_tsc_offset")
    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")

    # 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_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(20000)
    remote_trace.enable_event("power/cpu_idle")
    remote_trace.enable_event("irq/irq_handler_entry")
    remote_trace.kprobe_add("p:notify_begin vp_notify")
    remote_trace.kprobe_add("r:notify_end vp_notify")
    remote_trace.kprobe_enable()
    remote_trace.trace_on()

    netperf = NetPerfLatency(None, runtime=2)
    local_trace.trace_marker(TRACE_BEGIN_MSG)
    netperf_perf = netperf.run_netperf(vm, msg_size=64)
    local_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=64)
    print("Base Netperf performance: %s" % (netperf_perf, ))
    logger.info("Base Netperf performance: %s", netperf_perf)

    remote_trace.read_trace_once(to_file=True)
    local_trace.trace_to_local_file_stop()

    local_trace.disable_all_events()

    # input()
    vm.teardown()
Exemple #13
0
    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 test_before(self, vm: Qemu):
     vm.change_qemu_parameters({"count_packets_from_guest_on": 1})
Exemple #15
0
 def read_raw_line(self, vm: Qemu):
     with open("/proc/{pid}/stat".format(pid=vm.get_pid())) as f:
         line = f.readline()
         split = line.split()
         return split
Exemple #16
0
    def get_vms(self):
        qemu_virtio1 = Qemu(disk_path=r"../vms/ubuntu-20.img",
                            guest_ip="10.10.0.43",
                            host_ip="10.10.0.44")
        qemu_virtio1.ethernet_dev = Qemu.QEMU_VIRTIO
        qemu_virtio2 = Qemu(disk_path=r"../vms/vm-copy.img",
                            guest_ip="10.10.0.42",
                            host_ip="10.10.0.44")
        qemu_virtio2.vnc_number = 11
        qemu_virtio2.ethernet_dev = Qemu.QEMU_VIRTIO
        qemu_virtio2.mac_address = "52:54:00:a0:e5:1d"
        qemu_virtio2.cpu_to_pin = 3

        qemu_e1000_1 = Qemu(disk_path=r"../vms/ubuntu-20.img",
                            guest_ip="10.10.0.43",
                            host_ip="10.10.0.44")
        qemu_e1000_1.ethernet_dev = Qemu.QEMU_E1000
        qemu_e1000_2 = Qemu(disk_path=r"../vms/vm-copy.img",
                            guest_ip="10.10.0.42",
                            host_ip="10.10.0.44")
        qemu_e1000_2.ethernet_dev = Qemu.QEMU_E1000
        qemu_e1000_2.vnc_number = 11
        qemu_e1000_2.mac_address = "52:54:00:a0:e5:1d"
        qemu_e1000_2.cpu_to_pin = 3

        qemu_e1000_best1 = QemuE1000GuestOnly(disk_path=r"../vms/ubuntu-20.img",
                                              guest_ip="10.10.0.43",
                                              host_ip="10.10.0.44")
        qemu_e1000_best2 = QemuE1000GuestOnly(disk_path=r"../vms/vm-copy.img",
                                              guest_ip="10.10.0.42",
                                              host_ip="10.10.0.44")
        qemu_e1000_best2.vnc_number = 11
        qemu_e1000_best2.mac_address = "52:54:00:a0:e5:1d"
        qemu_e1000_best2.cpu_to_pin = 3

        for vm in (qemu_virtio1, qemu_virtio2, qemu_e1000_1, qemu_e1000_2, qemu_e1000_best1,
                   qemu_e1000_best2):
            vm.bridge = "br-vms"
            # vm.cpu_to_pin = "0-3"

        return [
            (qemu_e1000_1, qemu_e1000_2, "qemu_e1000_base"),
            (qemu_virtio1, qemu_virtio2, "qemu_virtio_base"),
            (qemu_e1000_best1, qemu_e1000_best2, "qemu_e1000_tcp_checksum"),
        ]