summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/intel.c
diff options
context:
space:
mode:
authorMichael Brown2014-04-27 22:51:26 +0200
committerMichael Brown2014-04-28 00:14:48 +0200
commit8a3dcefc0c71f925e43febb5d8626c2e1f117212 (patch)
tree25619aba5dbff24f98e5e0461e04713b5678b23f /src/drivers/net/intel.c
parent[netdevice] Profile common operations (diff)
downloadipxe-8a3dcefc0c71f925e43febb5d8626c2e1f117212.tar.gz
ipxe-8a3dcefc0c71f925e43febb5d8626c2e1f117212.tar.xz
ipxe-8a3dcefc0c71f925e43febb5d8626c2e1f117212.zip
[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/net/intel.c')
-rw-r--r--src/drivers/net/intel.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/drivers/net/intel.c b/src/drivers/net/intel.c
index f5601263..5abcdd7f 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;