From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 4787AA05D3 for ; Tue, 21 May 2019 04:33:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC3E914EC; Tue, 21 May 2019 04:33:49 +0200 (CEST) Received: from tama50.ecl.ntt.co.jp (tama50.ecl.ntt.co.jp [129.60.39.147]) by dpdk.org (Postfix) with ESMTP id 1BC5010BD for ; Tue, 21 May 2019 04:33:47 +0200 (CEST) Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x4L2Xl3B003171; Tue, 21 May 2019 11:33:47 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id EB3F4EA783F; Tue, 21 May 2019 11:33:46 +0900 (JST) Received: from localhost.localdomain (lobster.nslab.ecl.ntt.co.jp [129.60.13.95]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id DDFA8EA79C3; Tue, 21 May 2019 11:33:46 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Date: Tue, 21 May 2019 11:31:20 +0900 Message-Id: <1558405882-8201-5-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558405882-8201-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> References: <1558405882-8201-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 4/6] shared/sec: rename func for parsing port UID X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Yasufumi Ogawa This update is to rename `decode_port_value()` to `parse_port_uid()` because it is not for decoding but parsing resource UID of port such as `phy:0`, and the term `port value` is ambiguous. Signed-off-by: Yasufumi Ogawa --- .../secondary/spp_worker_th/cmd_parser.c | 19 ++++++++++++------- src/shared/secondary/spp_worker_th/spp_proc.h | 4 ++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/shared/secondary/spp_worker_th/cmd_parser.c b/src/shared/secondary/spp_worker_th/cmd_parser.c index 02528d6..5658893 100644 --- a/src/shared/secondary/spp_worker_th/cmd_parser.c +++ b/src/shared/secondary/spp_worker_th/cmd_parser.c @@ -258,18 +258,23 @@ get_vlan_uint_val(unsigned int *output, const char *arg_val, unsigned int min, return SPP_RET_OK; } -/* decoding procedure of port */ +/* Parse given res UID of port and init object of struct sppwk_port_idx. */ +/* TODO(yasufum) Confirm why 1st arg is not sppwk_port_idx, but void. */ +/** + * TODO(yasufum) Confirm why this func is required. Is it not enough to use + * parse_resource_uid() ? + */ static int -decode_port_value(void *output, const char *arg_val) +parse_port_uid(void *output, const char *arg_val) { - int ret = SPP_RET_OK; + int ret; struct sppwk_port_idx *port = output; ret = parse_resource_uid(arg_val, &port->iface_type, &port->iface_no); if (unlikely(ret != 0)) { - RTE_LOG(ERR, SPP_COMMAND_PROC, "Bad port. val=%s\n", arg_val); + RTE_LOG(ERR, SPP_COMMAND_PROC, + "Invalid resource UID '%s'.\n", arg_val); return SPP_RET_NG; } - return SPP_RET_OK; } @@ -412,7 +417,7 @@ decode_port_port_value(void *output, const char *arg_val, int allow_override) struct sppwk_port_idx tmp_port; struct sppwk_cmd_port *port = output; - ret = decode_port_value(&tmp_port, arg_val); + ret = parse_port_uid(&tmp_port, arg_val); if (ret < SPP_RET_OK) return SPP_RET_NG; @@ -665,7 +670,7 @@ parse_cls_port(void *cls_cmd_attr, const char *arg_val, struct sppwk_port_idx tmp_port; int64_t mac_addr = 0; - ret = decode_port_value(&tmp_port, arg_val); + ret = parse_port_uid(&tmp_port, arg_val); if (ret < SPP_RET_OK) return SPP_RET_NG; diff --git a/src/shared/secondary/spp_worker_th/spp_proc.h b/src/shared/secondary/spp_worker_th/spp_proc.h index aeb8e92..8f9f11d 100644 --- a/src/shared/secondary/spp_worker_th/spp_proc.h +++ b/src/shared/secondary/spp_worker_th/spp_proc.h @@ -191,8 +191,8 @@ struct sppwk_cls_attrs { * attributions, use `sppwk_port_info` which has additional port params. */ struct sppwk_port_idx { - enum port_type iface_type; /**< phy, vhost or ring */ - int iface_no; + enum port_type iface_type; /**< phy, vhost or ring. */ + int iface_no; }; /* Define detailed port params in addition to `sppwk_port_idx`. */ -- 2.17.1