From: ogawa.yasufumi@lab.ntt.co.jp
To: ferruh.yigit@intel.com, spp@dpdk.org, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 1/8] shared: add func for getting dirname of secondary
Date: Tue, 29 Jan 2019 21:21:54 +0900 [thread overview]
Message-ID: <1548764521-2827-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1548764521-2827-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
To inspect the name of directory of secondary from process name, add
function `get_sec_dir()`. It is used to find the path of exec file of
secondary process.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
src/shared/common.c | 26 ++++++++++++++++++++++++++
src/shared/common.h | 3 +++
2 files changed, 29 insertions(+)
diff --git a/src/shared/common.c b/src/shared/common.c
index 0943dd3..9c244e5 100644
--- a/src/shared/common.c
+++ b/src/shared/common.c
@@ -89,3 +89,29 @@ parse_server(char **server_ip, int *server_port, char *server_addr)
*server_port = atoi(token);
return 0;
}
+
+/* Get directory name of given proc_name */
+int get_sec_dir(char *proc_name, char *dir_name)
+{
+ if (!strcmp(proc_name, "spp_nfv")) {
+ sprintf(dir_name, "%s", "nfv");
+ RTE_LOG(DEBUG, SHARED, "Found dir 'nfv' for '%s'.\n",
+ proc_name);
+ } else if (!strcmp(proc_name, "spp_vf")) {
+ sprintf(dir_name, "%s", "vf");
+ RTE_LOG(DEBUG, SHARED, "Found dir 'vf' for '%s'.\n",
+ proc_name);
+ } else if (!strcmp(proc_name, "spp_mirror")) {
+ sprintf(dir_name, "%s", "mirror");
+ RTE_LOG(DEBUG, SHARED, "Found dir 'mirror' for '%s'.\n",
+ proc_name);
+ } else if (!strcmp(proc_name, "spp_pcap")) {
+ sprintf(dir_name, "%s", "pcap");
+ RTE_LOG(DEBUG, SHARED, "Found dir 'pcap' for '%s'.\n",
+ proc_name);
+ } else {
+ RTE_LOG(DEBUG, SHARED, "No dir found for '%s'.\n",
+ proc_name);
+ }
+ return 0;
+}
diff --git a/src/shared/common.h b/src/shared/common.h
index d5c62bd..75e9576 100644
--- a/src/shared/common.h
+++ b/src/shared/common.h
@@ -127,6 +127,9 @@ int set_user_log_debug(int num_user_log);
int parse_num_clients(uint16_t *num_clients, const char *clients);
int parse_server(char **server_ip, int *server_port, char *server_addr);
+/* Get directory name of given proc_name */
+int get_sec_dir(char *proc_name, char *dir_name);
+
extern uint8_t lcore_id_used[RTE_MAX_LCORE];
#endif
--
2.7.4
next prev parent reply other threads:[~2019-01-29 12:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-29 12:21 [spp] [PATCH 0/8] Add launch command to spp_primary ogawa.yasufumi
2019-01-29 12:21 ` ogawa.yasufumi [this message]
2019-01-29 12:21 ` [spp] [PATCH 2/8] spp_priamry: add launch command ogawa.yasufumi
2019-01-29 12:21 ` [spp] [PATCH 3/8] spp-ctl: add launch command support for REST API ogawa.yasufumi
2019-01-29 12:21 ` [spp] [PATCH 4/8] controller: add launch sub command in pri ogawa.yasufumi
2019-01-29 12:21 ` [spp] [PATCH 5/8] spp_primary: change launching sec to use python ogawa.yasufumi
2019-01-29 12:21 ` [spp] [PATCH 6/8] tools/helpers: add sec launcher script ogawa.yasufumi
2019-01-29 12:22 ` [spp] [PATCH 7/8] controller: revise completion of launch command ogawa.yasufumi
2019-01-29 12:22 ` [spp] [PATCH 8/8] tools/helpers: move cpu_layout script to helpers 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=1548764521-2827-2-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).