From: yasufum.o@gmail.com
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH 3/3] spp_pcap: fix wrong master lcore other than 0
Date: Thu, 18 Jul 2019 14:01:19 +0900 [thread overview]
Message-ID: <20190718050119.6822-4-yasufum.o@gmail.com> (raw)
In-Reply-To: <20190718050119.6822-1-yasufum.o@gmail.com>
From: Yasufumi Ogawa <yasufum.o@gmail.com>
As previous patch, fix assigning wrong master lcore by moving
rte_eal_init() before rte_get_master_lcore().
Fixes: 310c51b918e9 ("spp_vf: initialize variable master_lcore")
Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
src/pcap/spp_pcap.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/pcap/spp_pcap.c b/src/pcap/spp_pcap.c
index e8b2724..39667d8 100644
--- a/src/pcap/spp_pcap.c
+++ b/src/pcap/spp_pcap.c
@@ -905,7 +905,7 @@ slave_main(void *arg __attribute__ ((unused)))
int
main(int argc, char *argv[])
{
- int ret = SPPWK_RET_NG;
+ int ret;
char ctl_ip[IPADDR_LEN] = { 0 };
int ctl_port;
int ret_cmd_init;
@@ -927,20 +927,24 @@ main(int argc, char *argv[])
signal(SIGTERM, stop_process);
signal(SIGINT, stop_process);
+ ret = rte_eal_init(argc, argv);
+ if (unlikely(ret < 0))
+ rte_exit(EXIT_FAILURE, "Invalid EAL arguments.\n");
+
+ argc -= ret;
+ argv += ret;
+
/**
* It should be initialized outside of while loop, or failed to
* compile because it is referred when finalize `g_core_info`.
*/
master_lcore = rte_get_master_lcore();
+ /**
+ * If any failure is occured in the while block, break to go the end
+ * of the block to finalize.
+ */
while (1) {
- int ret_eal = rte_eal_init(argc, argv);
- if (unlikely(ret_eal < 0))
- break;
-
- argc -= ret_eal;
- argv += ret_eal;
-
/* Parse spp_pcap specific parameters */
int ret_parse = parse_app_args(argc, argv);
if (unlikely(ret_parse != 0))
--
2.17.1
prev parent reply other threads:[~2019-07-18 5:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-18 5:01 [spp] [PATCH 0/3] Fix assigning wrong master lcore yasufum.o
2019-07-18 5:01 ` [spp] [PATCH 1/3] spp_vf: fix wrong master lcore other than 0 yasufum.o
2019-07-18 5:01 ` [spp] [PATCH 2/3] spp_mirror: " yasufum.o
2019-07-18 5:01 ` yasufum.o [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=20190718050119.6822-4-yasufum.o@gmail.com \
--to=yasufum.o@gmail.com \
--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).