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 DB1A7A0526; Tue, 21 Jul 2020 18:07:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 89B4A1BFE7; Tue, 21 Jul 2020 18:07:36 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 028B81BFE4; Tue, 21 Jul 2020 18:07:34 +0200 (CEST) IronPort-SDR: qXIzntig7pU9IYa9TbxGlGJ322smxtwG/roK7EUe5JCqvs5JenXXuX8af+kX7EztGDkMY2D1Pe PdmUl9NbJtFQ== X-IronPort-AV: E=McAfee;i="6000,8403,9689"; a="211709268" X-IronPort-AV: E=Sophos;i="5.75,379,1589266800"; d="scan'208";a="211709268" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2020 09:07:33 -0700 IronPort-SDR: vYeQXLvOS86LHoDVIJoYciIzSrkuup6mHyrpWyEQW3w1u/xoU6NhtPRrr0qxDXUlXcsNpyZZYF /fZPWpf9xSGQ== X-IronPort-AV: E=Sophos;i="5.75,379,1589266800"; d="scan'208";a="310295269" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.9.114]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 21 Jul 2020 09:07:30 -0700 Date: Tue, 21 Jul 2020 17:07:27 +0100 From: Bruce Richardson To: Sarosh Arif Cc: dev@dpdk.org, drc@linux.vnet.ibm.com, maxime.coquelin@redhat.com, zhihong.wang@intel.com, xiaolong.ye@intel.com, konstantin.ananyev@intel.com, david.hunt@intel.com, jerinj@marvell.com, skori@marvell.com, john.mcnamara@intel.com, kirill.rybalchenko@intel.com, stable@dpdk.org Message-ID: <20200721160727.GI735@bricha3-MOBL.ger.corp.intel.com> References: <20200611123624.25319-1-sarosh.arif@emumba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200611123624.25319-1-sarosh.arif@emumba.com> Subject: Re: [dpdk-dev] [PATCH] examples: fix return value of function that parses portmask 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Jun 11, 2020 at 05:36:24PM +0500, Sarosh Arif wrote: > Giving invalid or zero portmask as command line option to > these applications will have an unexpected response. > The reason behind this is that the return value of function > that parses portmask is stored in a variable whose datatype is > unsigned int, hence returning -1 in case of zero or > invalid portmask causes an unexpected behaviour. > If we return 0 instead of -1 this issue can be resolved. > The program already contains the functionality to print > "invalid portmask" and program usage if zero is returned. > > Signed-off-by: Sarosh Arif > --- Checked a number of the examples and all seem to behave similarly to described. This looks a good fix. Acked-by: Bruce Richardson