The mlx5 accel module supports crypto operations. Data buffer is split into `block_size` chunks and each chunk is enrypted individually. mlx5 library contains some utility functions that will later be used by other libraries, this lib will be exntended later. Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com> Change-Id: Iacdd8caaade477277d5a95cfd53e9910e280a73b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15420 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
44 lines
1.3 KiB
C
44 lines
1.3 KiB
C
/* SPDX-License-Identifier: BSD-3-Clause
|
|
* Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
*/
|
|
|
|
#include "spdk/rpc.h"
|
|
#include "spdk/util.h"
|
|
#include "spdk/log.h"
|
|
|
|
#include "accel_mlx5.h"
|
|
|
|
static const struct spdk_json_object_decoder rpc_mlx5_module_decoder[] = {
|
|
{"qp_size", offsetof(struct accel_mlx5_attr, qp_size), spdk_json_decode_uint16, true},
|
|
{"num_requests", offsetof(struct accel_mlx5_attr, num_requests), spdk_json_decode_uint32, true},
|
|
};
|
|
|
|
static void
|
|
rpc_mlx5_scan_accel_module(struct spdk_jsonrpc_request *request,
|
|
const struct spdk_json_val *params)
|
|
{
|
|
struct accel_mlx5_attr attr;
|
|
int rc;
|
|
|
|
accel_mlx5_get_default_attr(&attr);
|
|
|
|
if (params != NULL) {
|
|
if (spdk_json_decode_object(params, rpc_mlx5_module_decoder,
|
|
SPDK_COUNTOF(rpc_mlx5_module_decoder),
|
|
&attr)) {
|
|
SPDK_ERRLOG("spdk_json_decode_object() failed\n");
|
|
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_PARSE_ERROR,
|
|
"spdk_json_decode_object failed");
|
|
return;
|
|
}
|
|
}
|
|
|
|
rc = accel_mlx5_enable(&attr);
|
|
if (rc) {
|
|
spdk_jsonrpc_send_error_response_fmt(request, rc, "mlx5 scan failed with %d\n", rc);
|
|
} else {
|
|
spdk_jsonrpc_send_bool_response(request, true);
|
|
}
|
|
}
|
|
SPDK_RPC_REGISTER("mlx5_scan_accel_module", rpc_mlx5_scan_accel_module, SPDK_RPC_STARTUP)
|