* [PATCH v1] ptr_compress: fix offset to use portable type
@ 2024-06-19 16:27 Paul Szczepanek
2024-06-19 16:32 ` Luca Vizzarro
2024-06-19 17:11 ` David Marchand
0 siblings, 2 replies; 6+ messages in thread
From: Paul Szczepanek @ 2024-06-19 16:27 UTC (permalink / raw)
To: david.marchand; +Cc: dev, Paul Szczepanek, Nick Connolly
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] ptr_compress: fix offset to use portable type
2024-06-19 16:27 [PATCH v1] ptr_compress: fix offset to use portable type Paul Szczepanek
@ 2024-06-19 16:32 ` Luca Vizzarro
2024-06-19 16:45 ` David Marchand
2024-06-19 17:11 ` David Marchand
1 sibling, 1 reply; 6+ messages in thread
From: Luca Vizzarro @ 2024-06-19 16:32 UTC (permalink / raw)
To: Paul Szczepanek, david.marchand; +Cc: dev, Nick Connolly
Tested-by: Luca Vizzarro <luca.vizzarro@arm.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] ptr_compress: fix offset to use portable type
2024-06-19 16:32 ` Luca Vizzarro
@ 2024-06-19 16:45 ` David Marchand
2024-06-19 16:51 ` Luca Vizzarro
0 siblings, 1 reply; 6+ messages in thread
From: David Marchand @ 2024-06-19 16:45 UTC (permalink / raw)
To: Luca Vizzarro; +Cc: Paul Szczepanek, dev, Nick Connolly
Hello Luca,
On Wed, Jun 19, 2024 at 6:39 PM Luca Vizzarro <Luca.Vizzarro@arm.com> wrote:
>
> Tested-by: Luca Vizzarro <luca.vizzarro@arm.com>
I would like to take this patch for rc1.
Can you confirm which tests were done please?
Thank you.
--
David Marchand
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] ptr_compress: fix offset to use portable type
2024-06-19 16:45 ` David Marchand
@ 2024-06-19 16:51 ` Luca Vizzarro
2024-06-19 17:11 ` David Marchand
0 siblings, 1 reply; 6+ messages in thread
From: Luca Vizzarro @ 2024-06-19 16:51 UTC (permalink / raw)
To: David Marchand; +Cc: Paul Szczepanek, dev, Nick Connolly
On 19/06/2024 17:45, David Marchand wrote:
> I would like to take this patch for rc1.
> Can you confirm which tests were done please?
Hi David,
the test verified if the warning messages that this commit fixes
disappeared. To do so, I've compiled main with this patch applied
against an armv7-a target. The compilation warnings that were appearing
on main, did indeed disappear after applying this patch.
Best,
Luca
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] ptr_compress: fix offset to use portable type
2024-06-19 16:51 ` Luca Vizzarro
@ 2024-06-19 17:11 ` David Marchand
0 siblings, 0 replies; 6+ messages in thread
From: David Marchand @ 2024-06-19 17:11 UTC (permalink / raw)
To: Luca Vizzarro; +Cc: Paul Szczepanek, dev, Nick Connolly
On Wed, Jun 19, 2024 at 6:51 PM Luca Vizzarro <Luca.Vizzarro@arm.com> wrote:
>
> On 19/06/2024 17:45, David Marchand wrote:
> > I would like to take this patch for rc1.
> > Can you confirm which tests were done please?
>
> Hi David,
>
> the test verified if the warning messages that this commit fixes
> disappeared. To do so, I've compiled main with this patch applied
> against an armv7-a target. The compilation warnings that were appearing
> on main, did indeed disappear after applying this patch.
Thanks for the test on armv7, this is what I was missing.
--
David Marchand
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1] ptr_compress: fix offset to use portable type
2024-06-19 16:27 [PATCH v1] ptr_compress: fix offset to use portable type Paul Szczepanek
2024-06-19 16:32 ` Luca Vizzarro
@ 2024-06-19 17:11 ` David Marchand
1 sibling, 0 replies; 6+ messages in thread
From: David Marchand @ 2024-06-19 17:11 UTC (permalink / raw)
To: Paul Szczepanek; +Cc: dev, Nick Connolly, Luca Boccassi, Luca Vizzarro
On Wed, Jun 19, 2024 at 6:27 PM Paul Szczepanek <paul.szczepanek@arm.com> wrote:
>
> Fix the type of offset to use portable uintptr_t instead of uint64_t.
>
> Fixes: 077596a4b077 ("ptr_compress: add pointer compression library")
>
Reported-by: Luca Boccassi <bluca@debian.org>
> Reviewed-by: Nick Connolly <nick.connolly@arm.com>
> Signed-off-by: Paul Szczepanek <paul.szczepanek@arm.com>
Tested-by: Luca Vizzarro <luca.vizzarro@arm.com>
Applied, thanks for the fix.
--
David Marchand
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-06-19 17:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-19 16:27 [PATCH v1] ptr_compress: fix offset to use portable type Paul Szczepanek
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
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).