From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 4/6] shared/sec: rename file spp_proc to cmd_utils
Date: Fri, 31 May 2019 12:36:57 +0900 [thread overview]
Message-ID: <1559273819-26243-5-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1559273819-26243-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
spp_proc.c and its header file define a set of utility functions for
parsing or running commands of SPP worker threads. The term `spp proc`
is not appropriate for the meaning, rename to simply `cmd_utils`.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
src/mirror/Makefile | 2 +-
src/mirror/spp_mirror.c | 2 +-
src/pcap/Makefile | 2 +-
src/pcap/{spp_proc.c => cmd_utils.c} | 2 +-
src/pcap/{spp_proc.h => cmd_utils.h} | 6 +++---
src/pcap/command_dec.h | 2 +-
src/pcap/command_proc.h | 2 +-
src/pcap/spp_pcap.c | 2 +-
src/pcap/spp_pcap.h | 2 +-
src/shared/secondary/spp_worker_th/cmd_parser.h | 2 +-
src/shared/secondary/spp_worker_th/cmd_runner.h | 6 +++---
.../spp_worker_th/{spp_proc.c => cmd_utils.c} | 2 +-
.../spp_worker_th/{spp_proc.h => cmd_utils.h} | 11 +++++------
src/shared/secondary/spp_worker_th/command_conn.h | 2 +-
src/shared/secondary/spp_worker_th/mirror_deps.h | 2 +-
src/shared/secondary/spp_worker_th/ringlatencystats.c | 2 +-
src/shared/secondary/spp_worker_th/spp_port.h | 8 ++++----
src/shared/secondary/spp_worker_th/vf_deps.h | 8 ++++----
src/vf/Makefile | 2 +-
src/vf/spp_vf.c | 2 +-
20 files changed, 34 insertions(+), 35 deletions(-)
rename src/pcap/{spp_proc.c => cmd_utils.c} (99%)
rename src/pcap/{spp_proc.h => cmd_utils.h} (99%)
rename src/shared/secondary/spp_worker_th/{spp_proc.c => cmd_utils.c} (99%)
rename src/shared/secondary/spp_worker_th/{spp_proc.h => cmd_utils.h} (99%)
diff --git a/src/mirror/Makefile b/src/mirror/Makefile
index 07bf7ca..d1ae9ce 100644
--- a/src/mirror/Makefile
+++ b/src/mirror/Makefile
@@ -17,7 +17,7 @@ SPP_WKT_DIR = ../shared/secondary/spp_worker_th
SRCS-y := spp_mirror.c
SRCS-y += ../shared/common.c
SRCS-y += ../shared/secondary/utils.c ../shared/secondary/add_port.c
-SRCS-y += $(SPP_WKT_DIR)/spp_proc.c
+SRCS-y += $(SPP_WKT_DIR)/cmd_utils.c
SRCS-y += $(SPP_WKT_DIR)/spp_port.c
SRCS-y += $(SPP_WKT_DIR)/command_conn.c
SRCS-y += $(SPP_WKT_DIR)/cmd_parser.c
diff --git a/src/mirror/spp_mirror.c b/src/mirror/spp_mirror.c
index 26c250b..574e31f 100644
--- a/src/mirror/spp_mirror.c
+++ b/src/mirror/spp_mirror.c
@@ -14,7 +14,7 @@
#include "shared/secondary/utils.h"
#include "shared/secondary/spp_worker_th/cmd_runner.h"
#include "shared/secondary/spp_worker_th/cmd_parser.h"
-#include "shared/secondary/spp_worker_th/spp_proc.h"
+#include "shared/secondary/spp_worker_th/cmd_utils.h"
#include "shared/secondary/spp_worker_th/spp_port.h"
/* Declare global variables */
diff --git a/src/pcap/Makefile b/src/pcap/Makefile
index a58b79a..e5e0b00 100644
--- a/src/pcap/Makefile
+++ b/src/pcap/Makefile
@@ -15,7 +15,7 @@ SPP_WKT_DIR = ../shared/secondary/spp_worker_th
# all source are stored in SRCS-y
SRCS-y := spp_pcap.c
-SRCS-y += spp_proc.c
+SRCS-y += cmd_utils.c
SRCS-y += command_proc.c command_dec.c
SRCS-y += ../shared/common.c
SRCS-y += $(SPP_WKT_DIR)/command_conn.c
diff --git a/src/pcap/spp_proc.c b/src/pcap/cmd_utils.c
similarity index 99%
rename from src/pcap/spp_proc.c
rename to src/pcap/cmd_utils.c
index 4e3b2c9..be12058 100644
--- a/src/pcap/spp_proc.c
+++ b/src/pcap/cmd_utils.c
@@ -8,7 +8,7 @@
#include <rte_eth_ring.h>
#include <rte_log.h>
-#include "spp_proc.h"
+#include "cmd_utils.h"
#define RTE_LOGTYPE_SPP_PROC RTE_LOGTYPE_USER2
diff --git a/src/pcap/spp_proc.h b/src/pcap/cmd_utils.h
similarity index 99%
rename from src/pcap/spp_proc.h
rename to src/pcap/cmd_utils.h
index 2265b21..61b6da5 100644
--- a/src/pcap/spp_proc.h
+++ b/src/pcap/cmd_utils.h
@@ -2,8 +2,8 @@
* Copyright(c) 2018 Nippon Telegraph and Telephone Corporation
*/
-#ifndef _SPP_PROC_H_
-#define _SPP_PROC_H_
+#ifndef _SPPWK_CMD_UTILS_H_
+#define _SPPWK_CMD_UTILS_H_
/**
* @file
@@ -386,4 +386,4 @@ void spp_get_mng_data_addr(struct startup_param **startup_param_addr,
int **capture_request_addr,
int **capture_status_addr);
-#endif /* _SPP_PROC_H_ */
+#endif /* _SPPWK_CMD_UTILS_H_ */
diff --git a/src/pcap/command_dec.h b/src/pcap/command_dec.h
index 0835382..84f7ae6 100644
--- a/src/pcap/command_dec.h
+++ b/src/pcap/command_dec.h
@@ -12,7 +12,7 @@
* Decode and validate the command message string.
*/
-#include "spp_proc.h"
+#include "cmd_utils.h"
/** max number of command per request */
#define SPP_CMD_MAX_COMMANDS 32
diff --git a/src/pcap/command_proc.h b/src/pcap/command_proc.h
index 8094649..cbaf6a2 100644
--- a/src/pcap/command_proc.h
+++ b/src/pcap/command_proc.h
@@ -13,7 +13,7 @@
* result JSON formatted data.
*/
-#include "spp_proc.h"
+#include "cmd_utils.h"
/**
* initialize command processor.
diff --git a/src/pcap/spp_pcap.c b/src/pcap/spp_pcap.c
index f8f3f79..b048237 100644
--- a/src/pcap/spp_pcap.c
+++ b/src/pcap/spp_pcap.c
@@ -13,7 +13,7 @@
#include <lz4frame.h>
#include "shared/common.h"
-#include "spp_proc.h"
+#include "cmd_utils.h"
#include "spp_pcap.h"
#include "command_proc.h"
#include "command_dec.h"
diff --git a/src/pcap/spp_pcap.h b/src/pcap/spp_pcap.h
index d282226..6a4ded7 100644
--- a/src/pcap/spp_pcap.h
+++ b/src/pcap/spp_pcap.h
@@ -5,7 +5,7 @@
#ifndef __SPP_PCAP_H__
#define __SPP_PCAP_H__
-#include "spp_proc.h"
+#include "cmd_utils.h"
/**
* @file
diff --git a/src/shared/secondary/spp_worker_th/cmd_parser.h b/src/shared/secondary/spp_worker_th/cmd_parser.h
index c8839f1..de4dcba 100644
--- a/src/shared/secondary/spp_worker_th/cmd_parser.h
+++ b/src/shared/secondary/spp_worker_th/cmd_parser.h
@@ -10,7 +10,7 @@
* @brief Define a set of vars and functions for parsing SPP worker commands.
*/
-#include "spp_proc.h"
+#include "cmd_utils.h"
/* Maximum number of commands per request. */
#define SPPWK_MAX_CMDS 32
diff --git a/src/shared/secondary/spp_worker_th/cmd_runner.h b/src/shared/secondary/spp_worker_th/cmd_runner.h
index 4b768b7..5c79247 100644
--- a/src/shared/secondary/spp_worker_th/cmd_runner.h
+++ b/src/shared/secondary/spp_worker_th/cmd_runner.h
@@ -6,14 +6,14 @@
#define _SPPWK_CMD_RUNNER_H_
/**
- * @file
- * Run command for SPP worker thread.
+ * @file cmd_runner.h
*
+ * Run command for SPP worker thread.
* Receive command message from SPP controller and run. The result is returned
* to SPP controller as a JSON formatted message.
*/
-#include "spp_proc.h"
+#include "cmd_utils.h"
/**
* Setup connection for accepting commands from spp-ctl.
diff --git a/src/shared/secondary/spp_worker_th/spp_proc.c b/src/shared/secondary/spp_worker_th/cmd_utils.c
similarity index 99%
rename from src/shared/secondary/spp_worker_th/spp_proc.c
rename to src/shared/secondary/spp_worker_th/cmd_utils.c
index 3cdc108..46aa118 100644
--- a/src/shared/secondary/spp_worker_th/spp_proc.c
+++ b/src/shared/secondary/spp_worker_th/cmd_utils.c
@@ -13,7 +13,7 @@
#include "vf_deps.h"
#include "mirror_deps.h"
-#include "spp_proc.h"
+#include "cmd_utils.h"
#include "spp_port.h"
#include "shared/secondary/add_port.h"
diff --git a/src/shared/secondary/spp_worker_th/spp_proc.h b/src/shared/secondary/spp_worker_th/cmd_utils.h
similarity index 99%
rename from src/shared/secondary/spp_worker_th/spp_proc.h
rename to src/shared/secondary/spp_worker_th/cmd_utils.h
index c066f0c..7f15ea6 100644
--- a/src/shared/secondary/spp_worker_th/spp_proc.h
+++ b/src/shared/secondary/spp_worker_th/cmd_utils.h
@@ -2,14 +2,13 @@
* Copyright(c) 2018-2019 Nippon Telegraph and Telephone Corporation
*/
-#ifndef _SPP_PROC_H_
-#define _SPP_PROC_H_
+#ifndef _SPPWK_CMD_UTILS_H_
+#define _SPPWK_CMD_UTILS_H_
/**
- * @file
- * SPP process
+ * @file cmd_utils.h
*
- * SPP component common function.
+ * Command utility functions for SPP worker thread.
*/
#include <netinet/in.h>
@@ -698,4 +697,4 @@ void sppwk_get_mng_data(struct startup_param **startup_param_p,
int **change_component_p,
struct cancel_backup_info **backup_info_p);
-#endif /* _SPP_PROC_H_ */
+#endif /* _SPPWK_CMD_UTILS_H_ */
diff --git a/src/shared/secondary/spp_worker_th/command_conn.h b/src/shared/secondary/spp_worker_th/command_conn.h
index 517c0e9..9112847 100644
--- a/src/shared/secondary/spp_worker_th/command_conn.h
+++ b/src/shared/secondary/spp_worker_th/command_conn.h
@@ -12,7 +12,7 @@
* Command connection management.
*/
-#include "spp_proc.h"
+#include "cmd_utils.h"
/** result code - temporary error. please retry */
#define SPP_CONNERR_TEMPORARY -1
diff --git a/src/shared/secondary/spp_worker_th/mirror_deps.h b/src/shared/secondary/spp_worker_th/mirror_deps.h
index 31d64b7..02e64d9 100644
--- a/src/shared/secondary/spp_worker_th/mirror_deps.h
+++ b/src/shared/secondary/spp_worker_th/mirror_deps.h
@@ -5,7 +5,7 @@
#ifndef __SPP_WORKER_TH_MIRROR_DEPS_H__
#define __SPP_WORKER_TH_MIRROR_DEPS_H__
-#include "spp_proc.h"
+#include "cmd_utils.h"
/**
* Update Mirror info
diff --git a/src/shared/secondary/spp_worker_th/ringlatencystats.c b/src/shared/secondary/spp_worker_th/ringlatencystats.c
index 6ea5a7e..e0cc1aa 100644
--- a/src/shared/secondary/spp_worker_th/ringlatencystats.c
+++ b/src/shared/secondary/spp_worker_th/ringlatencystats.c
@@ -15,7 +15,7 @@
#include <rte_memcpy.h>
#include "ringlatencystats.h"
-#include "spp_proc.h"
+#include "cmd_utils.h"
#define NS_PER_SEC 1E9
diff --git a/src/shared/secondary/spp_worker_th/spp_port.h b/src/shared/secondary/spp_worker_th/spp_port.h
index 10409ab..1f8161a 100644
--- a/src/shared/secondary/spp_worker_th/spp_port.h
+++ b/src/shared/secondary/spp_worker_th/spp_port.h
@@ -2,8 +2,8 @@
* Copyright(c) 2017-2018 Nippon Telegraph and Telephone Corporation
*/
-#ifndef __SPP_PORT_H__
-#define __SPP_PORT_H__
+#ifndef _SPP_PORT_H_
+#define _SPP_PORT_H_
/**
* @file
@@ -12,7 +12,7 @@
* Provide about the ability per port.
*/
-#include "spp_proc.h"
+#include "cmd_utils.h"
/** Calculate TCI of VLAN tag. */
#define SPP_VLANTAG_CALC_TCI(id, pcp) (((pcp & 0x07) << 13) | (id & 0x0fff))
@@ -110,4 +110,4 @@ uint16_t spp_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
uint16_t spp_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
struct rte_mbuf **tx_pkts, uint16_t nb_pkts);
-#endif /* __SPP_PORT_H__ */
+#endif /* _SPP_PORT_H_ */
diff --git a/src/shared/secondary/spp_worker_th/vf_deps.h b/src/shared/secondary/spp_worker_th/vf_deps.h
index 136c49e..4b9cecf 100644
--- a/src/shared/secondary/spp_worker_th/vf_deps.h
+++ b/src/shared/secondary/spp_worker_th/vf_deps.h
@@ -2,12 +2,12 @@
* Copyright(c) 2019 Nippon Telegraph and Telephone Corporation
*/
-#ifndef __SPP_WORKER_TH_VF_DEPS_H__
-#define __SPP_WORKER_TH_VF_DEPS_H__
+#ifndef _SPPWK_TH_VF_DEPS_H_
+#define _SPPWK_TH_VF_DEPS_H_
#include <rte_malloc.h>
#include <rte_hash.h>
-#include "spp_proc.h"
+#include "cmd_utils.h"
/* number of classifier information (reference/update) */
#define NUM_CLASSIFIER_MAC_INFO 2
@@ -149,4 +149,4 @@ int spp_forward_get_component_status(
unsigned int lcore_id, int id,
struct spp_iterate_core_params *params);
-#endif /* __SPP_WORKER_TH_VF_DEPS_H__ */
+#endif /* _SPPWK_TH_VF_DEPS_H_ */
diff --git a/src/vf/Makefile b/src/vf/Makefile
index 399871f..bdeff98 100644
--- a/src/vf/Makefile
+++ b/src/vf/Makefile
@@ -21,7 +21,7 @@ SRCS-y += $(SPP_WKT_DIR)/spp_port.c
SRCS-y += $(SPP_WKT_DIR)/command_conn.c
SRCS-y += $(SPP_WKT_DIR)/cmd_parser.c
SRCS-y += $(SPP_WKT_DIR)/cmd_runner.c
-SRCS-y += $(SPP_WKT_DIR)/spp_proc.c
+SRCS-y += $(SPP_WKT_DIR)/cmd_utils.c
SRCS-y += ../shared/common.c
SRCS-y += ../shared/secondary/utils.c ../shared/secondary/add_port.c
diff --git a/src/vf/spp_vf.c b/src/vf/spp_vf.c
index 5075c95..fd8944f 100644
--- a/src/vf/spp_vf.c
+++ b/src/vf/spp_vf.c
@@ -6,7 +6,7 @@
#include <arpa/inet.h>
#include <getopt.h>
-#include "shared/secondary/spp_worker_th/spp_proc.h"
+#include "shared/secondary/spp_worker_th/cmd_utils.h"
#include "spp_vf.h"
#include "classifier_mac.h"
#include "spp_forward.h"
--
2.17.1
next prev parent reply other threads:[~2019-05-31 3:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-31 3:36 [spp] [PATCH 0/6] Refactor functions for manipulating thread info ogawa.yasufumi
2019-05-31 3:36 ` [spp] [PATCH 1/6] shared/sec: refactor func for deleting comp info ogawa.yasufumi
2019-05-31 3:36 ` [spp] [PATCH 2/6] shared/sec: revise types of spp worker ogawa.yasufumi
2019-05-31 3:36 ` [spp] [PATCH 3/6] shared/sec: rename funcs of flush cmd ogawa.yasufumi
2019-05-31 3:36 ` ogawa.yasufumi [this message]
2019-05-31 3:36 ` [spp] [PATCH 5/6] shared/sec: refactor name of funcs for exec cmd ogawa.yasufumi
2019-05-31 3:36 ` [spp] [PATCH 6/6] shared/sec: rename struct spp_command ogawa.yasufumi
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=1559273819-26243-5-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).