copy_engine: add spdk_ prefix to types
Change-Id: I060718887950ee7f890e76d7e041e70db39974a2 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
d27b24c94b
commit
ee64969a7b
@ -43,20 +43,20 @@
|
||||
|
||||
#include "spdk/queue.h"
|
||||
|
||||
typedef void (*copy_completion_cb)(void *ref, int status);
|
||||
typedef void (*spdk_copy_completion_cb)(void *ref, int status);
|
||||
|
||||
struct spdk_io_channel;
|
||||
|
||||
struct copy_task {
|
||||
copy_completion_cb cb;
|
||||
struct spdk_copy_task {
|
||||
spdk_copy_completion_cb cb;
|
||||
uint8_t offload_ctx[0];
|
||||
};
|
||||
|
||||
struct spdk_copy_engine {
|
||||
int64_t (*copy)(void *cb_arg, struct spdk_io_channel *ch, void *dst, void *src,
|
||||
uint64_t nbytes, copy_completion_cb cb);
|
||||
uint64_t nbytes, spdk_copy_completion_cb cb);
|
||||
int64_t (*fill)(void *cb_arg, struct spdk_io_channel *ch, void *dst, uint8_t fill,
|
||||
uint64_t nbytes, copy_completion_cb cb);
|
||||
uint64_t nbytes, spdk_copy_completion_cb cb);
|
||||
struct spdk_io_channel *(*get_io_channel)(uint32_t priority);
|
||||
};
|
||||
|
||||
@ -87,10 +87,10 @@ struct spdk_copy_module_if {
|
||||
|
||||
void spdk_copy_engine_register(struct spdk_copy_engine *copy_engine);
|
||||
struct spdk_io_channel *spdk_copy_engine_get_io_channel(uint32_t priority);
|
||||
int64_t spdk_copy_submit(struct copy_task *copy_req, struct spdk_io_channel *ch, void *dst,
|
||||
void *src, uint64_t nbytes, copy_completion_cb cb);
|
||||
int64_t spdk_copy_submit_fill(struct copy_task *copy_req, struct spdk_io_channel *ch, void *dst,
|
||||
uint8_t fill, uint64_t nbytes, copy_completion_cb cb);
|
||||
int64_t spdk_copy_submit(struct spdk_copy_task *copy_req, struct spdk_io_channel *ch, void *dst,
|
||||
void *src, uint64_t nbytes, spdk_copy_completion_cb cb);
|
||||
int64_t spdk_copy_submit_fill(struct spdk_copy_task *copy_req, struct spdk_io_channel *ch,
|
||||
void *dst, uint8_t fill, uint64_t nbytes, spdk_copy_completion_cb cb);
|
||||
int spdk_copy_module_get_max_ctx_size(void);
|
||||
void spdk_copy_module_list_add(struct spdk_copy_module_if *copy_module);
|
||||
|
||||
|
@ -61,15 +61,15 @@ struct malloc_task {
|
||||
};
|
||||
|
||||
static struct malloc_task *
|
||||
__malloc_task_from_copy_task(struct copy_task *ct)
|
||||
__malloc_task_from_copy_task(struct spdk_copy_task *ct)
|
||||
{
|
||||
return (struct malloc_task *)((uintptr_t)ct - sizeof(struct malloc_task));
|
||||
}
|
||||
|
||||
static struct copy_task *
|
||||
static struct spdk_copy_task *
|
||||
__copy_task_from_malloc_task(struct malloc_task *mt)
|
||||
{
|
||||
return (struct copy_task *)((uintptr_t)mt + sizeof(struct malloc_task));
|
||||
return (struct spdk_copy_task *)((uintptr_t)mt + sizeof(struct malloc_task));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -73,16 +73,16 @@ spdk_memcpy_register(struct spdk_copy_engine *copy_engine)
|
||||
static void
|
||||
copy_engine_done(void *ref, int status)
|
||||
{
|
||||
struct copy_task *req = (struct copy_task *)ref;
|
||||
struct spdk_copy_task *req = (struct spdk_copy_task *)ref;
|
||||
|
||||
req->cb(req, status);
|
||||
}
|
||||
|
||||
int64_t
|
||||
spdk_copy_submit(struct copy_task *copy_req, struct spdk_io_channel *ch,
|
||||
void *dst, void *src, uint64_t nbytes, copy_completion_cb cb)
|
||||
spdk_copy_submit(struct spdk_copy_task *copy_req, struct spdk_io_channel *ch,
|
||||
void *dst, void *src, uint64_t nbytes, spdk_copy_completion_cb cb)
|
||||
{
|
||||
struct copy_task *req = copy_req;
|
||||
struct spdk_copy_task *req = copy_req;
|
||||
struct copy_io_channel *copy_ch = spdk_io_channel_get_ctx(ch);
|
||||
|
||||
req->cb = cb;
|
||||
@ -91,10 +91,10 @@ spdk_copy_submit(struct copy_task *copy_req, struct spdk_io_channel *ch,
|
||||
}
|
||||
|
||||
int64_t
|
||||
spdk_copy_submit_fill(struct copy_task *copy_req, struct spdk_io_channel *ch,
|
||||
void *dst, uint8_t fill, uint64_t nbytes, copy_completion_cb cb)
|
||||
spdk_copy_submit_fill(struct spdk_copy_task *copy_req, struct spdk_io_channel *ch,
|
||||
void *dst, uint8_t fill, uint64_t nbytes, spdk_copy_completion_cb cb)
|
||||
{
|
||||
struct copy_task *req = copy_req;
|
||||
struct spdk_copy_task *req = copy_req;
|
||||
struct copy_io_channel *copy_ch = spdk_io_channel_get_ctx(ch);
|
||||
|
||||
req->cb = cb;
|
||||
@ -105,26 +105,26 @@ spdk_copy_submit_fill(struct copy_task *copy_req, struct spdk_io_channel *ch,
|
||||
/* memcpy default copy engine */
|
||||
static int64_t
|
||||
mem_copy_submit(void *cb_arg, struct spdk_io_channel *ch, void *dst, void *src, uint64_t nbytes,
|
||||
copy_completion_cb cb)
|
||||
spdk_copy_completion_cb cb)
|
||||
{
|
||||
struct copy_task *copy_req;
|
||||
struct spdk_copy_task *copy_req;
|
||||
|
||||
rte_memcpy(dst, src, (size_t)nbytes);
|
||||
copy_req = (struct copy_task *)((uintptr_t)cb_arg -
|
||||
offsetof(struct copy_task, offload_ctx));
|
||||
copy_req = (struct spdk_copy_task *)((uintptr_t)cb_arg -
|
||||
offsetof(struct spdk_copy_task, offload_ctx));
|
||||
cb(copy_req, 0);
|
||||
return nbytes;
|
||||
}
|
||||
|
||||
static int64_t
|
||||
mem_copy_fill(void *cb_arg, struct spdk_io_channel *ch, void *dst, uint8_t fill, uint64_t nbytes,
|
||||
copy_completion_cb cb)
|
||||
spdk_copy_completion_cb cb)
|
||||
{
|
||||
struct copy_task *copy_req;
|
||||
struct spdk_copy_task *copy_req;
|
||||
|
||||
memset(dst, fill, nbytes);
|
||||
copy_req = (struct copy_task *)((uintptr_t)cb_arg -
|
||||
offsetof(struct copy_task, offload_ctx));
|
||||
copy_req = (struct spdk_copy_task *)((uintptr_t)cb_arg -
|
||||
offsetof(struct spdk_copy_task, offload_ctx));
|
||||
cb(copy_req, 0);
|
||||
|
||||
return nbytes;
|
||||
@ -157,7 +157,7 @@ static struct spdk_io_channel *mem_get_io_channel(uint32_t priority)
|
||||
static int
|
||||
copy_engine_mem_get_ctx_size(void)
|
||||
{
|
||||
return sizeof(struct copy_task);
|
||||
return sizeof(struct spdk_copy_task);
|
||||
}
|
||||
|
||||
int spdk_copy_module_get_max_ctx_size(void)
|
||||
|
@ -104,7 +104,7 @@ ioat_free_device(struct ioat_device *dev)
|
||||
}
|
||||
|
||||
struct ioat_task {
|
||||
copy_completion_cb cb;
|
||||
spdk_copy_completion_cb cb;
|
||||
};
|
||||
|
||||
static int copy_engine_ioat_init(void);
|
||||
@ -113,7 +113,7 @@ static void copy_engine_ioat_exit(void);
|
||||
static int
|
||||
copy_engine_ioat_get_ctx_size(void)
|
||||
{
|
||||
return sizeof(struct ioat_task) + sizeof(struct copy_task);
|
||||
return sizeof(struct ioat_task) + sizeof(struct spdk_copy_task);
|
||||
}
|
||||
|
||||
SPDK_COPY_MODULE_REGISTER(copy_engine_ioat_init, copy_engine_ioat_exit, NULL,
|
||||
@ -137,19 +137,19 @@ copy_engine_ioat_exit(void)
|
||||
static void
|
||||
ioat_done(void *cb_arg)
|
||||
{
|
||||
struct copy_task *copy_req;
|
||||
struct spdk_copy_task *copy_req;
|
||||
struct ioat_task *ioat_task = cb_arg;
|
||||
|
||||
copy_req = (struct copy_task *)
|
||||
copy_req = (struct spdk_copy_task *)
|
||||
((uintptr_t)ioat_task -
|
||||
offsetof(struct copy_task, offload_ctx));
|
||||
offsetof(struct spdk_copy_task, offload_ctx));
|
||||
|
||||
ioat_task->cb(copy_req, 0);
|
||||
}
|
||||
|
||||
static int64_t
|
||||
ioat_copy_submit(void *cb_arg, struct spdk_io_channel *ch, void *dst, void *src, uint64_t nbytes,
|
||||
copy_completion_cb cb)
|
||||
spdk_copy_completion_cb cb)
|
||||
{
|
||||
struct ioat_task *ioat_task = (struct ioat_task *)cb_arg;
|
||||
struct ioat_io_channel *ioat_ch = spdk_io_channel_get_ctx(ch);
|
||||
@ -163,7 +163,7 @@ ioat_copy_submit(void *cb_arg, struct spdk_io_channel *ch, void *dst, void *src,
|
||||
|
||||
static int64_t
|
||||
ioat_copy_submit_fill(void *cb_arg, struct spdk_io_channel *ch, void *dst, uint8_t fill,
|
||||
uint64_t nbytes, copy_completion_cb cb)
|
||||
uint64_t nbytes, spdk_copy_completion_cb cb)
|
||||
{
|
||||
struct ioat_task *ioat_task = (struct ioat_task *)cb_arg;
|
||||
struct ioat_io_channel *ioat_ch = spdk_io_channel_get_ctx(ch);
|
||||
|
Loading…
Reference in New Issue
Block a user