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 EE68DA046B for ; Tue, 23 Jul 2019 05:49:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D40DD1BF57; Tue, 23 Jul 2019 05:49:02 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id BDE3B1BF68; Tue, 23 Jul 2019 05:48:52 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jul 2019 20:48:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,297,1559545200"; d="scan'208";a="163371727" Received: from dpdk51.sh.intel.com ([10.67.110.245]) by orsmga008.jf.intel.com with ESMTP; 22 Jul 2019 20:48:51 -0700 From: Qi Zhang To: qiming.yang@intel.com, wenzhuo.lu@intel.com Cc: paul.m.stillwell.jr@intel.com, dev@dpdk.org, Qi Zhang , stable@dpdk.org, Dan Nowlin Date: Tue, 23 Jul 2019 11:51:15 +0800 Message-Id: <20190723035115.42664-7-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20190723035115.42664-1-qi.z.zhang@intel.com> References: <20190723035115.42664-1-qi.z.zhang@intel.com> Subject: [dpdk-stable] [PATCH 6/6] net/ice/base: fix for and/or bitmap routines X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" There was an issue with ice_and_bitmap and ice_or_bitmap when dealing with bit array sizes that are not even multiples of 32, where some of relevant bits in the highest 32 bits were being cleared. This patch fixes those problems. Fixes: c9e37832c95f ("net/ice/base: rework on bit ops") Cc: stable@dpdk.org Signed-off-by: Dan Nowlin Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_bitops.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ice/base/ice_bitops.h b/drivers/net/ice/base/ice_bitops.h index c74407d9d..a3a67eb4b 100644 --- a/drivers/net/ice/base/ice_bitops.h +++ b/drivers/net/ice/base/ice_bitops.h @@ -191,8 +191,7 @@ ice_and_bitmap(ice_bitmap_t *dst, const ice_bitmap_t *bmp1, * size value alone. */ mask = LAST_CHUNK_MASK(size); - dst[i] &= ~mask; - dst[i] |= (bmp1[i] & bmp2[i]) & mask; + dst[i] = (dst[i] & ~mask) | ((bmp1[i] & bmp2[i]) & mask); res |= dst[i] & mask; return res != 0; @@ -226,8 +225,7 @@ ice_or_bitmap(ice_bitmap_t *dst, const ice_bitmap_t *bmp1, * within the specified size. */ mask = LAST_CHUNK_MASK(size); - dst[i] &= ~mask; - dst[i] |= (bmp1[i] | bmp2[i]) & mask; + dst[i] = (dst[i] & ~mask) | ((bmp1[i] | bmp2[i]) & mask); } /** -- 2.13.6