diff options
author | Michael Brown <mcb30@ipxe.org> | 2014-04-27 21:51:26 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2014-04-27 23:14:48 +0100 |
commit | 8a3dcefc0c71f925e43febb5d8626c2e1f117212 (patch) | |
tree | 25619aba5dbff24f98e5e0461e04713b5678b23f /src/drivers | |
parent | 2c820d684afced4a73bb29484693c1a9e71c1583 (diff) | |
download | ipxe-8a3dcefc0c71f925e43febb5d8626c2e1f117212.tar.gz |
[intel] Profile common virtual machine operations
Operations which are negligible on physical hardware (such as issuing
a posted write to the transmit ring tail register) may involve
substantial amounts of processing within the hypervisor if running in
a virtual machine.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/net/intel.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/drivers/net/intel.c b/src/drivers/net/intel.c index f56012634..5abcdd7f8 100644 --- a/src/drivers/net/intel.c +++ b/src/drivers/net/intel.c @@ -30,6 +30,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include <ipxe/iobuf.h> #include <ipxe/malloc.h> #include <ipxe/pci.h> +#include <ipxe/profile.h> #include "intel.h" /** @file @@ -38,6 +39,18 @@ FILE_LICENCE ( GPL2_OR_LATER ); * */ +/** VM transmit profiler */ +static struct profiler intel_vm_tx_profiler __profiler = + { .name = "intel.vm_tx" }; + +/** VM receive refill profiler */ +static struct profiler intel_vm_refill_profiler __profiler = + { .name = "intel.vm_refill" }; + +/** VM poll profiler */ +static struct profiler intel_vm_poll_profiler __profiler = + { .name = "intel.vm_poll" }; + /****************************************************************************** * * EEPROM interface @@ -471,7 +484,9 @@ void intel_refill_rx ( struct intel_nic *intel ) { intel->rx_iobuf[rx_idx] = iobuf; /* Push descriptor to card */ + profile_start ( &intel_vm_refill_profiler ); writel ( rx_tail, intel->regs + intel->rx.reg + INTEL_xDT ); + profile_stop ( &intel_vm_refill_profiler ); DBGC2 ( intel, "INTEL %p RX %d is [%llx,%llx)\n", intel, rx_idx, ( ( unsigned long long ) address ), @@ -611,7 +626,9 @@ int intel_transmit ( struct net_device *netdev, struct io_buffer *iobuf ) { wmb(); /* Notify card that there are packets ready to transmit */ + profile_start ( &intel_vm_tx_profiler ); writel ( tx_tail, intel->regs + intel->tx.reg + INTEL_xDT ); + profile_stop ( &intel_vm_tx_profiler ); DBGC2 ( intel, "INTEL %p TX %d is [%llx,%llx)\n", intel, tx_idx, ( ( unsigned long long ) address ), @@ -703,7 +720,9 @@ static void intel_poll ( struct net_device *netdev ) { uint32_t icr; /* Check for and acknowledge interrupts */ + profile_start ( &intel_vm_poll_profiler ); icr = readl ( intel->regs + INTEL_ICR ); + profile_stop ( &intel_vm_poll_profiler ); if ( ! icr ) return; |