DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] hash: cast away atomic qualification
@ 2024-04-16 16:06 Tyler Retzlaff
  2024-05-16 17:08 ` Thomas Monjalon
  2024-05-22 16:33 ` [PATCH v2] " Tyler Retzlaff
  0 siblings, 2 replies; 5+ messages in thread
From: Tyler Retzlaff @ 2024-04-16 16:06 UTC (permalink / raw)
  To: dev
  Cc: Bruce Richardson, Sameh Gobriel, Vladimir Medvedkin, Yipeng Wang,
	Tyler Retzlaff

rte_free accepts only non-cva qualified arguments so cast away
RTE_ATOMIC qualification for tbl_chng_cnt and h->tbl_chng_cnt when
calling rte_free.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/hash/rte_cuckoo_hash.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c
index 9cf9464..b31a3d9 100644
--- a/lib/hash/rte_cuckoo_hash.c
+++ b/lib/hash/rte_cuckoo_hash.c
@@ -481,7 +481,7 @@ struct rte_hash *
 	rte_free(buckets);
 	rte_free(buckets_ext);
 	rte_free(k);
-	rte_free(tbl_chng_cnt);
+	rte_free((void *)(uintptr_t)tbl_chng_cnt);
 	rte_free(ext_bkt_to_free);
 	return NULL;
 }
@@ -526,7 +526,7 @@ struct rte_hash *
 	rte_free(h->key_store);
 	rte_free(h->buckets);
 	rte_free(h->buckets_ext);
-	rte_free(h->tbl_chng_cnt);
+	rte_free((void *)(uintptr_t)h->tbl_chng_cnt);
 	rte_free(h->ext_bkt_to_free);
 	rte_free(h->hash_rcu_cfg);
 	rte_free(h);
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] hash: cast away atomic qualification
  2024-04-16 16:06 [PATCH] hash: cast away atomic qualification Tyler Retzlaff
@ 2024-05-16 17:08 ` Thomas Monjalon
  2024-05-22 16:33 ` [PATCH v2] " Tyler Retzlaff
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2024-05-16 17:08 UTC (permalink / raw)
  To: Tyler Retzlaff
  Cc: dev, Bruce Richardson, Sameh Gobriel, Vladimir Medvedkin, Yipeng Wang

16/04/2024 18:06, Tyler Retzlaff:
> rte_free accepts only non-cva qualified arguments so cast away
> RTE_ATOMIC qualification for tbl_chng_cnt and h->tbl_chng_cnt when
> calling rte_free.
> 
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>

Please add an explanation about the case where it does not compile.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] hash: cast away atomic qualification
  2024-04-16 16:06 [PATCH] hash: cast away atomic qualification Tyler Retzlaff
  2024-05-16 17:08 ` Thomas Monjalon
@ 2024-05-22 16:33 ` Tyler Retzlaff
  2024-05-22 16:33   ` Tyler Retzlaff
  1 sibling, 1 reply; 5+ messages in thread
From: Tyler Retzlaff @ 2024-05-22 16:33 UTC (permalink / raw)
  To: dev
  Cc: Bruce Richardson, Sameh Gobriel, Vladimir Medvedkin, Yipeng Wang,
	Tyler Retzlaff

rte_free accepts only non-cva qualified arguments so cast away
RTE_ATOMIC qualification for tbl_chng_cnt and h->tbl_chng_cnt when
calling rte_free.

Without this change using enable_stdatomic=true with LLVM or MSVC will
result in a warning being emitted for discarding the atomic
qualification.

v2:
  * update commit message to indicate the conditions under
    which a warning will be issued without this patch.

Tyler Retzlaff (1):
  hash: cast away atomic qualification

 lib/hash/rte_cuckoo_hash.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] hash: cast away atomic qualification
  2024-05-22 16:33 ` [PATCH v2] " Tyler Retzlaff
@ 2024-05-22 16:33   ` Tyler Retzlaff
  2024-05-26 14:51     ` Thomas Monjalon
  0 siblings, 1 reply; 5+ messages in thread
From: Tyler Retzlaff @ 2024-05-22 16:33 UTC (permalink / raw)
  To: dev
  Cc: Bruce Richardson, Sameh Gobriel, Vladimir Medvedkin, Yipeng Wang,
	Tyler Retzlaff

rte_free accepts only non-cva qualified arguments so cast away
RTE_ATOMIC qualification for tbl_chng_cnt and h->tbl_chng_cnt when
calling rte_free.

Without this change using enable_stdatomic=true with LLVM or MSVC will
result in a warning being emitted for discarding the atomic
qualification.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/hash/rte_cuckoo_hash.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c
index 9cf9464..b31a3d9 100644
--- a/lib/hash/rte_cuckoo_hash.c
+++ b/lib/hash/rte_cuckoo_hash.c
@@ -481,7 +481,7 @@ struct rte_hash *
 	rte_free(buckets);
 	rte_free(buckets_ext);
 	rte_free(k);
-	rte_free(tbl_chng_cnt);
+	rte_free((void *)(uintptr_t)tbl_chng_cnt);
 	rte_free(ext_bkt_to_free);
 	return NULL;
 }
@@ -526,7 +526,7 @@ struct rte_hash *
 	rte_free(h->key_store);
 	rte_free(h->buckets);
 	rte_free(h->buckets_ext);
-	rte_free(h->tbl_chng_cnt);
+	rte_free((void *)(uintptr_t)h->tbl_chng_cnt);
 	rte_free(h->ext_bkt_to_free);
 	rte_free(h->hash_rcu_cfg);
 	rte_free(h);
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] hash: cast away atomic qualification
  2024-05-22 16:33   ` Tyler Retzlaff
@ 2024-05-26 14:51     ` Thomas Monjalon
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2024-05-26 14:51 UTC (permalink / raw)
  To: Tyler Retzlaff
  Cc: dev, Bruce Richardson, Sameh Gobriel, Vladimir Medvedkin, Yipeng Wang

22/05/2024 18:33, Tyler Retzlaff:
> rte_free accepts only non-cva qualified arguments so cast away
> RTE_ATOMIC qualification for tbl_chng_cnt and h->tbl_chng_cnt when
> calling rte_free.
> 
> Without this change using enable_stdatomic=true with LLVM or MSVC will
> result in a warning being emitted for discarding the atomic
> qualification.
> 
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>

Applied, thanks.




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-26 14:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-16 16:06 [PATCH] hash: cast away atomic qualification Tyler Retzlaff
2024-05-16 17:08 ` Thomas Monjalon
2024-05-22 16:33 ` [PATCH v2] " Tyler Retzlaff
2024-05-22 16:33   ` Tyler Retzlaff
2024-05-26 14:51     ` Thomas Monjalon

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).