This patch also drops support for automatically unbinding devices from the kernel - run scripts/setup.sh first. Our generic pci interface is now hidden behind include/spdk/pci.h and implemented in lib/util/pci.c. We no longer wrap the calls in nvme_impl.h or ioat_impl.h. The implementation now only uses DPDK and the libpciaccess dependency has been removed. If using a version of DPDK earlier than 16.07, enumerating devices by class code isn't available and only Intel SSDs will be discovered. DPDK 16.07 adds enumeration by class code and all NVMe devices will be correctly discovered. Change-Id: I0e8bac36b5ca57df604a2b310c47342c67dc9f3c Signed-off-by: Ben Walker <benjamin.walker@intel.com>
61 lines
1.3 KiB
C
61 lines
1.3 KiB
C
#ifndef __IOAT_IMPL_H__
|
|
#define __IOAT_IMPL_H__
|
|
|
|
#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/pci.h"
|
|
#include "spdk/vtophys.h"
|
|
|
|
#include <rte_pci.h>
|
|
|
|
/**
|
|
* \file
|
|
*
|
|
* This file describes the functions required to integrate
|
|
* the userspace IOAT driver for a specific implementation. This
|
|
* implementation is specific for DPDK. Users would revise it as
|
|
* necessary for their own particular environment if not using it
|
|
* within the SPDK framework.
|
|
*/
|
|
|
|
/**
|
|
* Allocate a pinned, physically contiguous memory buffer with the
|
|
* given size and alignment.
|
|
*/
|
|
static inline void *
|
|
ioat_zmalloc(const char *tag, size_t size, unsigned align, uint64_t *phys_addr)
|
|
{
|
|
void *buf = rte_malloc(tag, size, align);
|
|
|
|
if (buf) {
|
|
memset(buf, 0, size);
|
|
*phys_addr = rte_malloc_virt2phy(buf);
|
|
}
|
|
return buf;
|
|
}
|
|
|
|
/**
|
|
* Free a memory buffer previously allocated with ioat_zmalloc.
|
|
*/
|
|
#define ioat_free(buf) rte_free(buf)
|
|
|
|
/**
|
|
* Return the physical address for the specified virtual address.
|
|
*/
|
|
#define ioat_vtophys(buf) spdk_vtophys(buf)
|
|
|
|
/**
|
|
* Delay us.
|
|
*/
|
|
#define ioat_delay_us(us) rte_delay_us(us)
|
|
|
|
#endif /* __IOAT_IMPL_H__ */
|