From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id B19ED11A4 for ; Tue, 21 Jul 2015 16:37:45 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 21 Jul 2015 07:37:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,516,1432623600"; d="scan'208";a="768365940" Received: from unknown (HELO stargo) ([10.217.248.233]) by orsmga002.jf.intel.com with SMTP; 21 Jul 2015 07:37:42 -0700 Received: by stargo (sSMTP sendmail emulation); Tue, 21 Jul 2015 16:39:05 +0200 From: Maciej Gajdzica To: dev@dpdk.org Date: Tue, 21 Jul 2015 16:39:00 +0200 Message-Id: <1437489540-20758-1-git-send-email-maciejx.t.gajdzica@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH 1/1] ip_pipeline: fixed parsing cpu cores X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jul 2015 14:37:46 -0000 This patch fixes parsing value of core variable in pipeline config. Before not every combination of cores (c), sockets (s) and hyperthreading (h) was parsed correctly. Signed-off-by: Maciej Gajdzica --- examples/ip_pipeline/config_parse.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/ip_pipeline/config_parse.c b/examples/ip_pipeline/config_parse.c index 361bf8a..c9b78f9 100644 --- a/examples/ip_pipeline/config_parse.c +++ b/examples/ip_pipeline/config_parse.c @@ -386,14 +386,14 @@ parse_pipeline_core(uint32_t *socket, switch (type) { case 's': case 'S': - if (s_parsed) + if (s_parsed || c_parsed || h_parsed) return -EINVAL; s_parsed = 1; next++; break; case 'c': case 'C': - if (c_parsed) + if (c_parsed || h_parsed) return -EINVAL; c_parsed = 1; next++; @@ -423,7 +423,10 @@ parse_pipeline_core(uint32_t *socket, num[num_len] = *next; } - if (num_len == 0 && type != 'h') + if (num_len == 0 && type != 'h' && type != 'H') + return -EINVAL; + + if (num_len != 0 && (type == 'h' || type == 'H')) return -EINVAL; num[num_len] = '\0'; @@ -438,9 +441,6 @@ parse_pipeline_core(uint32_t *socket, case 'c': case 'C': c = val; - if (type == 'C' && *next != '\0') - return -EINVAL; - break; case 'h': case 'H': -- 1.7.9.5