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 DF0B41DB1 for ; Thu, 9 Jun 2016 17:14:57 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 09 Jun 2016 08:14:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,445,1459839600"; d="scan'208";a="984187109" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.71]) by fmsmga001.fm.intel.com with SMTP; 09 Jun 2016 08:14:10 -0700 Received: by (sSMTP sendmail emulation); Thu, 09 Jun 2016 16:14:08 +0025 Date: Thu, 9 Jun 2016 16:14:08 +0100 From: Bruce Richardson To: Slawomir Mrozowicz Cc: helin.zhang@intel.com, jingjing.wu@intel.com, dev@dpdk.org Message-ID: <20160609151408.GD12520@bricha3-MOBL3> References: <1463749416-7658-1-git-send-email-slawomirx.mrozowicz@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1463749416-7658-1-git-send-email-slawomirx.mrozowicz@intel.com> Organization: Intel Research and =?iso-8859-1?Q?De=ACvel?= =?iso-8859-1?Q?opment?= Ireland Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] i40e: unintended sign extension 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: Thu, 09 Jun 2016 15:14:58 -0000 On Fri, May 20, 2016 at 03:03:36PM +0200, Slawomir Mrozowicz wrote: > Suspicious implicit sign extension: pf->fdir.match_counter_index > with type unsigned short (16 bits, unsigned) is promoted in > pf->fdir.match_counter_index << 20 to type int (32 bits, signed), > then sign-extended to type unsigned long (64 bits, unsigned). > If pf->fdir.match_counter_index << 20 is greater than 0x7FFFFFFF, > the upper bits of the result will all be 1. > To fix the issue set explicit cast uint32_t of pf->fdir.match_counter_index. > > Fixes: 05999aab4ca6 ("i40e: add or delete flow director") > Coverity ID 13315 > > Signed-off-by: Slawomir Mrozowicz Acked-by: Bruce Richardson Applied to dpdk-next-net/rel_16_07 /Bruce