From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B0AE145501; Wed, 26 Jun 2024 14:05:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9428F43493; Wed, 26 Jun 2024 13:57:00 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id 05A2142E95; Wed, 26 Jun 2024 13:45:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719402328; x=1750938328; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YTy7cdpzpnW78VhwZEx+hUPW6mQunt26sqFds94IVJU=; b=Dj+coNbdqOFT6gjEpJPMA5bfyvZI9/R/ZUuFj549UC7Tki1kMPbmHQRs pSVsuafQdGQi7A9Dl7tXY3MraWm4rBeYoOVPv0xC026smpNZgpvmbkJ62 7Z9uF1yW0Oe9A4qUw3ivEoUAoDFqDFiYLejWnN07aM4IB+oCju2ENOY1M JYJVbtP6QJ8VC0CytTvUNCUEtZ4kpPlBOXIiYvJH1sIpmPTixwpEkUgYe Q57Q2AdyOdNs/WEHA9HSA6aTZKqBNJr83qitHEWo7kFNcnJ7zdsZZjl8N wWRPjjkobAcD4+fg/3kTmkRpYY71mjmxf58XBpim3Luc74aNUoX+Wt9qz g==; X-CSE-ConnectionGUID: vg982E6ESne8J8kzf6sQPw== X-CSE-MsgGUID: g0Y2UDJ1QUmWks4xyvgZ/Q== X-IronPort-AV: E=McAfee;i="6700,10204,11114"; a="38979561" X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="38979561" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2024 04:45:27 -0700 X-CSE-ConnectionGUID: H69TN8zKQ7SiLVBEgMkJ1g== X-CSE-MsgGUID: qZFqqj6UQR2RTx1J559FNA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="43874388" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa010.jf.intel.com with ESMTP; 26 Jun 2024 04:45:25 -0700 From: Anatoly Burakov To: dev@dpdk.org, Qiming Yang , Qi Zhang , Paul M Stillwell Jr , Wenzhuo Lu Cc: Yahui Cao , ian.stokes@intel.com, bruce.richardson@intel.com, stable@dpdk.org Subject: [PATCH v4 086/103] net/ice/base: fix masking in ice_get_ctx() Date: Wed, 26 Jun 2024 12:42:14 +0100 Message-ID: <8c54bb1f57fd709b1e5b0bb19b761f40f1ce33c6.1719401848.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Yahui Cao No need to invert mask since we only reserve the masked bits instead of clear them. Fixes: a03c714bfe0b ("net/ice/base: add two helper functions") Cc: qi.z.zhang@intel.com Cc: stable@dpdk.org Signed-off-by: Yahui Cao Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_common.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index c14f66d55b..9a9c8f86e5 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -5014,7 +5014,7 @@ ice_read_byte(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) ice_memcpy(&dest_byte, src, sizeof(dest_byte), ICE_NONDMA_TO_NONDMA); - dest_byte &= ~(mask); + dest_byte &= mask; dest_byte >>= shift_width; @@ -5054,7 +5054,7 @@ ice_read_word(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) /* the data in the memory is stored as little endian so mask it * correctly */ - src_word &= ~(CPU_TO_LE16(mask)); + src_word &= CPU_TO_LE16(mask); /* get the data back into host order before shifting */ dest_word = LE16_TO_CPU(src_word); @@ -5105,7 +5105,7 @@ ice_read_dword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) /* the data in the memory is stored as little endian so mask it * correctly */ - src_dword &= ~(CPU_TO_LE32(mask)); + src_dword &= CPU_TO_LE32(mask); /* get the data back into host order before shifting */ dest_dword = LE32_TO_CPU(src_dword); @@ -5156,7 +5156,7 @@ ice_read_qword(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info) /* the data in the memory is stored as little endian so mask it * correctly */ - src_qword &= ~(CPU_TO_LE64(mask)); + src_qword &= CPU_TO_LE64(mask); /* get the data back into host order before shifting */ dest_qword = LE64_TO_CPU(src_qword); -- 2.43.0