From d80267cc1782fb6e2b4f16d7210204484f5c5e1b Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Fri, 23 Apr 2021 18:52:00 +0000 Subject: [PATCH] net: deprecate library The net library isn't needed - everything these RPCs do can be done externally to the SPDK application. This library will be removed in the 21.07 release. As part of the deprecation, mark the net RPCs as private. This will prevent an upcoming patch from complaining that these RPCs are not documented. Signed-off-by: Jim Harris Change-Id: I61118820fd29e410dca763595c3d9fd01a57373d Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7592 Reviewed-by: Tomasz Zawadzki Reviewed-by: Ben Walker Reviewed-by: Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot --- CHANGELOG.md | 4 ++++ lib/net/net_rpc.c | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b7468d12c..679ff0c62f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,10 @@ Two new accelerated crc32 functions 'spdk_accel_submit_crc32cv' and 'spdk_accel_batch_prep_crc32cv' are added in order to provide the chained accelerated CRC32 computation support. +### net + +The net library is deprecated and will be removed in the 21.07 release. + ### nvme Added new functions `spdk_nvme_ctrlr_get_pmrsz`, `spdk_nvme_ctrlr_enable_pmr`, diff --git a/lib/net/net_rpc.c b/lib/net/net_rpc.c index 1af504d0e1..016d644316 100644 --- a/lib/net/net_rpc.c +++ b/lib/net/net_rpc.c @@ -64,6 +64,8 @@ rpc_net_interface_add_ip_address(struct spdk_jsonrpc_request *request, struct rpc_ip_address req = {}; int ret_val = 0; + SPDK_WARNLOG("net_interface_add_ip_address RPC is deprecated.\n"); + if (spdk_json_decode_object(params, rpc_ip_address_decoders, SPDK_COUNTOF(rpc_ip_address_decoders), &req)) { @@ -97,8 +99,8 @@ rpc_net_interface_add_ip_address(struct spdk_jsonrpc_request *request, invalid: free_rpc_ip_address(&req); } -SPDK_RPC_REGISTER("net_interface_add_ip_address", rpc_net_interface_add_ip_address, - SPDK_RPC_RUNTIME) +/* private */ SPDK_RPC_REGISTER("net_interface_add_ip_address", rpc_net_interface_add_ip_address, + SPDK_RPC_RUNTIME) SPDK_RPC_REGISTER_ALIAS_DEPRECATED(net_interface_add_ip_address, add_ip_address) static void @@ -108,6 +110,8 @@ rpc_net_interface_delete_ip_address(struct spdk_jsonrpc_request *request, struct rpc_ip_address req = {}; int ret_val = 0; + SPDK_WARNLOG("net_interface_delete_ip_address RPC is deprecated.\n"); + if (spdk_json_decode_object(params, rpc_ip_address_decoders, SPDK_COUNTOF(rpc_ip_address_decoders), &req)) { @@ -141,8 +145,9 @@ rpc_net_interface_delete_ip_address(struct spdk_jsonrpc_request *request, invalid: free_rpc_ip_address(&req); } -SPDK_RPC_REGISTER("net_interface_delete_ip_address", rpc_net_interface_delete_ip_address, - SPDK_RPC_RUNTIME) +/* private */ SPDK_RPC_REGISTER("net_interface_delete_ip_address", + rpc_net_interface_delete_ip_address, + SPDK_RPC_RUNTIME) SPDK_RPC_REGISTER_ALIAS_DEPRECATED(net_interface_delete_ip_address, delete_ip_address) static void @@ -156,6 +161,8 @@ rpc_net_get_interfaces(struct spdk_jsonrpc_request *request, struct in_addr inaddr; uint32_t i; + SPDK_WARNLOG("net_get_interfaces RPC is deprecated.\n"); + if (params != NULL) { spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS, "net_get_interfaces requires no parameters"); @@ -186,7 +193,7 @@ rpc_net_get_interfaces(struct spdk_jsonrpc_request *request, spdk_jsonrpc_end_result(request, w); } -SPDK_RPC_REGISTER("net_get_interfaces", rpc_net_get_interfaces, SPDK_RPC_RUNTIME) +/* private */ SPDK_RPC_REGISTER("net_get_interfaces", rpc_net_get_interfaces, SPDK_RPC_RUNTIME) SPDK_RPC_REGISTER_ALIAS_DEPRECATED(net_get_interfaces, get_interfaces) SPDK_LOG_REGISTER_COMPONENT(net)