Loading include/spdk/env.h +15 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,21 @@ spdk_zmalloc(size_t size, size_t align, uint64_t *phys_addr); void spdk_free(void *buf); /** * Get a monotonic timestamp counter. */ uint64_t spdk_get_ticks(void); /** * Get the tick rate of spdk_get_ticks() per second. */ uint64_t spdk_get_ticks_hz(void); /** * Delay the given number of microseconds */ void spdk_delay_us(unsigned int us); #define SPDK_VTOPHYS_ERROR (0xFFFFFFFFFFFFFFFFULL) uint64_t spdk_vtophys(void *buf); Loading lib/env/env.c +16 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ #include <string.h> #include <rte_config.h> #include <rte_cycles.h> #include <rte_malloc.h> void * Loading @@ -54,3 +55,18 @@ spdk_free(void *buf) { return rte_free(buf); } uint64_t spdk_get_ticks(void) { return rte_get_timer_cycles(); } uint64_t spdk_get_ticks_hz(void) { return rte_get_timer_hz(); } void spdk_delay_us(unsigned int us) { return rte_delay_us(us); } lib/ioat/ioat_impl.h +1 −8 Original line number Diff line number Diff line Loading @@ -4,17 +4,10 @@ #include <pthread.h> #include <stdio.h> #include <stdbool.h> #include <string.h> #include <rte_config.h> #include <rte_malloc.h> #include <rte_atomic.h> #include <rte_cycles.h> #include "spdk/assert.h" #include "spdk/env.h" #include <rte_pci.h> /** * \file * Loading Loading @@ -44,6 +37,6 @@ /** * Delay us. */ #define ioat_delay_us(us) rte_delay_us(us) #define ioat_delay_us spdk_delay_us #endif /* __IOAT_IMPL_H__ */ lib/nvme/nvme_impl.h +2 −6 Original line number Diff line number Diff line Loading @@ -54,15 +54,11 @@ #include <unistd.h> #include <stdbool.h> #include <rte_config.h> #include <rte_cycles.h> #include <rte_malloc.h> #include <rte_mempool.h> #include <rte_version.h> #include <rte_memzone.h> #include <rte_eal.h> #include <rte_pci.h> #include "spdk/pci_ids.h" /** Loading Loading @@ -193,11 +189,11 @@ nvme_mempool_put(nvme_mempool_t *mp, void *buf) /** * Get a monotonic timestamp counter (used for measuring timeouts during initialization). */ #define nvme_get_tsc() rte_get_timer_cycles() #define nvme_get_tsc() spdk_get_ticks() /** * Get the tick rate of nvme_get_tsc() per second. */ #define nvme_get_tsc_hz() rte_get_timer_hz() #define nvme_get_tsc_hz() spdk_get_ticks_hz() #endif /* __NVME_IMPL_H__ */ Loading
include/spdk/env.h +15 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,21 @@ spdk_zmalloc(size_t size, size_t align, uint64_t *phys_addr); void spdk_free(void *buf); /** * Get a monotonic timestamp counter. */ uint64_t spdk_get_ticks(void); /** * Get the tick rate of spdk_get_ticks() per second. */ uint64_t spdk_get_ticks_hz(void); /** * Delay the given number of microseconds */ void spdk_delay_us(unsigned int us); #define SPDK_VTOPHYS_ERROR (0xFFFFFFFFFFFFFFFFULL) uint64_t spdk_vtophys(void *buf); Loading
lib/env/env.c +16 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ #include <string.h> #include <rte_config.h> #include <rte_cycles.h> #include <rte_malloc.h> void * Loading @@ -54,3 +55,18 @@ spdk_free(void *buf) { return rte_free(buf); } uint64_t spdk_get_ticks(void) { return rte_get_timer_cycles(); } uint64_t spdk_get_ticks_hz(void) { return rte_get_timer_hz(); } void spdk_delay_us(unsigned int us) { return rte_delay_us(us); }
lib/ioat/ioat_impl.h +1 −8 Original line number Diff line number Diff line Loading @@ -4,17 +4,10 @@ #include <pthread.h> #include <stdio.h> #include <stdbool.h> #include <string.h> #include <rte_config.h> #include <rte_malloc.h> #include <rte_atomic.h> #include <rte_cycles.h> #include "spdk/assert.h" #include "spdk/env.h" #include <rte_pci.h> /** * \file * Loading Loading @@ -44,6 +37,6 @@ /** * Delay us. */ #define ioat_delay_us(us) rte_delay_us(us) #define ioat_delay_us spdk_delay_us #endif /* __IOAT_IMPL_H__ */
lib/nvme/nvme_impl.h +2 −6 Original line number Diff line number Diff line Loading @@ -54,15 +54,11 @@ #include <unistd.h> #include <stdbool.h> #include <rte_config.h> #include <rte_cycles.h> #include <rte_malloc.h> #include <rte_mempool.h> #include <rte_version.h> #include <rte_memzone.h> #include <rte_eal.h> #include <rte_pci.h> #include "spdk/pci_ids.h" /** Loading Loading @@ -193,11 +189,11 @@ nvme_mempool_put(nvme_mempool_t *mp, void *buf) /** * Get a monotonic timestamp counter (used for measuring timeouts during initialization). */ #define nvme_get_tsc() rte_get_timer_cycles() #define nvme_get_tsc() spdk_get_ticks() /** * Get the tick rate of nvme_get_tsc() per second. */ #define nvme_get_tsc_hz() rte_get_timer_hz() #define nvme_get_tsc_hz() spdk_get_ticks_hz() #endif /* __NVME_IMPL_H__ */