DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] bitmap: deprecate rte_bsf64
@ 2018-11-14 12:11 Anatoly Burakov
  2018-11-14 16:30 ` [dpdk-dev] [PATCH v2 1/5] bitmap: remove useless code Anatoly Burakov
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Anatoly Burakov @ 2018-11-14 12:11 UTC (permalink / raw)
  To: dev
  Cc: Neil Horman, John McNamara, Marko Kovacevic, Cristian Dumitrescu,
	thomas, bruce.richardson, ferruh.yigit, jasvinder.singh

The rte_bsf64 in rte_bitmap.h has a global namespace but does not
follow convention of existing rte_bsf32 function in rte_common.h.

Therefore, deprecate the current rte_bsf64 and introduce a new
rte_bitmap_bsf64 function that will do the same thing.

In later release cycles, rte_bsf64 will be removed from rte_bitmap.h
and a proper rte_bsf64 implementation will be added to rte_common.h.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 doc/guides/rel_notes/deprecation.rst       |  5 +++++
 lib/librte_eal/common/include/rte_bitmap.h | 16 ++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 34b28234c..63793979d 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -22,6 +22,11 @@ Deprecation Notices
 
     + ``rte_eal_devargs_type_count``
 
+* eal: function ``rte_bsf64`` in ``rte_bitmap.h`` has been renamed to
+  ``rte_bitmap_bsf64``, and a new ``rte_bsf64`` function will be added in
+  release 19.05 in ``rte_common.h`` that follows convention set by existing
+  ``rte_bsf32`` function.
+
 * pci: Several exposed functions are misnamed.
   The following functions are deprecated starting from v17.11 and are replaced:
 
diff --git a/lib/librte_eal/common/include/rte_bitmap.h b/lib/librte_eal/common/include/rte_bitmap.h
index 7a36ce73c..fd4f0aa78 100644
--- a/lib/librte_eal/common/include/rte_bitmap.h
+++ b/lib/librte_eal/common/include/rte_bitmap.h
@@ -100,7 +100,7 @@ __rte_bitmap_index2_set(struct rte_bitmap *bmp)
 #if RTE_BITMAP_OPTIMIZATIONS
 
 static inline int
-rte_bsf64(uint64_t slab, uint32_t *pos)
+rte_bitmap_bsf64(uint64_t slab, uint32_t *pos)
 {
 	if (likely(slab == 0)) {
 		return 0;
@@ -113,7 +113,7 @@ rte_bsf64(uint64_t slab, uint32_t *pos)
 #else
 
 static inline int
-rte_bsf64(uint64_t slab, uint32_t *pos)
+rte_bitmap_bsf64(uint64_t slab, uint32_t *pos)
 {
 	uint64_t mask;
 	uint32_t i;
@@ -134,6 +134,12 @@ rte_bsf64(uint64_t slab, uint32_t *pos)
 
 #endif
 
+static inline int __rte_deprecated
+rte_bsf64(uint64_t slab, uint32_t *pos)
+{
+	return rte_bitmap_bsf64(slab, pos);
+}
+
 static inline uint32_t
 __rte_bitmap_get_memory_footprint(uint32_t n_bits,
 	uint32_t *array1_byte_offset, uint32_t *array1_slabs,
@@ -439,9 +445,8 @@ __rte_bitmap_scan_search(struct rte_bitmap *bmp)
 	value1 = bmp->array1[bmp->index1];
 	value1 &= __rte_bitmap_mask1_get(bmp);
 
-	if (rte_bsf64(value1, &bmp->offset1)) {
+	if (rte_bitmap_bsf64(value1, &bmp->offset1))
 		return 1;
-	}
 
 	__rte_bitmap_index1_inc(bmp);
 	bmp->offset1 = 0;
@@ -450,9 +455,8 @@ __rte_bitmap_scan_search(struct rte_bitmap *bmp)
 	for (i = 0; i < bmp->array1_size; i ++, __rte_bitmap_index1_inc(bmp)) {
 		value1 = bmp->array1[bmp->index1];
 
-		if (rte_bsf64(value1, &bmp->offset1)) {
+		if (rte_bitmap_bsf64(value1, &bmp->offset1))
 			return 1;
-		}
 	}
 
 	return 0;
-- 
2.17.1

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

end of thread, other threads:[~2018-11-22 16:54 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14 12:11 [dpdk-dev] [PATCH] bitmap: deprecate rte_bsf64 Anatoly Burakov
2018-11-14 16:30 ` [dpdk-dev] [PATCH v2 1/5] bitmap: remove useless code Anatoly Burakov
2018-11-14 16:40   ` Dumitrescu, Cristian
2018-11-14 16:47   ` [dpdk-dev] [PATCH v3 " Anatoly Burakov
2018-11-14 16:47   ` [dpdk-dev] [PATCH v3 2/5] bitmap: rename rte_bsf64 and move to common header Anatoly Burakov
2018-11-14 16:52     ` Singh, Jasvinder
2018-11-22 16:54       ` Hunt, David
2018-11-14 16:47   ` [dpdk-dev] [PATCH v3 3/5] common: add missing implementations Anatoly Burakov
2018-11-15  8:40     ` Jerin Jacob
2018-11-15 10:07       ` Burakov, Anatoly
2018-11-14 16:47   ` [dpdk-dev] [PATCH v3 4/5] memalloc: use library implementation of 64-bit log2 Anatoly Burakov
2018-11-14 16:47   ` [dpdk-dev] [PATCH v3 5/5] testpmd: " Anatoly Burakov
2018-11-15 10:08   ` [dpdk-dev] [PATCH v2 1/5] bitmap: remove useless code Burakov, Anatoly
2018-11-14 16:30 ` [dpdk-dev] [PATCH v2 2/5] bitmap: rename rte_bsf64 and move to common header Anatoly Burakov
2018-11-14 16:30 ` [dpdk-dev] [PATCH v2 3/5] common: add missing implementations Anatoly Burakov
2018-11-14 16:30 ` [dpdk-dev] [PATCH v2 4/5] memalloc: use library implementation of 64-bit log2 Anatoly Burakov
2018-11-14 16:30 ` [dpdk-dev] [PATCH v2 5/5] testpmd: " Anatoly Burakov

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