per Intel policy to include file commit date using git cmd below. The policy does not apply to non-Intel (C) notices. git log --follow -C90% --format=%ad --date default <file> | tail -1 and then pull just the 4 digit year from the result. Intel copyrights were not added to files where Intel either had no contribution ot the contribution lacked substance (ie license header updates, formatting changes, etc). Contribution date used "--follow -C95%" to get the most accurate date. Note that several files in this patch didn't end the license/(c) block with a blank comment line so these were added as the vast majority of files do have this last blank line. Simply there for consistency. Signed-off-by: paul luse <paul.e.luse@intel.com> Change-Id: Id5b7ce4f658fe87132f14139ead58d6e285c04d4 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15192 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Community-CI: Mellanox Build Bot
102 lines
2.4 KiB
C
102 lines
2.4 KiB
C
/* SPDX-License-Identifier: BSD-3-Clause
|
|
* Copyright (C) 2020 Intel Corporation.
|
|
* All rights reserved.
|
|
*/
|
|
|
|
#ifndef SPDK_ACCEL_MODULE_H
|
|
#define SPDK_ACCEL_MODULE_H
|
|
|
|
#include "spdk/stdinc.h"
|
|
|
|
#include "spdk/accel.h"
|
|
#include "spdk/queue.h"
|
|
#include "spdk/config.h"
|
|
|
|
struct spdk_accel_task;
|
|
|
|
void spdk_accel_task_complete(struct spdk_accel_task *task, int status);
|
|
|
|
struct spdk_accel_task {
|
|
struct accel_io_channel *accel_ch;
|
|
spdk_accel_completion_cb cb_fn;
|
|
void *cb_arg;
|
|
union {
|
|
struct {
|
|
struct iovec *iovs; /* iovs passed by the caller */
|
|
uint32_t iovcnt; /* iovcnt passed by the caller */
|
|
} s;
|
|
void *src;
|
|
};
|
|
union {
|
|
struct {
|
|
struct iovec *iovs; /* iovs passed by the caller */
|
|
uint32_t iovcnt; /* iovcnt passed by the caller */
|
|
} d;
|
|
void *dst;
|
|
void *src2;
|
|
};
|
|
union {
|
|
void *dst2;
|
|
uint32_t seed;
|
|
uint64_t fill_pattern;
|
|
};
|
|
union {
|
|
uint32_t *crc_dst;
|
|
uint32_t *output_size;
|
|
};
|
|
enum accel_opcode op_code;
|
|
uint64_t nbytes;
|
|
uint64_t nbytes_dst;
|
|
int flags;
|
|
int status;
|
|
TAILQ_ENTRY(spdk_accel_task) link;
|
|
};
|
|
|
|
struct spdk_accel_module_if {
|
|
/** Initialization function for the module. Called by the spdk
|
|
* application during startup.
|
|
*
|
|
* Modules are required to define this function.
|
|
*/
|
|
int (*module_init)(void);
|
|
|
|
/** Finish function for the module. Called by the spdk application
|
|
* before the spdk application exits to perform any necessary cleanup.
|
|
*
|
|
* Modules are not required to define this function.
|
|
*/
|
|
void (*module_fini)(void *ctx);
|
|
|
|
/**
|
|
* Write Acceleration module configuration into provided JSON context.
|
|
*/
|
|
void (*write_config_json)(struct spdk_json_write_ctx *w);
|
|
|
|
/**
|
|
* Returns the allocation size required for the modules to use for context.
|
|
*/
|
|
size_t (*get_ctx_size)(void);
|
|
|
|
const char *name;
|
|
bool (*supports_opcode)(enum accel_opcode);
|
|
struct spdk_io_channel *(*get_io_channel)(void);
|
|
int (*submit_tasks)(struct spdk_io_channel *ch, struct spdk_accel_task *accel_task);
|
|
|
|
TAILQ_ENTRY(spdk_accel_module_if) tailq;
|
|
};
|
|
|
|
void spdk_accel_module_list_add(struct spdk_accel_module_if *accel_module);
|
|
|
|
#define SPDK_ACCEL_MODULE_REGISTER(name, module) \
|
|
static void __attribute__((constructor)) _spdk_accel_module_register_##name(void) \
|
|
{ \
|
|
spdk_accel_module_list_add(module); \
|
|
}
|
|
|
|
/**
|
|
* Called by an accel module when cleanup initiated during .module_fini has completed
|
|
*/
|
|
void spdk_accel_module_finish(void);
|
|
|
|
#endif
|