From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>,
Jingjing Wu <jingjing.wu@intel.com>,
Bernard Iremonger <bernard.iremonger@intel.com>,
cristian.dumitrescu@intel.com, thomas@monjalon.net,
bruce.richardson@intel.com, ferruh.yigit@intel.com,
jasvinder.singh@intel.com
Subject: [dpdk-dev] [PATCH v2 5/5] testpmd: use library implementation of 64-bit log2
Date: Wed, 14 Nov 2018 16:30:23 +0000 [thread overview]
Message-ID: <a8d598d12704aeb0693d33de3f7b2a98eac5e1a2.1542212598.git.anatoly.burakov@intel.com> (raw)
In-Reply-To: <fbc68e4e563904b7758950cc50ecf0f753f4ec53.1542212598.git.anatoly.burakov@intel.com>
In-Reply-To: <9eb826f80f19422153d5a0ab611fb467a94eded0.1542197039.git.anatoly.burakov@intel.com>
Remove duplicated code and use library version of 64-bit log2.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
app/test-pmd/testpmd.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 9c0edcaed..89c6ffd53 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -649,28 +649,13 @@ calc_mem_size(uint32_t nb_mbufs, uint32_t mbuf_sz, size_t pgsz, size_t *out)
return 0;
}
-static inline uint32_t
-bsf64(uint64_t v)
-{
- return (uint32_t)__builtin_ctzll(v);
-}
-
-static inline uint32_t
-log2_u64(uint64_t v)
-{
- if (v == 0)
- return 0;
- v = rte_align64pow2(v);
- return bsf64(v);
-}
-
static int
pagesz_flags(uint64_t page_sz)
{
/* as per mmap() manpage, all page sizes are log2 of page size
* shifted by MAP_HUGE_SHIFT
*/
- int log2 = log2_u64(page_sz);
+ int log2 = rte_log2_u64(page_sz);
return (log2 << HUGE_SHIFT);
}
--
2.17.1
prev parent reply other threads:[~2018-11-14 16:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Anatoly Burakov [this message]
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=a8d598d12704aeb0693d33de3f7b2a98eac5e1a2.1542212598.git.anatoly.burakov@intel.com \
--to=anatoly.burakov@intel.com \
--cc=bernard.iremonger@intel.com \
--cc=bruce.richardson@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=jasvinder.singh@intel.com \
--cc=jingjing.wu@intel.com \
--cc=thomas@monjalon.net \
--cc=wenzhuo.lu@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).