Commit a62b194f authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

nvme: add timestamp counter interface to nvme_impl



Change-Id: Ic652163e4f5944c1516eaf58615f7eabcbe34a7a
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent d82473cd
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
#include "spdk/nvme_spec.h"
#include <assert.h>
#include <rte_config.h>
#include <rte_cycles.h>
#include <rte_malloc.h>
#include <rte_mempool.h>
#include <rte_memcpy.h>
@@ -125,6 +126,16 @@ extern struct rte_mempool *request_mempool;
 */
#define nvme_dealloc_request(buf)	rte_mempool_put(request_mempool, buf)

/**
 * Get a monotonic timestamp counter (used for measuring timeouts during initialization).
 */
#define nvme_get_tsc()			rte_get_timer_cycles()

/**
 * Get the tick rate of nvme_get_tsc() per second.
 */
#define nvme_get_tsc_hz()		rte_get_timer_hz()

/**
 *
 */
+4 −0
Original line number Diff line number Diff line
@@ -78,6 +78,10 @@ do \

#define nvme_dealloc_request(buf)	free(buf)

extern uint64_t g_ut_tsc;
#define nvme_get_tsc()			(g_ut_tsc)
#define nvme_get_tsc_hz()		(1000000)

static inline int
nvme_pci_enumerate(int (*enum_cb)(void *enum_ctx, struct spdk_pci_device *pci_dev), void *enum_ctx)
{