get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/125742/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 125742,
    "url": "http://patchwork.dpdk.org/api/patches/125742/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1680567118-6435-2-git-send-email-roretzla@linux.microsoft.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1680567118-6435-2-git-send-email-roretzla@linux.microsoft.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1680567118-6435-2-git-send-email-roretzla@linux.microsoft.com",
    "date": "2023-04-04T00:11:56",
    "name": "[v8,1/3] eal: move bit count functions to bitops header",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "5717277bec26535539321ac9e3d516650453f910",
    "submitter": {
        "id": 2077,
        "url": "http://patchwork.dpdk.org/api/people/2077/?format=api",
        "name": "Tyler Retzlaff",
        "email": "roretzla@linux.microsoft.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patchwork.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1680567118-6435-2-git-send-email-roretzla@linux.microsoft.com/mbox/",
    "series": [
        {
            "id": 27612,
            "url": "http://patchwork.dpdk.org/api/series/27612/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=27612",
            "date": "2023-04-04T00:11:55",
            "name": "eal: provide abstracted bit counting functions",
            "version": 8,
            "mbox": "http://patchwork.dpdk.org/series/27612/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/125742/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/125742/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id BE46E428C1;\n\tTue,  4 Apr 2023 02:12:07 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A681F41141;\n\tTue,  4 Apr 2023 02:12:02 +0200 (CEST)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 825E140141\n for <dev@dpdk.org>; Tue,  4 Apr 2023 02:12:00 +0200 (CEST)",
            "by linux.microsoft.com (Postfix, from userid 1086)\n id C4529210DC6D; Mon,  3 Apr 2023 17:11:59 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com C4529210DC6D",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1680567119;\n bh=6NCEK3mmwXvFFERVSw4kuPcVm11KhEaaVdwhRzOGCeU=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=KPWNVpaBQ2IF6KOmgJ2g+8OJt4JuCHKfnSXeTRU/x1OyCnyyE9LSUnuidXX5kQbwg\n C6XOqYdqDEP2F6OxSTH9M+bn2j99tvqaeK6KlTvZBnBw0JDsLUJv2E14Pv2k/tdmho\n wh8fMP0W4tfa9hPIKHgko4ZrtIF+FT5B5AjFsk5c=",
        "From": "Tyler Retzlaff <roretzla@linux.microsoft.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, stephen@networkplumber.org, mb@smartsharesystems.com,\n bruce.richardson@intel.com, ferruh.yigit@amd.com,\n david.marchand@redhat.com, Tyler Retzlaff <roretzla@linux.microsoft.com>",
        "Subject": "[PATCH v8 1/3] eal: move bit count functions to bitops header",
        "Date": "Mon,  3 Apr 2023 17:11:56 -0700",
        "Message-Id": "<1680567118-6435-2-git-send-email-roretzla@linux.microsoft.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1680567118-6435-1-git-send-email-roretzla@linux.microsoft.com>",
        "References": "<1669241687-18810-1-git-send-email-roretzla@linux.microsoft.com>\n <1680567118-6435-1-git-send-email-roretzla@linux.microsoft.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Move the following inline functions from rte_common.h to rte_bitops.h\n\n  rte_combine32ms1b\n  rte_combine64ms1b\n  rte_bsf32\n  rte_bsf32_safe\n  rte_bsf64\n  rte_bsf64_safe\n  rte_fls_u32\n  rte_fls_u64\n  rte_is_power_of_2\n  rte_align32pow2\n  rte_align32prevpow2\n  rte_align64pow2\n  rte_align64prevpow2\n  rte_log2_u32\n  rte_log2_u64\n\nSigned-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\nAcked-by: Ferruh Yigit <ferruh.yigit@amd.com>\nAcked-by: Morten Brørup <mb@smartsharesystems.com>\nAcked-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n app/test/test_common.c                   |   1 +\n lib/eal/common/rte_reciprocal.c          |   1 +\n lib/eal/include/rte_bitops.h             | 292 ++++++++++++++++++++++++++++++\n lib/eal/include/rte_common.h             | 293 -------------------------------\n lib/pipeline/rte_swx_pipeline_internal.h |   1 +\n 5 files changed, 295 insertions(+), 293 deletions(-)",
    "diff": "diff --git a/app/test/test_common.c b/app/test/test_common.c\nindex f89e1eb..cf4a2c7 100644\n--- a/app/test/test_common.c\n+++ b/app/test/test_common.c\n@@ -7,6 +7,7 @@\n #include <string.h>\n #include <math.h>\n #include <rte_common.h>\n+#include <rte_bitops.h>\n #include <rte_hexdump.h>\n #include <rte_pause.h>\n \ndiff --git a/lib/eal/common/rte_reciprocal.c b/lib/eal/common/rte_reciprocal.c\nindex 42dfa44..d47dc47 100644\n--- a/lib/eal/common/rte_reciprocal.c\n+++ b/lib/eal/common/rte_reciprocal.c\n@@ -8,6 +8,7 @@\n #include <stdint.h>\n \n #include <rte_common.h>\n+#include <rte_bitops.h>\n \n #include \"rte_reciprocal.h\"\n \ndiff --git a/lib/eal/include/rte_bitops.h b/lib/eal/include/rte_bitops.h\nindex f50dbe4..531479e 100644\n--- a/lib/eal/include/rte_bitops.h\n+++ b/lib/eal/include/rte_bitops.h\n@@ -275,6 +275,298 @@\n \treturn val & mask;\n }\n \n+/**\n+ * Combines 32b inputs most significant set bits into the least\n+ * significant bits to construct a value with the same MSBs as x\n+ * but all 1's under it.\n+ *\n+ * @param x\n+ *    The integer whose MSBs need to be combined with its LSBs\n+ * @return\n+ *    The combined value.\n+ */\n+static inline uint32_t\n+rte_combine32ms1b(uint32_t x)\n+{\n+\tx |= x >> 1;\n+\tx |= x >> 2;\n+\tx |= x >> 4;\n+\tx |= x >> 8;\n+\tx |= x >> 16;\n+\n+\treturn x;\n+}\n+\n+/**\n+ * Combines 64b inputs most significant set bits into the least\n+ * significant bits to construct a value with the same MSBs as x\n+ * but all 1's under it.\n+ *\n+ * @param v\n+ *    The integer whose MSBs need to be combined with its LSBs\n+ * @return\n+ *    The combined value.\n+ */\n+static inline uint64_t\n+rte_combine64ms1b(uint64_t v)\n+{\n+\tv |= v >> 1;\n+\tv |= v >> 2;\n+\tv |= v >> 4;\n+\tv |= v >> 8;\n+\tv |= v >> 16;\n+\tv |= v >> 32;\n+\n+\treturn v;\n+}\n+\n+/**\n+ * Searches the input parameter for the least significant set bit\n+ * (starting from zero).\n+ * If a least significant 1 bit is found, its bit index is returned.\n+ * If the content of the input parameter is zero, then the content of the return\n+ * value is undefined.\n+ * @param v\n+ *     input parameter, should not be zero.\n+ * @return\n+ *     least significant set bit in the input parameter.\n+ */\n+static inline uint32_t\n+rte_bsf32(uint32_t v)\n+{\n+\treturn (uint32_t)__builtin_ctz(v);\n+}\n+\n+/**\n+ * Searches the input parameter for the least significant set bit\n+ * (starting from zero). Safe version (checks for input parameter being zero).\n+ *\n+ * @warning ``pos`` must be a valid pointer. It is not checked!\n+ *\n+ * @param v\n+ *     The input parameter.\n+ * @param pos\n+ *     If ``v`` was not 0, this value will contain position of least significant\n+ *     bit within the input parameter.\n+ * @return\n+ *     Returns 0 if ``v`` was 0, otherwise returns 1.\n+ */\n+static inline int\n+rte_bsf32_safe(uint32_t v, uint32_t *pos)\n+{\n+\tif (v == 0)\n+\t\treturn 0;\n+\n+\t*pos = rte_bsf32(v);\n+\treturn 1;\n+}\n+\n+/**\n+ * Searches the input parameter for the least significant set bit\n+ * (starting from zero).\n+ * If a least significant 1 bit is found, its bit index is returned.\n+ * If the content of the input parameter is zero, then the content of the return\n+ * value is undefined.\n+ * @param v\n+ *     input parameter, should not be zero.\n+ * @return\n+ *     least significant set bit in the input parameter.\n+ */\n+static inline uint32_t\n+rte_bsf64(uint64_t v)\n+{\n+\treturn (uint32_t)__builtin_ctzll(v);\n+}\n+\n+/**\n+ * Searches the input parameter for the least significant set bit\n+ * (starting from zero). Safe version (checks for input parameter being zero).\n+ *\n+ * @warning ``pos`` must be a valid pointer. It is not checked!\n+ *\n+ * @param v\n+ *     The input parameter.\n+ * @param pos\n+ *     If ``v`` was not 0, this value will contain position of least significant\n+ *     bit within the input parameter.\n+ * @return\n+ *     Returns 0 if ``v`` was 0, otherwise returns 1.\n+ */\n+static inline int\n+rte_bsf64_safe(uint64_t v, uint32_t *pos)\n+{\n+\tif (v == 0)\n+\t\treturn 0;\n+\n+\t*pos = rte_bsf64(v);\n+\treturn 1;\n+}\n+\n+/**\n+ * Return the last (most-significant) bit set.\n+ *\n+ * @note The last (most significant) bit is at position 32.\n+ * @note rte_fls_u32(0) = 0, rte_fls_u32(1) = 1, rte_fls_u32(0x80000000) = 32\n+ *\n+ * @param x\n+ *     The input parameter.\n+ * @return\n+ *     The last (most-significant) bit set, or 0 if the input is 0.\n+ */\n+static inline uint32_t\n+rte_fls_u32(uint32_t x)\n+{\n+\treturn (x == 0) ? 0 : 32 - __builtin_clz(x);\n+}\n+\n+/**\n+ * Return the last (most-significant) bit set.\n+ *\n+ * @note The last (most significant) bit is at position 64.\n+ * @note rte_fls_u64(0) = 0, rte_fls_u64(1) = 1,\n+ *       rte_fls_u64(0x8000000000000000) = 64\n+ *\n+ * @param x\n+ *     The input parameter.\n+ * @return\n+ *     The last (most-significant) bit set, or 0 if the input is 0.\n+ */\n+static inline uint32_t\n+rte_fls_u64(uint64_t x)\n+{\n+\treturn (x == 0) ? 0 : 64 - __builtin_clzll(x);\n+}\n+\n+/*********** Macros to work with powers of 2 ********/\n+\n+/**\n+ * Macro to return 1 if n is a power of 2, 0 otherwise\n+ */\n+#define RTE_IS_POWER_OF_2(n) ((n) && !(((n) - 1) & (n)))\n+\n+/**\n+ * Returns true if n is a power of 2\n+ * @param n\n+ *     Number to check\n+ * @return 1 if true, 0 otherwise\n+ */\n+static inline int\n+rte_is_power_of_2(uint32_t n)\n+{\n+\treturn n && !(n & (n - 1));\n+}\n+\n+/**\n+ * Aligns input parameter to the next power of 2\n+ *\n+ * @param x\n+ *   The integer value to align\n+ *\n+ * @return\n+ *   Input parameter aligned to the next power of 2\n+ */\n+static inline uint32_t\n+rte_align32pow2(uint32_t x)\n+{\n+\tx--;\n+\tx = rte_combine32ms1b(x);\n+\n+\treturn x + 1;\n+}\n+\n+/**\n+ * Aligns input parameter to the previous power of 2\n+ *\n+ * @param x\n+ *   The integer value to align\n+ *\n+ * @return\n+ *   Input parameter aligned to the previous power of 2\n+ */\n+static inline uint32_t\n+rte_align32prevpow2(uint32_t x)\n+{\n+\tx = rte_combine32ms1b(x);\n+\n+\treturn x - (x >> 1);\n+}\n+\n+/**\n+ * Aligns 64b input parameter to the next power of 2\n+ *\n+ * @param v\n+ *   The 64b value to align\n+ *\n+ * @return\n+ *   Input parameter aligned to the next power of 2\n+ */\n+static inline uint64_t\n+rte_align64pow2(uint64_t v)\n+{\n+\tv--;\n+\tv = rte_combine64ms1b(v);\n+\n+\treturn v + 1;\n+}\n+\n+/**\n+ * Aligns 64b input parameter to the previous power of 2\n+ *\n+ * @param v\n+ *   The 64b value to align\n+ *\n+ * @return\n+ *   Input parameter aligned to the previous power of 2\n+ */\n+static inline uint64_t\n+rte_align64prevpow2(uint64_t v)\n+{\n+\tv = rte_combine64ms1b(v);\n+\n+\treturn v - (v >> 1);\n+}\n+\n+/**\n+ * Return the rounded-up log2 of a integer.\n+ *\n+ * @note Contrary to the logarithm mathematical operation,\n+ * rte_log2_u32(0) == 0 and not -inf.\n+ *\n+ * @param v\n+ *     The input parameter.\n+ * @return\n+ *     The rounded-up log2 of the input, or 0 if the input is 0.\n+ */\n+static inline uint32_t\n+rte_log2_u32(uint32_t v)\n+{\n+\tif (v == 0)\n+\t\treturn 0;\n+\tv = rte_align32pow2(v);\n+\treturn rte_bsf32(v);\n+}\n+\n+/**\n+ * Return the rounded-up log2 of a 64-bit integer.\n+ *\n+ * @note Contrary to the logarithm mathematical operation,\n+ * rte_log2_u64(0) == 0 and not -inf.\n+ *\n+ * @param v\n+ *     The input parameter.\n+ * @return\n+ *     The rounded-up log2 of the input, or 0 if the input is 0.\n+ */\n+static inline uint32_t\n+rte_log2_u64(uint64_t v)\n+{\n+\tif (v == 0)\n+\t\treturn 0;\n+\tv = rte_align64pow2(v);\n+\t/* we checked for v being 0 already, so no undefined behavior */\n+\treturn rte_bsf64(v);\n+}\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h\nindex 15765b4..c5ad69c 100644\n--- a/lib/eal/include/rte_common.h\n+++ b/lib/eal/include/rte_common.h\n@@ -471,140 +471,6 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)\n /** Marker for 8B alignment in a structure. */\n __extension__ typedef uint64_t RTE_MARKER64[0];\n \n-/**\n- * Combines 32b inputs most significant set bits into the least\n- * significant bits to construct a value with the same MSBs as x\n- * but all 1's under it.\n- *\n- * @param x\n- *    The integer whose MSBs need to be combined with its LSBs\n- * @return\n- *    The combined value.\n- */\n-static inline uint32_t\n-rte_combine32ms1b(uint32_t x)\n-{\n-\tx |= x >> 1;\n-\tx |= x >> 2;\n-\tx |= x >> 4;\n-\tx |= x >> 8;\n-\tx |= x >> 16;\n-\n-\treturn x;\n-}\n-\n-/**\n- * Combines 64b inputs most significant set bits into the least\n- * significant bits to construct a value with the same MSBs as x\n- * but all 1's under it.\n- *\n- * @param v\n- *    The integer whose MSBs need to be combined with its LSBs\n- * @return\n- *    The combined value.\n- */\n-static inline uint64_t\n-rte_combine64ms1b(uint64_t v)\n-{\n-\tv |= v >> 1;\n-\tv |= v >> 2;\n-\tv |= v >> 4;\n-\tv |= v >> 8;\n-\tv |= v >> 16;\n-\tv |= v >> 32;\n-\n-\treturn v;\n-}\n-\n-/*********** Macros to work with powers of 2 ********/\n-\n-/**\n- * Macro to return 1 if n is a power of 2, 0 otherwise\n- */\n-#define RTE_IS_POWER_OF_2(n) ((n) && !(((n) - 1) & (n)))\n-\n-/**\n- * Returns true if n is a power of 2\n- * @param n\n- *     Number to check\n- * @return 1 if true, 0 otherwise\n- */\n-static inline int\n-rte_is_power_of_2(uint32_t n)\n-{\n-\treturn n && !(n & (n - 1));\n-}\n-\n-/**\n- * Aligns input parameter to the next power of 2\n- *\n- * @param x\n- *   The integer value to align\n- *\n- * @return\n- *   Input parameter aligned to the next power of 2\n- */\n-static inline uint32_t\n-rte_align32pow2(uint32_t x)\n-{\n-\tx--;\n-\tx = rte_combine32ms1b(x);\n-\n-\treturn x + 1;\n-}\n-\n-/**\n- * Aligns input parameter to the previous power of 2\n- *\n- * @param x\n- *   The integer value to align\n- *\n- * @return\n- *   Input parameter aligned to the previous power of 2\n- */\n-static inline uint32_t\n-rte_align32prevpow2(uint32_t x)\n-{\n-\tx = rte_combine32ms1b(x);\n-\n-\treturn x - (x >> 1);\n-}\n-\n-/**\n- * Aligns 64b input parameter to the next power of 2\n- *\n- * @param v\n- *   The 64b value to align\n- *\n- * @return\n- *   Input parameter aligned to the next power of 2\n- */\n-static inline uint64_t\n-rte_align64pow2(uint64_t v)\n-{\n-\tv--;\n-\tv = rte_combine64ms1b(v);\n-\n-\treturn v + 1;\n-}\n-\n-/**\n- * Aligns 64b input parameter to the previous power of 2\n- *\n- * @param v\n- *   The 64b value to align\n- *\n- * @return\n- *   Input parameter aligned to the previous power of 2\n- */\n-static inline uint64_t\n-rte_align64prevpow2(uint64_t v)\n-{\n-\tv = rte_combine64ms1b(v);\n-\n-\treturn v - (v >> 1);\n-}\n-\n /*********** Macros for calculating min and max **********/\n \n /**\n@@ -629,165 +495,6 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)\n \n /*********** Other general functions / macros ********/\n \n-/**\n- * Searches the input parameter for the least significant set bit\n- * (starting from zero).\n- * If a least significant 1 bit is found, its bit index is returned.\n- * If the content of the input parameter is zero, then the content of the return\n- * value is undefined.\n- * @param v\n- *     input parameter, should not be zero.\n- * @return\n- *     least significant set bit in the input parameter.\n- */\n-static inline uint32_t\n-rte_bsf32(uint32_t v)\n-{\n-\treturn (uint32_t)__builtin_ctz(v);\n-}\n-\n-/**\n- * Searches the input parameter for the least significant set bit\n- * (starting from zero). Safe version (checks for input parameter being zero).\n- *\n- * @warning ``pos`` must be a valid pointer. It is not checked!\n- *\n- * @param v\n- *     The input parameter.\n- * @param pos\n- *     If ``v`` was not 0, this value will contain position of least significant\n- *     bit within the input parameter.\n- * @return\n- *     Returns 0 if ``v`` was 0, otherwise returns 1.\n- */\n-static inline int\n-rte_bsf32_safe(uint32_t v, uint32_t *pos)\n-{\n-\tif (v == 0)\n-\t\treturn 0;\n-\n-\t*pos = rte_bsf32(v);\n-\treturn 1;\n-}\n-\n-/**\n- * Return the rounded-up log2 of a integer.\n- *\n- * @note Contrary to the logarithm mathematical operation,\n- * rte_log2_u32(0) == 0 and not -inf.\n- *\n- * @param v\n- *     The input parameter.\n- * @return\n- *     The rounded-up log2 of the input, or 0 if the input is 0.\n- */\n-static inline uint32_t\n-rte_log2_u32(uint32_t v)\n-{\n-\tif (v == 0)\n-\t\treturn 0;\n-\tv = rte_align32pow2(v);\n-\treturn rte_bsf32(v);\n-}\n-\n-\n-/**\n- * Return the last (most-significant) bit set.\n- *\n- * @note The last (most significant) bit is at position 32.\n- * @note rte_fls_u32(0) = 0, rte_fls_u32(1) = 1, rte_fls_u32(0x80000000) = 32\n- *\n- * @param x\n- *     The input parameter.\n- * @return\n- *     The last (most-significant) bit set, or 0 if the input is 0.\n- */\n-static inline uint32_t\n-rte_fls_u32(uint32_t x)\n-{\n-\treturn (x == 0) ? 0 : 32 - __builtin_clz(x);\n-}\n-\n-/**\n- * Searches the input parameter for the least significant set bit\n- * (starting from zero).\n- * If a least significant 1 bit is found, its bit index is returned.\n- * If the content of the input parameter is zero, then the content of the return\n- * value is undefined.\n- * @param v\n- *     input parameter, should not be zero.\n- * @return\n- *     least significant set bit in the input parameter.\n- */\n-static inline uint32_t\n-rte_bsf64(uint64_t v)\n-{\n-\treturn (uint32_t)__builtin_ctzll(v);\n-}\n-\n-/**\n- * Searches the input parameter for the least significant set bit\n- * (starting from zero). Safe version (checks for input parameter being zero).\n- *\n- * @warning ``pos`` must be a valid pointer. It is not checked!\n- *\n- * @param v\n- *     The input parameter.\n- * @param pos\n- *     If ``v`` was not 0, this value will contain position of least significant\n- *     bit within the input parameter.\n- * @return\n- *     Returns 0 if ``v`` was 0, otherwise returns 1.\n- */\n-static inline int\n-rte_bsf64_safe(uint64_t v, uint32_t *pos)\n-{\n-\tif (v == 0)\n-\t\treturn 0;\n-\n-\t*pos = rte_bsf64(v);\n-\treturn 1;\n-}\n-\n-/**\n- * Return the last (most-significant) bit set.\n- *\n- * @note The last (most significant) bit is at position 64.\n- * @note rte_fls_u64(0) = 0, rte_fls_u64(1) = 1,\n- *       rte_fls_u64(0x8000000000000000) = 64\n- *\n- * @param x\n- *     The input parameter.\n- * @return\n- *     The last (most-significant) bit set, or 0 if the input is 0.\n- */\n-static inline uint32_t\n-rte_fls_u64(uint64_t x)\n-{\n-\treturn (x == 0) ? 0 : 64 - __builtin_clzll(x);\n-}\n-\n-/**\n- * Return the rounded-up log2 of a 64-bit integer.\n- *\n- * @note Contrary to the logarithm mathematical operation,\n- * rte_log2_u64(0) == 0 and not -inf.\n- *\n- * @param v\n- *     The input parameter.\n- * @return\n- *     The rounded-up log2 of the input, or 0 if the input is 0.\n- */\n-static inline uint32_t\n-rte_log2_u64(uint64_t v)\n-{\n-\tif (v == 0)\n-\t\treturn 0;\n-\tv = rte_align64pow2(v);\n-\t/* we checked for v being 0 already, so no undefined behavior */\n-\treturn rte_bsf64(v);\n-}\n-\n #ifndef offsetof\n /** Return the offset of a field in a structure. */\n #define offsetof(TYPE, MEMBER)  __builtin_offsetof (TYPE, MEMBER)\ndiff --git a/lib/pipeline/rte_swx_pipeline_internal.h b/lib/pipeline/rte_swx_pipeline_internal.h\nindex 2f24e1a..a67b6e9 100644\n--- a/lib/pipeline/rte_swx_pipeline_internal.h\n+++ b/lib/pipeline/rte_swx_pipeline_internal.h\n@@ -8,6 +8,7 @@\n #include <string.h>\n #include <sys/queue.h>\n \n+#include <rte_bitops.h>\n #include <rte_byteorder.h>\n #include <rte_common.h>\n #include <rte_cycles.h>\n",
    "prefixes": [
        "v8",
        "1/3"
    ]
}