1 /*- 2 * BSD LICENSE 3 * 4 * Copyright (c) Intel Corporation. All rights reserved. 5 * Copyright (c) 2019 Mellanox Technologies LTD. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 11 * * Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * * Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in 15 * the documentation and/or other materials provided with the 16 * distribution. 17 * * Neither the name of Intel Corporation nor the names of its 18 * contributors may be used to endorse or promote products derived 19 * from this software without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 */ 33 34 #include "spdk/stdinc.h" 35 36 #include "spdk/event.h" 37 #include "spdk/rpc.h" 38 #include "spdk/string.h" 39 #include "spdk/util.h" 40 #include "spdk/env.h" 41 #include "spdk/thread.h" 42 43 #include "spdk/log.h" 44 #include "spdk_internal/event.h" 45 #include "spdk_internal/thread.h" 46 47 struct rpc_spdk_kill_instance { 48 char *sig_name; 49 }; 50 51 static void 52 free_rpc_spdk_kill_instance(struct rpc_spdk_kill_instance *req) 53 { 54 free(req->sig_name); 55 } 56 57 static const struct spdk_json_object_decoder rpc_spdk_kill_instance_decoders[] = { 58 {"sig_name", offsetof(struct rpc_spdk_kill_instance, sig_name), spdk_json_decode_string}, 59 }; 60 61 static void 62 rpc_spdk_kill_instance(struct spdk_jsonrpc_request *request, 63 const struct spdk_json_val *params) 64 { 65 static const struct { 66 const char *signal_string; 67 int32_t signal; 68 } signals[] = { 69 {"SIGINT", SIGINT}, 70 {"SIGTERM", SIGTERM}, 71 {"SIGQUIT", SIGQUIT}, 72 {"SIGHUP", SIGHUP}, 73 {"SIGKILL", SIGKILL}, 74 {"SIGUSR1", SIGUSR1}, 75 }; 76 size_t i, sig_count; 77 int signal; 78 struct rpc_spdk_kill_instance req = {}; 79 80 if (spdk_json_decode_object(params, rpc_spdk_kill_instance_decoders, 81 SPDK_COUNTOF(rpc_spdk_kill_instance_decoders), 82 &req)) { 83 SPDK_DEBUGLOG(app_rpc, "spdk_json_decode_object failed\n"); 84 goto invalid; 85 } 86 87 sig_count = SPDK_COUNTOF(signals); 88 signal = spdk_strtol(req.sig_name, 10); 89 for (i = 0 ; i < sig_count; i++) { 90 if (strcmp(req.sig_name, signals[i].signal_string) == 0 || 91 signal == signals[i].signal) { 92 break; 93 } 94 } 95 96 if (i == sig_count) { 97 goto invalid; 98 } 99 100 SPDK_DEBUGLOG(app_rpc, "sending signal %d\n", signals[i].signal); 101 free_rpc_spdk_kill_instance(&req); 102 kill(getpid(), signals[i].signal); 103 104 spdk_jsonrpc_send_bool_response(request, true); 105 return; 106 107 invalid: 108 spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, "Invalid parameters"); 109 free_rpc_spdk_kill_instance(&req); 110 } 111 SPDK_RPC_REGISTER("spdk_kill_instance", rpc_spdk_kill_instance, SPDK_RPC_RUNTIME) 112 SPDK_RPC_REGISTER_ALIAS_DEPRECATED(spdk_kill_instance, kill_instance) 113 114 115 struct rpc_framework_monitor_context_switch { 116 bool enabled; 117 }; 118 119 static const struct spdk_json_object_decoder rpc_framework_monitor_context_switch_decoders[] = { 120 {"enabled", offsetof(struct rpc_framework_monitor_context_switch, enabled), spdk_json_decode_bool}, 121 }; 122 123 static void 124 rpc_framework_monitor_context_switch(struct spdk_jsonrpc_request *request, 125 const struct spdk_json_val *params) 126 { 127 struct rpc_framework_monitor_context_switch req = {}; 128 struct spdk_json_write_ctx *w; 129 130 if (params != NULL) { 131 if (spdk_json_decode_object(params, rpc_framework_monitor_context_switch_decoders, 132 SPDK_COUNTOF(rpc_framework_monitor_context_switch_decoders), 133 &req)) { 134 SPDK_DEBUGLOG(app_rpc, "spdk_json_decode_object failed\n"); 135 spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, "Invalid parameters"); 136 return; 137 } 138 139 spdk_framework_enable_context_switch_monitor(req.enabled); 140 } 141 142 w = spdk_jsonrpc_begin_result(request); 143 spdk_json_write_object_begin(w); 144 145 spdk_json_write_named_bool(w, "enabled", spdk_framework_context_switch_monitor_enabled()); 146 147 spdk_json_write_object_end(w); 148 spdk_jsonrpc_end_result(request, w); 149 } 150 151 SPDK_RPC_REGISTER("framework_monitor_context_switch", rpc_framework_monitor_context_switch, 152 SPDK_RPC_RUNTIME) 153 SPDK_RPC_REGISTER_ALIAS_DEPRECATED(framework_monitor_context_switch, context_switch_monitor) 154 155 struct rpc_get_stats_ctx { 156 struct spdk_jsonrpc_request *request; 157 struct spdk_json_write_ctx *w; 158 uint64_t now; 159 }; 160 161 static void 162 rpc_thread_get_stats_done(void *arg) 163 { 164 struct rpc_get_stats_ctx *ctx = arg; 165 166 spdk_json_write_array_end(ctx->w); 167 spdk_json_write_object_end(ctx->w); 168 spdk_jsonrpc_end_result(ctx->request, ctx->w); 169 170 free(ctx); 171 } 172 173 static void 174 rpc_thread_get_stats_for_each(struct spdk_jsonrpc_request *request, spdk_msg_fn fn) 175 { 176 struct rpc_get_stats_ctx *ctx; 177 178 ctx = calloc(1, sizeof(*ctx)); 179 if (!ctx) { 180 spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, 181 "Memory allocation error"); 182 return; 183 } 184 ctx->request = request; 185 186 ctx->w = spdk_jsonrpc_begin_result(ctx->request); 187 spdk_json_write_object_begin(ctx->w); 188 spdk_json_write_named_uint64(ctx->w, "tick_rate", spdk_get_ticks_hz()); 189 spdk_json_write_named_array_begin(ctx->w, "threads"); 190 191 spdk_for_each_thread(fn, ctx, rpc_thread_get_stats_done); 192 } 193 194 static void 195 _rpc_thread_get_stats(void *arg) 196 { 197 struct rpc_get_stats_ctx *ctx = arg; 198 struct spdk_thread *thread = spdk_get_thread(); 199 struct spdk_poller *poller; 200 struct spdk_thread_stats stats; 201 uint64_t active_pollers_count = 0; 202 uint64_t timed_pollers_count = 0; 203 uint64_t paused_pollers_count = 0; 204 205 TAILQ_FOREACH(poller, &thread->active_pollers, tailq) { 206 active_pollers_count++; 207 } 208 TAILQ_FOREACH(poller, &thread->timed_pollers, tailq) { 209 timed_pollers_count++; 210 } 211 TAILQ_FOREACH(poller, &thread->paused_pollers, tailq) { 212 paused_pollers_count++; 213 } 214 215 if (0 == spdk_thread_get_stats(&stats)) { 216 spdk_json_write_object_begin(ctx->w); 217 spdk_json_write_named_string(ctx->w, "name", spdk_thread_get_name(thread)); 218 spdk_json_write_named_uint64(ctx->w, "id", spdk_thread_get_id(thread)); 219 spdk_json_write_named_string(ctx->w, "cpumask", 220 spdk_cpuset_fmt(spdk_thread_get_cpumask(thread))); 221 spdk_json_write_named_uint64(ctx->w, "busy", stats.busy_tsc); 222 spdk_json_write_named_uint64(ctx->w, "idle", stats.idle_tsc); 223 spdk_json_write_named_uint64(ctx->w, "active_pollers_count", active_pollers_count); 224 spdk_json_write_named_uint64(ctx->w, "timed_pollers_count", timed_pollers_count); 225 spdk_json_write_named_uint64(ctx->w, "paused_pollers_count", paused_pollers_count); 226 spdk_json_write_object_end(ctx->w); 227 } 228 } 229 230 static void 231 rpc_thread_get_stats(struct spdk_jsonrpc_request *request, 232 const struct spdk_json_val *params) 233 { 234 if (params) { 235 spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, 236 "'thread_get_stats' requires no arguments"); 237 return; 238 } 239 240 rpc_thread_get_stats_for_each(request, _rpc_thread_get_stats); 241 } 242 243 SPDK_RPC_REGISTER("thread_get_stats", rpc_thread_get_stats, SPDK_RPC_RUNTIME) 244 245 static void 246 rpc_get_poller(struct spdk_poller *poller, struct spdk_json_write_ctx *w) 247 { 248 spdk_json_write_object_begin(w); 249 spdk_json_write_named_string(w, "name", poller->name); 250 spdk_json_write_named_string(w, "state", spdk_poller_state_str(poller->state)); 251 spdk_json_write_named_uint64(w, "run_count", poller->run_count); 252 spdk_json_write_named_uint64(w, "busy_count", poller->busy_count); 253 if (poller->period_ticks) { 254 spdk_json_write_named_uint64(w, "period_ticks", poller->period_ticks); 255 } 256 spdk_json_write_object_end(w); 257 } 258 259 static void 260 _rpc_thread_get_pollers(void *arg) 261 { 262 struct rpc_get_stats_ctx *ctx = arg; 263 struct spdk_thread *thread = spdk_get_thread(); 264 struct spdk_poller *poller; 265 266 spdk_json_write_object_begin(ctx->w); 267 spdk_json_write_named_string(ctx->w, "name", spdk_thread_get_name(thread)); 268 spdk_json_write_named_uint64(ctx->w, "id", spdk_thread_get_id(thread)); 269 270 spdk_json_write_named_array_begin(ctx->w, "active_pollers"); 271 TAILQ_FOREACH(poller, &thread->active_pollers, tailq) { 272 rpc_get_poller(poller, ctx->w); 273 } 274 spdk_json_write_array_end(ctx->w); 275 276 spdk_json_write_named_array_begin(ctx->w, "timed_pollers"); 277 TAILQ_FOREACH(poller, &thread->timed_pollers, tailq) { 278 rpc_get_poller(poller, ctx->w); 279 } 280 spdk_json_write_array_end(ctx->w); 281 282 spdk_json_write_named_array_begin(ctx->w, "paused_pollers"); 283 TAILQ_FOREACH(poller, &thread->paused_pollers, tailq) { 284 rpc_get_poller(poller, ctx->w); 285 } 286 spdk_json_write_array_end(ctx->w); 287 288 spdk_json_write_object_end(ctx->w); 289 } 290 291 static void 292 rpc_thread_get_pollers(struct spdk_jsonrpc_request *request, 293 const struct spdk_json_val *params) 294 { 295 if (params) { 296 spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, 297 "'thread_get_pollers' requires no arguments"); 298 return; 299 } 300 301 rpc_thread_get_stats_for_each(request, _rpc_thread_get_pollers); 302 } 303 304 SPDK_RPC_REGISTER("thread_get_pollers", rpc_thread_get_pollers, SPDK_RPC_RUNTIME) 305 306 static void 307 rpc_get_io_channel(struct spdk_io_channel *ch, struct spdk_json_write_ctx *w) 308 { 309 spdk_json_write_object_begin(w); 310 spdk_json_write_named_string(w, "name", spdk_io_device_get_name(ch->dev)); 311 spdk_json_write_named_uint32(w, "ref", ch->ref); 312 spdk_json_write_object_end(w); 313 } 314 315 static void 316 _rpc_thread_get_io_channels(void *arg) 317 { 318 struct rpc_get_stats_ctx *ctx = arg; 319 struct spdk_thread *thread = spdk_get_thread(); 320 struct spdk_io_channel *ch; 321 322 spdk_json_write_object_begin(ctx->w); 323 spdk_json_write_named_string(ctx->w, "name", spdk_thread_get_name(thread)); 324 325 spdk_json_write_named_array_begin(ctx->w, "io_channels"); 326 TAILQ_FOREACH(ch, &thread->io_channels, tailq) { 327 rpc_get_io_channel(ch, ctx->w); 328 } 329 spdk_json_write_array_end(ctx->w); 330 331 spdk_json_write_object_end(ctx->w); 332 } 333 334 static void 335 rpc_thread_get_io_channels(struct spdk_jsonrpc_request *request, 336 const struct spdk_json_val *params) 337 { 338 if (params) { 339 spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, 340 "'thread_get_io_channels' requires no arguments"); 341 return; 342 } 343 344 rpc_thread_get_stats_for_each(request, _rpc_thread_get_io_channels); 345 } 346 347 SPDK_RPC_REGISTER("thread_get_io_channels", rpc_thread_get_io_channels, SPDK_RPC_RUNTIME); 348 349 static void 350 rpc_framework_get_reactors_done(void *arg1, void *arg2) 351 { 352 struct rpc_get_stats_ctx *ctx = arg1; 353 354 spdk_json_write_array_end(ctx->w); 355 spdk_json_write_object_end(ctx->w); 356 spdk_jsonrpc_end_result(ctx->request, ctx->w); 357 358 free(ctx); 359 } 360 361 #define GET_DELTA(end, start) (end >= start ? end - start : 0) 362 363 static void 364 _rpc_framework_get_reactors(void *arg1, void *arg2) 365 { 366 struct rpc_get_stats_ctx *ctx = arg1; 367 uint32_t current_core; 368 struct spdk_reactor *reactor; 369 struct spdk_lw_thread *lw_thread; 370 struct spdk_thread *thread; 371 372 current_core = spdk_env_get_current_core(); 373 reactor = spdk_reactor_get(current_core); 374 375 assert(reactor != NULL); 376 377 spdk_json_write_object_begin(ctx->w); 378 spdk_json_write_named_uint32(ctx->w, "lcore", current_core); 379 spdk_json_write_named_uint64(ctx->w, "busy", reactor->busy_tsc); 380 spdk_json_write_named_uint64(ctx->w, "idle", reactor->idle_tsc); 381 382 spdk_json_write_named_array_begin(ctx->w, "lw_threads"); 383 TAILQ_FOREACH(lw_thread, &reactor->threads, link) { 384 thread = spdk_thread_get_from_ctx(lw_thread); 385 386 spdk_json_write_object_begin(ctx->w); 387 spdk_json_write_named_string(ctx->w, "name", spdk_thread_get_name(thread)); 388 spdk_json_write_named_uint64(ctx->w, "id", spdk_thread_get_id(thread)); 389 spdk_json_write_named_string(ctx->w, "cpumask", 390 spdk_cpuset_fmt(spdk_thread_get_cpumask(thread))); 391 spdk_json_write_named_uint64(ctx->w, "elapsed", 392 GET_DELTA(ctx->now, lw_thread->tsc_start)); 393 spdk_json_write_object_end(ctx->w); 394 } 395 spdk_json_write_array_end(ctx->w); 396 397 spdk_json_write_object_end(ctx->w); 398 } 399 400 static void 401 rpc_framework_get_reactors(struct spdk_jsonrpc_request *request, 402 const struct spdk_json_val *params) 403 { 404 struct rpc_get_stats_ctx *ctx; 405 406 if (params) { 407 spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, 408 "`framework_get_reactors` requires no arguments"); 409 return; 410 } 411 412 ctx = calloc(1, sizeof(*ctx)); 413 if (!ctx) { 414 spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, 415 "Memory allocation error"); 416 return; 417 } 418 419 ctx->now = spdk_get_ticks(); 420 ctx->request = request; 421 ctx->w = spdk_jsonrpc_begin_result(ctx->request); 422 423 spdk_json_write_object_begin(ctx->w); 424 spdk_json_write_named_uint64(ctx->w, "tick_rate", spdk_get_ticks_hz()); 425 spdk_json_write_named_array_begin(ctx->w, "reactors"); 426 427 spdk_for_each_reactor(_rpc_framework_get_reactors, ctx, NULL, 428 rpc_framework_get_reactors_done); 429 } 430 431 SPDK_RPC_REGISTER("framework_get_reactors", rpc_framework_get_reactors, SPDK_RPC_RUNTIME) 432 433 struct rpc_set_scheduler_ctx { 434 char *name; 435 uint64_t period; 436 }; 437 438 static void 439 free_rpc_framework_set_scheduler(struct rpc_set_scheduler_ctx *r) 440 { 441 free(r->name); 442 } 443 444 static const struct spdk_json_object_decoder rpc_set_scheduler_decoders[] = { 445 {"name", offsetof(struct rpc_set_scheduler_ctx, name), spdk_json_decode_string}, 446 {"period", offsetof(struct rpc_set_scheduler_ctx, period), spdk_json_decode_uint64, true} 447 }; 448 449 static void 450 rpc_framework_set_scheduler(struct spdk_jsonrpc_request *request, 451 const struct spdk_json_val *params) 452 { 453 struct rpc_set_scheduler_ctx req = {NULL}; 454 int ret; 455 456 ret = spdk_json_decode_object(params, rpc_set_scheduler_decoders, 457 SPDK_COUNTOF(rpc_set_scheduler_decoders), 458 &req); 459 if (ret) { 460 spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, 461 "Invalid parameters"); 462 goto end; 463 } 464 465 if (req.period != 0) { 466 _spdk_scheduler_period_set(req.period); 467 } 468 469 ret = _spdk_scheduler_set(req.name); 470 if (ret) { 471 spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, 472 spdk_strerror(ret)); 473 goto end; 474 } 475 476 spdk_jsonrpc_send_bool_response(request, true); 477 478 end: 479 free_rpc_framework_set_scheduler(&req); 480 } 481 SPDK_RPC_REGISTER("framework_set_scheduler", rpc_framework_set_scheduler, SPDK_RPC_STARTUP) 482 483 struct rpc_thread_set_cpumask_ctx { 484 struct spdk_jsonrpc_request *request; 485 struct spdk_cpuset cpumask; 486 int status; 487 struct spdk_thread *orig_thread; 488 }; 489 490 static void 491 rpc_thread_set_cpumask_done(void *_ctx) 492 { 493 struct rpc_thread_set_cpumask_ctx *ctx = _ctx; 494 495 if (ctx->status == 0) { 496 spdk_jsonrpc_send_bool_response(ctx->request, true); 497 } else { 498 spdk_jsonrpc_send_error_response(ctx->request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, 499 spdk_strerror(-ctx->status)); 500 } 501 502 free(ctx); 503 } 504 505 static void 506 _rpc_thread_set_cpumask(void *_ctx) 507 { 508 struct rpc_thread_set_cpumask_ctx *ctx = _ctx; 509 510 ctx->status = spdk_thread_set_cpumask(&ctx->cpumask); 511 512 spdk_thread_send_msg(ctx->orig_thread, rpc_thread_set_cpumask_done, ctx); 513 } 514 515 struct rpc_thread_set_cpumask { 516 uint64_t id; 517 char *cpumask; 518 }; 519 520 static const struct spdk_json_object_decoder rpc_thread_set_cpumask_decoders[] = { 521 {"id", offsetof(struct rpc_thread_set_cpumask, id), spdk_json_decode_uint64}, 522 {"cpumask", offsetof(struct rpc_thread_set_cpumask, cpumask), spdk_json_decode_string}, 523 }; 524 525 static void 526 rpc_thread_set_cpumask(struct spdk_jsonrpc_request *request, 527 const struct spdk_json_val *params) 528 { 529 struct rpc_thread_set_cpumask req = {}; 530 struct rpc_thread_set_cpumask_ctx *ctx; 531 const struct spdk_cpuset *coremask; 532 struct spdk_cpuset tmp_mask; 533 struct spdk_thread *thread; 534 int rc; 535 536 ctx = calloc(1, sizeof(*ctx)); 537 if (ctx == NULL) { 538 SPDK_ERRLOG("Memory allocation failed\n"); 539 spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, 540 "Memory allocation failed"); 541 return; 542 } 543 544 if (spdk_json_decode_object(params, rpc_thread_set_cpumask_decoders, 545 SPDK_COUNTOF(rpc_thread_set_cpumask_decoders), 546 &req)) { 547 SPDK_ERRLOG("spdk_json_decode_object failed\n"); 548 spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, 549 "spdk_json_decode_object failed"); 550 goto err; 551 } 552 553 thread = spdk_thread_get_by_id(req.id); 554 if (thread == NULL) { 555 SPDK_ERRLOG("Thread %" PRIu64 " does not exist\n", req.id); 556 spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, 557 "Thread %" PRIu64 " does not exist", req.id); 558 goto err; 559 } 560 561 rc = spdk_app_parse_core_mask(req.cpumask, &ctx->cpumask); 562 if (rc != 0) { 563 SPDK_ERRLOG("Invalid cpumask %s\n", req.cpumask); 564 spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, 565 "Invalid cpumask %s", req.cpumask); 566 goto err; 567 } 568 569 if (spdk_cpuset_count(&ctx->cpumask) == 0) { 570 coremask = spdk_app_get_core_mask(); 571 spdk_cpuset_copy(&tmp_mask, coremask); 572 spdk_jsonrpc_send_error_response_fmt(request, SPDK_JSONRPC_ERROR_INTERNAL_ERROR, 573 "No CPU is selected from reactor mask %s\n", 574 spdk_cpuset_fmt(&tmp_mask)); 575 goto err; 576 } 577 578 ctx->request = request; 579 ctx->orig_thread = spdk_get_thread(); 580 581 spdk_thread_send_msg(thread, _rpc_thread_set_cpumask, ctx); 582 583 free(req.cpumask); 584 return; 585 586 err: 587 free(req.cpumask); 588 free(ctx); 589 } 590 SPDK_RPC_REGISTER("thread_set_cpumask", rpc_thread_set_cpumask, SPDK_RPC_RUNTIME) 591 SPDK_LOG_REGISTER_COMPONENT(app_rpc) 592