DPDK patches and discussions
 help / color / mirror / Atom feed
From: Paul Szczepanek <paul.szczepanek@arm.com>
To: david.marchand@redhat.com
Cc: dev@dpdk.org, Paul Szczepanek <paul.szczepanek@arm.com>,
	Nick Connolly <nick.connolly@arm.com>
Subject: [PATCH v1] ptr_compress: fix offset to use portable type
Date: Wed, 19 Jun 2024 16:27:13 +0000	[thread overview]
Message-ID: <20240619162713.2489866-1-paul.szczepanek@arm.com> (raw)

Fix the type of offset to use portable uintptr_t instead of uint64_t.

Fixes: 077596a4b077 ("ptr_compress: add pointer compression library")

Reviewed-by: Nick Connolly <nick.connolly@arm.com>
Signed-off-by: Paul Szczepanek <paul.szczepanek@arm.com>
---
 lib/ptr_compress/rte_ptr_compress.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/ptr_compress/rte_ptr_compress.h b/lib/ptr_compress/rte_ptr_compress.h
index ca746970c0..9742a9594a 100644
--- a/lib/ptr_compress/rte_ptr_compress.h
+++ b/lib/ptr_compress/rte_ptr_compress.h
@@ -141,7 +141,7 @@ rte_ptr_compress_32_shift(void *ptr_base, void * const *src_table,
 		i += svcntd();
 	} while (i < n);
 #elif defined __ARM_NEON && !defined RTE_ARCH_ARMv8_AARCH32
-	uint64_t ptr_diff;
+	uintptr_t ptr_diff;
 	uint64x2_t v_ptr_table;
 	/* right shift is done by left shifting by negative int */
 	int64x2_t v_shift = vdupq_n_s64(-bit_shift);
@@ -202,7 +202,7 @@ rte_ptr_decompress_32_shift(void *ptr_base, uint32_t const *src_table,
 		i += svcntd();
 	} while (i < n);
 #elif defined __ARM_NEON && !defined RTE_ARCH_ARMv8_AARCH32
-	uint64_t ptr_diff;
+	uintptr_t ptr_diff;
 	uint64x2_t v_ptr_table;
 	int64x2_t v_shift = vdupq_n_s64(bit_shift);
 	uint64x2_t v_ptr_base = vdupq_n_u64((uint64_t)ptr_base);
@@ -215,7 +215,7 @@ rte_ptr_decompress_32_shift(void *ptr_base, uint32_t const *src_table,
 	}
 	/* process leftover single item in case of odd number of n */
 	if (unlikely(n & 0x1)) {
-		ptr_diff = ((uint64_t) src_table[i]) << bit_shift;
+		ptr_diff = ((uintptr_t) src_table[i]) << bit_shift;
 		dest_table[i] = RTE_PTR_ADD(ptr_base, ptr_diff);
 	}
 #else
--
2.25.1


             reply	other threads:[~2024-06-19 16:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19 16:27 Paul Szczepanek [this message]
2024-06-19 16:32 ` Luca Vizzarro
2024-06-19 16:45   ` David Marchand
2024-06-19 16:51     ` Luca Vizzarro
2024-06-19 17:11       ` David Marchand
2024-06-19 17:11 ` David Marchand

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=20240619162713.2489866-1-paul.szczepanek@arm.com \
    --to=paul.szczepanek@arm.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=nick.connolly@arm.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).