From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org, Qiming Yang <qiming.yang@intel.com>,
Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>,
Wenzhuo Lu <wenzhuo.lu@intel.com>,
Qi Zhang <qi.z.zhang@intel.com>
Cc: Yahui Cao <yahui.cao@intel.com>,
bruce.richardson@intel.com, ian.stokes@intel.com,
stable@dpdk.org
Subject: [PATCH v3 115/129] net/ice/base: fix ice_get_ctx() issue
Date: Tue, 25 Jun 2024 12:14:00 +0100 [thread overview]
Message-ID: <55b73deb5ba88e2a14ed5d5830919e5f759c7441.1719313664.git.anatoly.burakov@intel.com> (raw)
In-Reply-To: <cover.1719313663.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 ad9b95f75e..8fcd27a594 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -5033,7 +5033,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;
@@ -5073,7 +5073,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);
@@ -5124,7 +5124,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);
@@ -5175,7 +5175,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
next prev parent reply other threads:[~2024-06-25 11:20 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 ` Anatoly Burakov [this message]
[not found] ` <cover.1719401847.git.anatoly.burakov@intel.com>
2024-06-26 11:41 ` [PATCH v4 015/103] " 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 ` [PATCH v4 086/103] net/ice/base: fix masking in ice_get_ctx() Anatoly Burakov
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=55b73deb5ba88e2a14ed5d5830919e5f759c7441.1719313664.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).