From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id B46CC5B12 for ; Wed, 14 Nov 2018 11:39:54 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Nov 2018 02:39:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,232,1539673200"; d="scan'208";a="104272502" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.124]) ([10.237.220.124]) by fmsmga002.fm.intel.com with ESMTP; 14 Nov 2018 02:39:52 -0800 To: Thomas Monjalon , Li Han Cc: dev@dpdk.org, reshma.pattan@intel.com References: <1541571009-12396-1-git-send-email-han.li1@zte.com.cn> <3847235.2WWUCME0sW@xps> From: "Burakov, Anatoly" Message-ID: Date: Wed, 14 Nov 2018 10:39:51 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <3847235.2WWUCME0sW@xps> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3] app/proc-info: fix port mask parse issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2018 10:39:55 -0000 On 14-Nov-18 3:10 AM, Thomas Monjalon wrote: > 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. > Not only there's no logic, it'll actually fail on 32-bit, since 64-bit int is unsigned long long there :) -- Thanks, Anatoly