RPC: rename scan_ioat_copy_engine to ioat_scan_copy_engine

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ida3a78ac095c56775851329c50256100807d632a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468126
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>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Maciej Wawryk 2019-09-11 15:08:40 +02:00 committed by Jim Harris
parent 2aed03f0f5
commit 44c859e39c
4 changed files with 24 additions and 18 deletions

View File

@ -279,7 +279,7 @@ Example response:
"get_subsystems",
"context_switch_monitor",
"kill_instance",
"scan_ioat_copy_engine",
"ioat_scan_copy_engine",
"bdev_virtio_attach_controller",
"bdev_virtio_scsi_get_devices",
"bdev_virtio_detach_controller",

View File

@ -61,33 +61,33 @@ free_rpc_pci_whitelist(struct rpc_pci_whitelist *list)
}
}
struct rpc_copy_engine_ioat {
struct rpc_ioat_scan_copy_engine {
struct rpc_pci_whitelist pci_whitelist;
};
static void
free_rpc_copy_engine_ioat(struct rpc_copy_engine_ioat *p)
free_rpc_ioat_scan_copy_engine(struct rpc_ioat_scan_copy_engine *p)
{
free_rpc_pci_whitelist(&p->pci_whitelist);
}
static const struct spdk_json_object_decoder rpc_copy_engine_ioat_decoder[] = {
{"pci_whitelist", offsetof(struct rpc_copy_engine_ioat, pci_whitelist), decode_rpc_pci_whitelist},
static const struct spdk_json_object_decoder rpc_ioat_scan_copy_engine_decoder[] = {
{"pci_whitelist", offsetof(struct rpc_ioat_scan_copy_engine, pci_whitelist), decode_rpc_pci_whitelist},
};
static void
spdk_rpc_scan_ioat_copy_engine(struct spdk_jsonrpc_request *request,
spdk_rpc_ioat_scan_copy_engine(struct spdk_jsonrpc_request *request,
const struct spdk_json_val *params)
{
struct rpc_copy_engine_ioat req = {};
struct rpc_ioat_scan_copy_engine req = {};
struct spdk_json_write_ctx *w;
int rc;
if (params != NULL) {
if (spdk_json_decode_object(params, rpc_copy_engine_ioat_decoder,
SPDK_COUNTOF(rpc_copy_engine_ioat_decoder),
if (spdk_json_decode_object(params, rpc_ioat_scan_copy_engine_decoder,
SPDK_COUNTOF(rpc_ioat_scan_copy_engine_decoder),
&req)) {
free_rpc_copy_engine_ioat(&req);
free_rpc_ioat_scan_copy_engine(&req);
SPDK_ERRLOG("spdk_json_decode_object() failed\n");
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
"Invalid parameters");
@ -96,7 +96,7 @@ spdk_rpc_scan_ioat_copy_engine(struct spdk_jsonrpc_request *request,
rc = copy_engine_ioat_add_whitelist_devices((const char **)req.pci_whitelist.bdfs,
req.pci_whitelist.num_bdfs);
free_rpc_copy_engine_ioat(&req);
free_rpc_ioat_scan_copy_engine(&req);
if (rc < 0) {
SPDK_ERRLOG("copy_engine_ioat_add_whitelist_devices() failed\n");
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
@ -111,4 +111,5 @@ spdk_rpc_scan_ioat_copy_engine(struct spdk_jsonrpc_request *request,
spdk_json_write_bool(w, true);
spdk_jsonrpc_end_result(request, w);
}
SPDK_RPC_REGISTER("scan_ioat_copy_engine", spdk_rpc_scan_ioat_copy_engine, SPDK_RPC_STARTUP)
SPDK_RPC_REGISTER("ioat_scan_copy_engine", spdk_rpc_ioat_scan_copy_engine, SPDK_RPC_STARTUP)
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(ioat_scan_copy_engine, scan_ioat_copy_engine)

View File

@ -1922,17 +1922,18 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
p.set_defaults(func=bdev_virtio_detach_controller)
# ioat
def scan_ioat_copy_engine(args):
def ioat_scan_copy_engine(args):
pci_whitelist = []
if args.pci_whitelist:
for w in args.pci_whitelist.strip().split(" "):
pci_whitelist.append(w)
rpc.ioat.scan_ioat_copy_engine(args.client, pci_whitelist)
rpc.ioat.ioat_scan_copy_engine(args.client, pci_whitelist)
p = subparsers.add_parser('scan_ioat_copy_engine', help='Set scan and enable IOAT copy engine offload.')
p = subparsers.add_parser('ioat_scan_copy_engine', aliases=['scan_ioat_copy_engine'],
help='Set scan and enable IOAT copy engine offload.')
p.add_argument('-w', '--pci-whitelist', help="""Whitespace-separated list of PCI addresses in
domain:bus:device.function format or domain.bus.device.function format""")
p.set_defaults(func=scan_ioat_copy_engine)
p.set_defaults(func=ioat_scan_copy_engine)
# bdev_nvme_send_cmd
def bdev_nvme_send_cmd(args):

View File

@ -1,4 +1,8 @@
def scan_ioat_copy_engine(client, pci_whitelist):
from .helpers import deprecated_alias
@deprecated_alias('scan_ioat_copy_engine')
def ioat_scan_copy_engine(client, pci_whitelist):
"""Scan and enable IOAT copy engine.
Args:
@ -9,4 +13,4 @@ def scan_ioat_copy_engine(client, pci_whitelist):
params = {}
if pci_whitelist:
params['pci_whitelist'] = pci_whitelist
return client.call('scan_ioat_copy_engine', params)
return client.call('ioat_scan_copy_engine', params)