From bf15f51cef0ae3ca251e148fcdde491d5cfada81 Mon Sep 17 00:00:00 2001 From: Pawel Kaminski Date: Mon, 30 Sep 2019 08:16:22 -0400 Subject: [PATCH] rpc: Rename set_vhost_controller_coalescing to vhost_controller_set_coalescing Change-Id: Ic775a2397a2177c72ed8c42edf9ac0456a8aea1f Signed-off-by: Pawel Kaminski Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469872 Tested-by: SPDK CI Jenkins Reviewed-by: Paul Luse Reviewed-by: Ben Walker Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto --- doc/jsonrpc.md | 4 ++-- lib/vhost/vhost.c | 2 +- lib/vhost/vhost_rpc.c | 5 +++-- scripts/rpc.py | 9 +++++---- scripts/rpc/vhost.py | 5 +++-- scripts/spdkcli/ui_node.py | 2 +- scripts/spdkcli/ui_root.py | 4 ++-- test/json_config/json_config.sh | 2 +- 8 files changed, 18 insertions(+), 15 deletions(-) diff --git a/doc/jsonrpc.md b/doc/jsonrpc.md index a9128ec5d..afa57b451 100644 --- a/doc/jsonrpc.md +++ b/doc/jsonrpc.md @@ -4339,7 +4339,7 @@ directory path needs to be valid UNIX socket name. @ref cpu_mask parameter is used to choose CPU on which pollers will be launched when new initiator is connecting. It must be a subset of application CPU mask. Default value is CPU mask of the application. -## set_vhost_controller_coalescing {#rpc_set_vhost_controller_coalescing} +## vhost_controller_set_coalescing {#rpc_vhost_controller_set_coalescing} Controls interrupt coalescing for specific target. Because `delay_base_us` is used to calculate delay in CPU ticks there is no hardcoded limit for this parameter. Only limitation is that final delay in CPU ticks might not overflow @@ -4366,7 +4366,7 @@ Example request: "delay_base_us": 80 }, "jsonrpc": "2.0", - "method": "set_vhost_controller_coalescing", + "method": "vhost_controller_set_coalescing", "id": 1 } ~~~ diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c index 366c1282e..38e618ff4 100644 --- a/lib/vhost/vhost.c +++ b/lib/vhost/vhost.c @@ -1613,7 +1613,7 @@ spdk_vhost_config_json(struct spdk_json_write_ctx *w) spdk_vhost_get_coalescing(vdev, &delay_base_us, &iops_threshold); if (delay_base_us) { spdk_json_write_object_begin(w); - spdk_json_write_named_string(w, "method", "set_vhost_controller_coalescing"); + spdk_json_write_named_string(w, "method", "vhost_controller_set_coalescing"); spdk_json_write_named_object_begin(w, "params"); spdk_json_write_named_string(w, "ctrlr", vdev->name); diff --git a/lib/vhost/vhost_rpc.c b/lib/vhost/vhost_rpc.c index baba3126b..1168fb2d2 100644 --- a/lib/vhost/vhost_rpc.c +++ b/lib/vhost/vhost_rpc.c @@ -469,7 +469,7 @@ free_rpc_set_vhost_controllers_event_coalescing(struct rpc_vhost_ctrlr_coalescin } static void -spdk_rpc_set_vhost_controller_coalescing(struct spdk_jsonrpc_request *request, +spdk_rpc_vhost_controller_set_coalescing(struct spdk_jsonrpc_request *request, const struct spdk_json_val *params) { struct rpc_vhost_ctrlr_coalescing req = {0}; @@ -511,8 +511,9 @@ invalid: spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, spdk_strerror(-rc)); } -SPDK_RPC_REGISTER("set_vhost_controller_coalescing", spdk_rpc_set_vhost_controller_coalescing, +SPDK_RPC_REGISTER("vhost_controller_set_coalescing", spdk_rpc_vhost_controller_set_coalescing, SPDK_RPC_RUNTIME) +SPDK_RPC_REGISTER_ALIAS_DEPRECATED(vhost_controller_set_coalescing, set_vhost_controller_coalescing) #ifdef SPDK_CONFIG_VHOST_INTERNAL_LIB diff --git a/scripts/rpc.py b/scripts/rpc.py index 63e36d516..50b613c52 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -1848,17 +1848,18 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse p.set_defaults(func=framework_get_config) # vhost - def set_vhost_controller_coalescing(args): - rpc.vhost.set_vhost_controller_coalescing(args.client, + def vhost_controller_set_coalescing(args): + rpc.vhost.vhost_controller_set_coalescing(args.client, ctrlr=args.ctrlr, delay_base_us=args.delay_base_us, iops_threshold=args.iops_threshold) - p = subparsers.add_parser('set_vhost_controller_coalescing', help='Set vhost controller coalescing') + p = subparsers.add_parser('vhost_controller_set_coalescing', aliases=['set_vhost_controller_coalescing'], + help='Set vhost controller coalescing') p.add_argument('ctrlr', help='controller name') p.add_argument('delay_base_us', help='Base delay time', type=int) p.add_argument('iops_threshold', help='IOPS threshold when coalescing is enabled', type=int) - p.set_defaults(func=set_vhost_controller_coalescing) + p.set_defaults(func=vhost_controller_set_coalescing) def construct_vhost_scsi_controller(args): rpc.vhost.construct_vhost_scsi_controller(args.client, diff --git a/scripts/rpc/vhost.py b/scripts/rpc/vhost.py index 81b80dea8..04f8fa59c 100644 --- a/scripts/rpc/vhost.py +++ b/scripts/rpc/vhost.py @@ -1,7 +1,8 @@ from .helpers import deprecated_alias -def set_vhost_controller_coalescing(client, ctrlr, delay_base_us, iops_threshold): +@deprecated_alias('set_vhost_controller_coalescing') +def vhost_controller_set_coalescing(client, ctrlr, delay_base_us, iops_threshold): """Set coalescing for vhost controller. Args: ctrlr: controller name @@ -13,7 +14,7 @@ def set_vhost_controller_coalescing(client, ctrlr, delay_base_us, iops_threshold 'delay_base_us': delay_base_us, 'iops_threshold': iops_threshold, } - return client.call('set_vhost_controller_coalescing', params) + return client.call('vhost_controller_set_coalescing', params) def construct_vhost_scsi_controller(client, ctrlr, cpumask=None): diff --git a/scripts/spdkcli/ui_node.py b/scripts/spdkcli/ui_node.py index 4c578d121..fc58607b6 100644 --- a/scripts/spdkcli/ui_node.py +++ b/scripts/spdkcli/ui_node.py @@ -736,7 +736,7 @@ class UIVhostCtrl(UINode): delay_base_us = self.ui_eval_param(delay_base_us, "number", None) iops_threshold = self.ui_eval_param(iops_threshold, "number", None) - self.get_root().set_vhost_controller_coalescing(ctrlr=self.ctrlr.ctrlr, + self.get_root().vhost_controller_set_coalescing(ctrlr=self.ctrlr.ctrlr, delay_base_us=delay_base_us, iops_threshold=iops_threshold) diff --git a/scripts/spdkcli/ui_root.py b/scripts/spdkcli/ui_root.py index 389a44f50..6ad7992a4 100644 --- a/scripts/spdkcli/ui_root.py +++ b/scripts/spdkcli/ui_root.py @@ -297,8 +297,8 @@ class UIRoot(UINode): def add_vhost_scsi_lun(self, **kwargs): rpc.vhost.add_vhost_scsi_lun(self.client, **kwargs) - def set_vhost_controller_coalescing(self, **kwargs): - rpc.vhost.set_vhost_controller_coalescing(self.client, **kwargs) + def vhost_controller_set_coalescing(self, **kwargs): + rpc.vhost.vhost_controller_set_coalescing(self.client, **kwargs) @verbose def create_nvmf_transport(self, **kwargs): diff --git a/test/json_config/json_config.sh b/test/json_config/json_config.sh index fbaefa2e4..ca5b7479a 100755 --- a/test/json_config/json_config.sh +++ b/test/json_config/json_config.sh @@ -284,7 +284,7 @@ function create_vhost_subsystem_config() { tgt_rpc construct_vhost_scsi_controller VhostScsiCtrlr0 tgt_rpc add_vhost_scsi_lun VhostScsiCtrlr0 0 MallocForVhost0p3 tgt_rpc add_vhost_scsi_lun VhostScsiCtrlr0 -1 MallocForVhost0p4 - tgt_rpc set_vhost_controller_coalescing VhostScsiCtrlr0 1 100 + tgt_rpc vhost_controller_set_coalescing VhostScsiCtrlr0 1 100 tgt_rpc construct_vhost_blk_controller VhostBlkCtrlr0 MallocForVhost0p5