From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3] app/proc-info: fix port mask parse issue Date: Wed, 14 Nov 2018 04:10:28 +0100 Message-ID: <3847235.2WWUCME0sW@xps> References: <1541571009-12396-1-git-send-email-han.li1@zte.com.cn> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, reshma.pattan@intel.com To: Li Han Return-path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 539A411A4 for ; Wed, 14 Nov 2018 04:10:32 +0100 (CET) In-Reply-To: <1541571009-12396-1-git-send-email-han.li1@zte.com.cn> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, 07/11/2018 07:10, Li Han: > parse_portmask return type is int,but global variable > "enabled_port_mask" type is uint32_t.so in proc_info_parse_args > function,when parse_portmask return -1,"enabled_port_mask" will > get a huge value and "if (enabled_port_mask == 0)" will never happen. > > Fixes: 22561383ea17 ("app: replace dump_cfg by proc_info") > Signed-off-by: Li Han [...] > -static uint32_t enabled_port_mask; > +static uint64_t enabled_port_mask; [...] > -static int > +static unsigned long > parse_portmask(const char *portmask) On one side, you use uint64_t, on the other side, you use unsigned long. I don't understand the logic behind.