From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 804AEA0471 for ; Thu, 18 Jul 2019 07:01:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6A2043977; Thu, 18 Jul 2019 07:01:30 +0200 (CEST) Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by dpdk.org (Postfix) with ESMTP id BB6E72082 for ; Thu, 18 Jul 2019 07:01:28 +0200 (CEST) Received: by mail-pl1-f195.google.com with SMTP id w24so13201981plp.2 for ; Wed, 17 Jul 2019 22:01:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=TFVhVimjNacsUrcW61acnC7f6+EbnzZJ6QN+fieXO1o=; b=PKo7FscS3TDTpZV7+AXhvjri/R+MLJvKB9PQnAwvuvtgAPdCximmR5DVKkaE4mYhgs N4mobMWWOwRO9lalUQp0xka4q1Ci3b9hxdIWwLZH3HwS2JSmBAWsQHCgFahdvjvRkGIY 6L4N5jDEk9ub5C0/pRu+ytfjKTNU9aike8AY1swMHAwhliaUddW1C/iY27h4noRfVSYx +b36cTI9F2MnlSZrMIZfc64Ia40DV0pysBlDqsTrSTCd6s9pbVf534emzK07a89gKHov pQ2MTP6bmAdHhQq6aAjP4aEFbIMEbIkr9w2lK5Ajgi8G2N0oUCwwQrPmsmdJInA2N2RX vPig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=TFVhVimjNacsUrcW61acnC7f6+EbnzZJ6QN+fieXO1o=; b=KGC7uknwVTFjkGkD/ZIebLrR8hWC433EjByEQQgdpqbsdxFBJ4qF3vc2KKjK/y85N2 4fH3XxuSat3CzlCwS3LtgMn2R+iL3a6LvJMiwBVzEEyCzYFtMVY1eWJZ+bNj2BNq5/wY bEqDesQYOqg6xfFGBAZxzNYdZOj8+ramHjZbZfdFoQH0IThQTBMYEbMa2JhtefL0mRjJ WrPU0JLcprX56nhMZdgMjqGV43WdNZi4opAR5AvOTMyLDDouw7B5gZerMCL+C+5EuGiH VHWsuKqT2+NyqYhw743T0vzZmUcRJZlPejQav8bJ0Bf5RXDGyK/hEAYNpCtzexYVDFYM Ui2A== X-Gm-Message-State: APjAAAVRF1UbrAJLNMUXRbiXOEXVEBhp5sHxyNS0klPhpsOhKUFdThso THnvFXmnWoetRqfWjlISFFlee9yB X-Google-Smtp-Source: APXvYqwJHb1HEdvk/P17LS7qS5/Dt7duMpYkbstzjijMdn6tscQE7zYNQjaMcpynRSzHk0HCpdaUlw== X-Received: by 2002:a17:902:6a87:: with SMTP id n7mr47086943plk.336.1563426087889; Wed, 17 Jul 2019 22:01:27 -0700 (PDT) Received: from localhost.localdomain ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id k25sm18958372pgt.53.2019.07.17.22.01.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jul 2019 22:01:27 -0700 (PDT) From: yasufum.o@gmail.com To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Thu, 18 Jul 2019 14:01:19 +0900 Message-Id: <20190718050119.6822-4-yasufum.o@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190718050119.6822-1-yasufum.o@gmail.com> References: <20190718050119.6822-1-yasufum.o@gmail.com> Subject: [spp] [PATCH 3/3] spp_pcap: fix wrong master lcore other than 0 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 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 --- 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