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 767544404F; Wed, 12 Jun 2024 17:26:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B0A0943300; Wed, 12 Jun 2024 17:07:10 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 55133432CC for ; Wed, 12 Jun 2024 17:07:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204824; x=1749740824; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KhDDgN4ovnq3jufRvBJZ/m/BvtnyYn/JDyrxm+AM3hc=; b=hgBnlTOLeIaF3H0RHNVBURU7HGnozNQgeTgLxFmX0V3962EqTfD1eV6u MnI4ALjCTgCLhnvBx3fsTgFenVsSuK6sPy1DDkp2d0AoD8mlFOlhTXoUH sfEHuKqlOlN7v8R0PerbJPECqz4PaH121GzAKQgXcDbCwKF7esTjCcNIh ghqSAXGnOGeKFANAhdrrnoP9HQpk1Hd75xanhAlx+1k5PRvZjyCKcWQ/q N6QqzkYE7/V0bAHtF6N4pczxm87rYh/XYCN/EU7NyIz2AwzLKGbsJkv4W N2iZ6QDTcljcGHNxbMkuDD/gfDiaPBriPkzvuMzkHpVMtGaW73BP9HzDE w==; X-CSE-ConnectionGUID: 0Xko4qi+TFWlsnFL37DHQQ== X-CSE-MsgGUID: 0MyEKp+uS2OTawnTkQBJ1w== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32460128" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32460128" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 08:07:03 -0700 X-CSE-ConnectionGUID: V9xUkeIvSD+NQRevGQIRNA== X-CSE-MsgGUID: a5Vdx3VOQVGhny/pXLVvkA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39926020" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:07:02 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Ian Stokes , bruce.richardson@intel.com, Yahui Cao Subject: [PATCH v2 135/148] net/ice/base: fix ice_get_ctx() issue Date: Wed, 12 Jun 2024 16:02:09 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240430154014.1026-1-ian.stokes@intel.com> 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: Ian Stokes No need to invert mask since we only reserve the masked bits instead of clear them. 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 cc84b8a6ec..3f7d1543ee 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -5044,7 +5044,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; @@ -5084,7 +5084,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); @@ -5135,7 +5135,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); @@ -5186,7 +5186,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