From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 3/3] shared/sec: rename func for parsing VLAN ID
Date: Tue, 21 May 2019 11:32:42 +0900 [thread overview]
Message-ID: <1558405962-8406-4-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1558405962-8406-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
This update is to rename function for parsing and getting VLAN ID for
classifier_table command `decode_classifier_vid_value()` to
`parse_cls_vid()` and refactoring.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
src/shared/secondary/spp_worker_th/cmd_parser.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/shared/secondary/spp_worker_th/cmd_parser.c b/src/shared/secondary/spp_worker_th/cmd_parser.c
index 4cd36ca..f78664b 100644
--- a/src/shared/secondary/spp_worker_th/cmd_parser.c
+++ b/src/shared/secondary/spp_worker_th/cmd_parser.c
@@ -668,15 +668,15 @@ parse_cls_type(void *output, const char *arg_val,
return SPP_RET_OK;
}
-/* decoding procedure of vlan id for classifier_table command */
+/* Parse VLAN ID for classifier_table command. */
static int
-decode_classifier_vid_value(void *output, const char *arg_val,
- int allow_override __attribute__ ((unused)))
+parse_cls_vid(void *output, const char *arg_val,
+ int allow_override __attribute__ ((unused)))
{
- int ret = SPP_RET_NG;
- ret = get_int_in_range(output, arg_val, 0, ETH_VLAN_ID_MAX);
- if (unlikely(ret < SPP_RET_OK)) {
- RTE_LOG(ERR, SPP_COMMAND_PROC, "Bad VLAN ID. val=%s\n",
+ int idx;
+ idx = get_int_in_range(output, arg_val, 0, ETH_VLAN_ID_MAX);
+ if (unlikely(idx < SPP_RET_OK)) {
+ RTE_LOG(ERR, SPP_COMMAND_PROC, "Invalid VLAN ID `%s`.\n",
arg_val);
return SPP_RET_NG;
}
@@ -792,7 +792,7 @@ cmd_ops_list[][SPPWK_MAX_PARAMS] = {
.name = "vlan id",
.offset = offsetof(struct spp_command,
spec.cls_table.vid),
- .func = decode_classifier_vid_value
+ .func = parse_cls_vid
},
{
.name = "mac address",
--
2.17.1
prev parent reply other threads:[~2019-05-21 2:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-21 2:32 [spp] [PATCH 0/3] Refactor func for parsing cls cmd ogawa.yasufumi
2019-05-21 2:32 ` [spp] [PATCH 1/3] shared/sec: rename func for parsing cls table ogawa.yasufumi
2019-05-21 2:32 ` [spp] [PATCH 2/3] shared/sec: rename func to get type idx for cls ogawa.yasufumi
2019-05-21 2:32 ` ogawa.yasufumi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1558405962-8406-4-git-send-email-ogawa.yasufumi@lab.ntt.co.jp \
--to=ogawa.yasufumi@lab.ntt.co.jp \
--cc=ferruh.yigit@intel.com \
--cc=spp@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).