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 3913CA05D3 for ; Tue, 21 May 2019 04:35:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2CBE54CA7; Tue, 21 May 2019 04:35:12 +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 2AF7DA3 for ; Tue, 21 May 2019 04:35:08 +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 x4L2Z7wD003228; Tue, 21 May 2019 11:35:07 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 58B0DEA79C3; Tue, 21 May 2019 11:35:07 +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 4B412EA78C6; Tue, 21 May 2019 11:35:07 +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:32:41 +0900 Message-Id: <1558405962-8406-3-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558405962-8406-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> References: <1558405962-8406-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 2/3] shared/sec: rename func to get type idx for cls 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 function for parsing getting index of type of classifier `decode_classifier_type_value()` to `parse_cls_type()`, and refactoring. Signed-off-by: Yasufumi Ogawa --- .../secondary/spp_worker_th/cmd_parser.c | 18 +++++++++--------- 1 file changed, 9 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 70cf254..4cd36ca 100644 --- a/src/shared/secondary/spp_worker_th/cmd_parser.c +++ b/src/shared/secondary/spp_worker_th/cmd_parser.c @@ -650,21 +650,21 @@ parse_cls_action(void *output, const char *arg_val, return SPP_RET_OK; } -/* decoding procedure of type for classifier_table command */ +/* Parse cls type and get index for classifier_table command. */ static int -decode_classifier_type_value(void *output, const char *arg_val, - int allow_override __attribute__ ((unused))) +parse_cls_type(void *output, const char *arg_val, + int allow_override __attribute__ ((unused))) { - int ret = SPP_RET_OK; - ret = get_list_idx(arg_val, CLS_TYPE_LIST); - if (unlikely(ret <= 0)) { + int idx; + idx = get_list_idx(arg_val, CLS_TYPE_LIST); + if (unlikely(idx <= 0)) { RTE_LOG(ERR, SPP_COMMAND_PROC, "Unknown classifier type. val=%s\n", arg_val); return SPP_RET_NG; } - *(int *)output = ret; + *(int *)output = idx; return SPP_RET_OK; } @@ -759,7 +759,7 @@ cmd_ops_list[][SPPWK_MAX_PARAMS] = { .name = "type", .offset = offsetof(struct spp_command, spec.cls_table.type), - .func = decode_classifier_type_value + .func = parse_cls_type }, { .name = "mac address", @@ -786,7 +786,7 @@ cmd_ops_list[][SPPWK_MAX_PARAMS] = { .name = "type", .offset = offsetof(struct spp_command, spec.cls_table.type), - .func = decode_classifier_type_value + .func = parse_cls_type }, { .name = "vlan id", -- 2.17.1