rpc: Rename set_vhost_controller_coalescing to vhost_controller_set_coalescing

Change-Id: Ic775a2397a2177c72ed8c42edf9ac0456a8aea1f
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469872
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Pawel Kaminski 2019-09-30 08:16:22 -04:00 committed by Jim Harris
parent edb1897147
commit bf15f51cef
8 changed files with 18 additions and 15 deletions

View File

@ -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. @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. 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 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 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 "delay_base_us": 80
}, },
"jsonrpc": "2.0", "jsonrpc": "2.0",
"method": "set_vhost_controller_coalescing", "method": "vhost_controller_set_coalescing",
"id": 1 "id": 1
} }
~~~ ~~~

View File

@ -1613,7 +1613,7 @@ spdk_vhost_config_json(struct spdk_json_write_ctx *w)
spdk_vhost_get_coalescing(vdev, &delay_base_us, &iops_threshold); spdk_vhost_get_coalescing(vdev, &delay_base_us, &iops_threshold);
if (delay_base_us) { if (delay_base_us) {
spdk_json_write_object_begin(w); 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_object_begin(w, "params");
spdk_json_write_named_string(w, "ctrlr", vdev->name); spdk_json_write_named_string(w, "ctrlr", vdev->name);

View File

@ -469,7 +469,7 @@ free_rpc_set_vhost_controllers_event_coalescing(struct rpc_vhost_ctrlr_coalescin
} }
static void 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) const struct spdk_json_val *params)
{ {
struct rpc_vhost_ctrlr_coalescing req = {0}; struct rpc_vhost_ctrlr_coalescing req = {0};
@ -511,8 +511,9 @@ invalid:
spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
spdk_strerror(-rc)); 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_RUNTIME)
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(vhost_controller_set_coalescing, set_vhost_controller_coalescing)
#ifdef SPDK_CONFIG_VHOST_INTERNAL_LIB #ifdef SPDK_CONFIG_VHOST_INTERNAL_LIB

View File

@ -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) p.set_defaults(func=framework_get_config)
# vhost # vhost
def set_vhost_controller_coalescing(args): def vhost_controller_set_coalescing(args):
rpc.vhost.set_vhost_controller_coalescing(args.client, rpc.vhost.vhost_controller_set_coalescing(args.client,
ctrlr=args.ctrlr, ctrlr=args.ctrlr,
delay_base_us=args.delay_base_us, delay_base_us=args.delay_base_us,
iops_threshold=args.iops_threshold) 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('ctrlr', help='controller name')
p.add_argument('delay_base_us', help='Base delay time', type=int) 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.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): def construct_vhost_scsi_controller(args):
rpc.vhost.construct_vhost_scsi_controller(args.client, rpc.vhost.construct_vhost_scsi_controller(args.client,

View File

@ -1,7 +1,8 @@
from .helpers import deprecated_alias 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. """Set coalescing for vhost controller.
Args: Args:
ctrlr: controller name 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, 'delay_base_us': delay_base_us,
'iops_threshold': iops_threshold, '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): def construct_vhost_scsi_controller(client, ctrlr, cpumask=None):

View File

@ -736,7 +736,7 @@ class UIVhostCtrl(UINode):
delay_base_us = self.ui_eval_param(delay_base_us, "number", None) delay_base_us = self.ui_eval_param(delay_base_us, "number", None)
iops_threshold = self.ui_eval_param(iops_threshold, "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, delay_base_us=delay_base_us,
iops_threshold=iops_threshold) iops_threshold=iops_threshold)

View File

@ -297,8 +297,8 @@ class UIRoot(UINode):
def add_vhost_scsi_lun(self, **kwargs): def add_vhost_scsi_lun(self, **kwargs):
rpc.vhost.add_vhost_scsi_lun(self.client, **kwargs) rpc.vhost.add_vhost_scsi_lun(self.client, **kwargs)
def set_vhost_controller_coalescing(self, **kwargs): def vhost_controller_set_coalescing(self, **kwargs):
rpc.vhost.set_vhost_controller_coalescing(self.client, **kwargs) rpc.vhost.vhost_controller_set_coalescing(self.client, **kwargs)
@verbose @verbose
def create_nvmf_transport(self, **kwargs): def create_nvmf_transport(self, **kwargs):

View File

@ -284,7 +284,7 @@ function create_vhost_subsystem_config() {
tgt_rpc construct_vhost_scsi_controller VhostScsiCtrlr0 tgt_rpc construct_vhost_scsi_controller VhostScsiCtrlr0
tgt_rpc add_vhost_scsi_lun VhostScsiCtrlr0 0 MallocForVhost0p3 tgt_rpc add_vhost_scsi_lun VhostScsiCtrlr0 0 MallocForVhost0p3
tgt_rpc add_vhost_scsi_lun VhostScsiCtrlr0 -1 MallocForVhost0p4 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 tgt_rpc construct_vhost_blk_controller VhostBlkCtrlr0 MallocForVhost0p5