}
uint64_t bench_tsc_to_ms(cycles_t tsc);
+uint64_t bench_tsc_to_us(cycles_t tsc);
#endif // ARCH_X86_64_BARRELFISH_BENCH_H
/// Number of PBUF structs available
#ifndef MEMP_NUM_PBUF
-#define MEMP_NUM_PBUF (4*16384)
+#define MEMP_NUM_PBUF (16384)
//#define MEMP_NUM_PBUF 4096
#endif // MEMP_NUM_PBUF
/// Number of PBUF buffers available
#ifndef PBUF_POOL_SIZE
-#define PBUF_POOL_SIZE (4*16384)
+#define PBUF_POOL_SIZE (16384)
//#define PBUF_POOL_SIZE 4096
#endif // PBUF_POOL_SIZE
{
return tsc / tscperms;
}
+
+uint64_t bench_tsc_to_us(cycles_t tsc){
+ return tsc / (tscperms/1000);
+}
if (payload != NULL) {
memp_free(MEMP_PBUF_POOL, payload);
}
- //*((uint32_t *)0) = 1;
USER_PANIC("alloc_pool_pbuf: failed!");
return NULL;
}
if (err_is_fail(err)) {
DEBUG_ERR(err, "in vfs_close");
}
-
+ free(buf);
return filesize;
}
assert(err_is_ok(err));
printf("mount done\n");
- printf("reading file [%s]\n", argv[2]);
+ printf("reading file 1. time [%s]\n", argv[2]);
cat(argv[2]);
- printf("Benchmark done.\n");
+ printf("receive 1 done.\n");
+
+ /*
+ printf("reading file 2. time [%s]\n", argv[2]);
+ cat(argv[2]);
+ printf("receive 2 done.\n"); */
+ printf("All done.\n");
struct waitset *ws = get_default_waitset();
while (1) {
cFiles = [ "vmkitmon.c", "guest.c", "realmode.c",
"hdd.c", "keyboard.c", "console.c",
"apic.c", "lpc.c", "pc16550d.c", "pci.c",
- "pci_host.c", "pci_hostbridge.c", "pci_ethernet.c", "pci_vmkitmon_eth.c" ],
+ "pci_host.c", "pci_hostbridge.c", "pci_ethernet.c", "pci_vmkitmon_eth.c", "benchmark.c" ],
flounderBindings = [ "net_queue_manager",
"net_soft_filters" ],
mackerelDevices = [ "amd_vmcb", "lpc_timer", "e1000",
"pc16550d_mem", "pci_hdr0_mem" ],
- addLibraries = libDeps [ "spawndomain", "netQmng", "x86emu", "vfs", "pci"],
+ addLibraries = libDeps [ "spawndomain", "netQmng", "x86emu", "vfs", "pci", "bench"],
-- addLibraries = libDeps [ "spawndomain", "netQmng"],
architectures = ["x86_64"]
}
#include "pci.h"
#include "pci_devices.h"
#include "pci_ethernet.h"
+#include "benchmark.h"
#include <pci/pci.h>
#include <arch/x86/barrelfish/iocap_arch.h>
#include <dev/e10k_dev.h>
*ptr = 1;
}
}
+ record_packet_transmit_to_net();
}
if(addr == RDT0_OFFSET){
//Inspect the contents of the RECEIVE descriptors
// static uint32_t last_rdh = 600;
static void pci_ethernet_interrupt_handler(void *arg)
{
+ record_packet_receive_from_net();
struct pci_device *dev = (struct pci_device *)arg;
lpc_pic_assert_irq(dev->lpc, dev->irq);
}
#include "pci_vmkitmon_eth.h"
#include "guest.h"
#include "string.h"
+#include "benchmark.h"
#include <pci/devids.h>
#include <net_queue_manager/net_queue_manager.h>
#include <if/net_queue_manager_defs.h>
}
#endif
-//TODO
static errval_t transmit_pbuf_list_fn(struct driver_buffer *buffers, size_t size, void *opaque) {
struct pci_vmkitmon_eth *h = the_pci_vmkitmon_eth->state;
int i;
uint64_t paddr;
+ record_packet_receive_from_bf();
+
VMKITMON_ETH_DEBUG("transmit_pbuf_list_fn, no_pbufs: 0x%lx\n", size);
struct pci_vmkitmon_eth_rxdesc * first_rx = (struct pci_vmkitmon_eth_rxdesc *) guest_to_host( h->mmio_register[PCI_VMKITMON_ETH_RXDESC_ADR] );
struct pci_vmkitmon_eth_txdesc * cur_tx =first_tx + i;
if(cur_tx->len != 0 && cur_tx->addr != 0){
void *hv_addr = (void *)guest_to_host(cur_tx->addr);
- VMKITMON_ETH_DEBUG("Sending packet at txdesc %d, addr: 0x%x, len: 0x%x\n", i, cur_tx->addr, cur_tx->len);
+ //VMKITMON_ETH_DEBUG("Sending packet at txdesc %d, addr: 0x%x, len: 0x%x\n", i, cur_tx->addr, cur_tx->len);
+ //printf("Sending packet at txdesc %d, addr: 0x%x, len: 0x%x\n", i, cur_tx->addr, cur_tx->len);
if(receive_free == 0) {
VMKITMON_ETH_DEBUG("Could not deliver packet, no receive buffer available. Drop packet.\n");
printf("Could not deliver packet, no receive buffer available. Drop packet.\n");
} else {
memcpy(rx_buffer_ring[receive_bufptr].vaddr, hv_addr, cur_tx->len);
+ record_packet_transmit_to_bf();
process_received_packet(rx_buffer_ring[receive_bufptr].opaque, cur_tx->len, true);
/*
if(*(unsigned char *)hv_addr == 0xaa) {
#include <vfs/vfs.h>
#include <timer/timer.h>
#include "realmode.h"
+#include <bench/bench.h>
#include "pci/devids.h"
#include <pci/pci.h>
const char *imagefile = IMAGEFILE;
vfs_init();
+ bench_init();
err = timer_init();
if (err_is_fail(err)) {