2022-11-13 02:15:47 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright (C) 2022 Intel Corporation.
|
|
|
|
# All rights reserved.
|
2022-10-28 21:56:55 +00:00
|
|
|
#
|
2022-11-13 02:15:47 +00:00
|
|
|
|
2022-08-08 21:43:24 +00:00
|
|
|
from spdk.rpc.helpers import deprecated_alias
|
|
|
|
|
|
|
|
|
2022-05-26 23:46:01 +00:00
|
|
|
def accel_get_opc_assignments(client):
|
2022-08-08 21:43:24 +00:00
|
|
|
"""Get list of opcode name to module assignments.
|
2022-05-26 23:46:01 +00:00
|
|
|
"""
|
|
|
|
return client.call('accel_get_opc_assignments')
|
2022-07-21 21:15:09 +00:00
|
|
|
|
|
|
|
|
2022-08-08 21:43:24 +00:00
|
|
|
@deprecated_alias('accel_get_engine_info')
|
|
|
|
def accel_get_module_info(client):
|
|
|
|
"""Get list of valid module names and their operations.
|
2022-07-21 21:15:09 +00:00
|
|
|
"""
|
2022-08-08 21:43:24 +00:00
|
|
|
return client.call('accel_get_module_info')
|
2022-06-01 00:13:04 +00:00
|
|
|
|
|
|
|
|
2022-08-08 21:43:24 +00:00
|
|
|
def accel_assign_opc(client, opname, module):
|
|
|
|
"""Manually assign an operation to a module.
|
2022-06-01 00:13:04 +00:00
|
|
|
|
|
|
|
Args:
|
|
|
|
opname: name of operation
|
2022-08-08 21:43:24 +00:00
|
|
|
module: name of module
|
2022-06-01 00:13:04 +00:00
|
|
|
"""
|
|
|
|
params = {
|
|
|
|
'opname': opname,
|
2022-08-08 21:43:24 +00:00
|
|
|
'module': module,
|
2022-06-01 00:13:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return client.call('accel_assign_opc', params)
|
2022-10-04 19:16:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
def accel_crypto_key_create(client, cipher, key, key2, name):
|
|
|
|
"""Create Data Encryption Key Identifier.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
cipher: cipher
|
|
|
|
key: key
|
|
|
|
key2: key2
|
|
|
|
name: key name
|
|
|
|
"""
|
|
|
|
params = {
|
|
|
|
'cipher': cipher,
|
|
|
|
'key': key,
|
|
|
|
'name': name,
|
|
|
|
}
|
|
|
|
if key2 is not None:
|
|
|
|
params['key2'] = key2
|
|
|
|
|
|
|
|
return client.call('accel_crypto_key_create', params)
|
|
|
|
|
|
|
|
|
2023-02-10 08:20:58 +00:00
|
|
|
def accel_crypto_key_destroy(client, key_name):
|
2022-08-31 15:26:12 +00:00
|
|
|
"""Destroy Data Encryption Key.
|
|
|
|
|
|
|
|
Args:
|
2023-02-10 08:20:58 +00:00
|
|
|
key_name: key name
|
2022-08-31 15:26:12 +00:00
|
|
|
"""
|
|
|
|
params = {
|
2023-02-10 08:20:58 +00:00
|
|
|
'key_name': key_name
|
2022-08-31 15:26:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return client.call('accel_crypto_key_destroy', params)
|
|
|
|
|
|
|
|
|
2022-10-04 19:16:21 +00:00
|
|
|
def accel_crypto_keys_get(client, key_name):
|
|
|
|
"""Get a list of the crypto keys.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
key_name: Get information about a specific key
|
|
|
|
"""
|
|
|
|
params = {}
|
|
|
|
|
|
|
|
if key_name is not None:
|
|
|
|
params['key_name'] = key_name
|
|
|
|
|
|
|
|
return client.call('accel_crypto_keys_get', params)
|
2023-01-05 13:55:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
def accel_set_driver(client, name):
|
|
|
|
"""Select accel platform driver to execute operation chains.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
name: name of the driver
|
|
|
|
"""
|
|
|
|
return client.call('accel_set_driver', {'name': name})
|
2023-02-23 08:32:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
def accel_set_options(client, small_cache_size, large_cache_size):
|
|
|
|
"""Set accel framework's options."""
|
|
|
|
params = {}
|
|
|
|
|
|
|
|
if small_cache_size is not None:
|
|
|
|
params['small_cache_size'] = small_cache_size
|
|
|
|
if large_cache_size is not None:
|
|
|
|
params['large_cache_size'] = large_cache_size
|
|
|
|
|
|
|
|
return client.call('accel_set_options', params)
|