From 4739f62365c3f374d4333c5ce1c1a26b1dd7c29c Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Sat, 13 Jul 2019 16:23:39 +0800 Subject: [PATCH] nvmf: enable transport based scheduler decode in RPC. Purpose: To eanble the transport based scheduler in RPC. Previously, we only support it with configuration file. Signed-off-by: Ziye Yang Change-Id: I02ae9b1b316d4fec8b28b550e70dcdc78ce78722 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461645 Reviewed-by: Changpeng Liu Reviewed-by: Darek Stojaczyk Tested-by: SPDK CI Jenkins --- lib/event/subsystems/nvmf/nvmf_rpc.c | 2 ++ lib/event/subsystems/nvmf/nvmf_tgt.c | 2 ++ scripts/rpc.py | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/event/subsystems/nvmf/nvmf_rpc.c b/lib/event/subsystems/nvmf/nvmf_rpc.c index 8d260b573..654d7ebf7 100644 --- a/lib/event/subsystems/nvmf/nvmf_rpc.c +++ b/lib/event/subsystems/nvmf/nvmf_rpc.c @@ -1339,6 +1339,8 @@ static int decode_conn_sched(const struct spdk_json_val *val, void *out) *sched = CONNECT_SCHED_ROUND_ROBIN; } else if (spdk_json_strequal(val, "hostip") == true) { *sched = CONNECT_SCHED_HOST_IP; + } else if (spdk_json_strequal(val, "transport") == true) { + *sched = CONNECT_SCHED_TRANSPORT_OPTIMAL_GROUP; } else { SPDK_ERRLOG("Invalid connection scheduling parameter\n"); return -EINVAL; diff --git a/lib/event/subsystems/nvmf/nvmf_tgt.c b/lib/event/subsystems/nvmf/nvmf_tgt.c index f3964920e..3c52cfeda 100644 --- a/lib/event/subsystems/nvmf/nvmf_tgt.c +++ b/lib/event/subsystems/nvmf/nvmf_tgt.c @@ -515,6 +515,8 @@ get_conn_sched_string(enum spdk_nvmf_connect_sched sched) { if (sched == CONNECT_SCHED_HOST_IP) { return "hostip"; + } else if (sched == CONNECT_SCHED_TRANSPORT_OPTIMAL_GROUP) { + return "transport"; } else { return "roundrobin"; } diff --git a/scripts/rpc.py b/scripts/rpc.py index 11412839c..990ca4d5d 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -1402,7 +1402,7 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse p.add_argument('-s', '--conn-sched', help="""'roundrobin' - Schedule the incoming connections from any host on the cores in a round robin manner (Default). 'hostip' - Schedule all the incoming connections from a specific host IP on to the same core. Connections from different IP will be assigned to cores in a round - robin manner""") + robin manner. 'transport' - Schedule the connection according to the transport characteristics.""") p.set_defaults(func=set_nvmf_target_config) def nvmf_create_transport(args):