patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org, Qiming Yang <qiming.yang@intel.com>,
	Qi Zhang <qi.z.zhang@intel.com>,
	Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>,
	Wenzhuo Lu <wenzhuo.lu@intel.com>
Cc: Yahui Cao <yahui.cao@intel.com>,
	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	[thread overview]
Message-ID: <8c54bb1f57fd709b1e5b0bb19b761f40f1ce33c6.1719401848.git.anatoly.burakov@intel.com> (raw)
In-Reply-To: <cover.1719401847.git.anatoly.burakov@intel.com>

From: Yahui Cao <yahui.cao@intel.com>

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 <yahui.cao@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
---
 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


      parent reply	other threads:[~2024-06-26 11:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1718204528.git.anatoly.burakov@intel.com>
     [not found] ` <cover.1719313663.git.anatoly.burakov@intel.com>
2024-06-25 11:12   ` [PATCH v3 020/129] net/ice/base: fix memory leak when checking firmware version Anatoly Burakov
2024-06-25 11:12   ` [PATCH v3 035/129] net/ice/base: fix sign-extension Anatoly Burakov
2024-06-25 11:14   ` [PATCH v3 115/129] net/ice/base: fix ice_get_ctx() issue Anatoly Burakov
     [not found]   ` <cover.1719401847.git.anatoly.burakov@intel.com>
2024-06-26 11:41     ` [PATCH v4 015/103] net/ice/base: fix sign-extension Anatoly Burakov
2024-06-26 11:41     ` [PATCH v4 050/103] net/ice/base: fix wrong definition of board type Anatoly Burakov
2024-06-26 11:42     ` Anatoly Burakov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8c54bb1f57fd709b1e5b0bb19b761f40f1ce33c6.1719401848.git.anatoly.burakov@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ian.stokes@intel.com \
    --cc=paul.m.stillwell.jr@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    --cc=yahui.cao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).