get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 49184,
    "url": "http://patches.dpdk.org/api/patches/49184/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/d455cefa511345994a46994c248c5f5c9ee08a1c.1545307762.git.anatoly.burakov@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.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": "<d455cefa511345994a46994c248c5f5c9ee08a1c.1545307762.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/d455cefa511345994a46994c248c5f5c9ee08a1c.1545307762.git.anatoly.burakov@intel.com",
    "date": "2018-12-20T12:09:50",
    "name": "[v2,4/4] common: add 64-bit log2 function",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "4e23158e63313ed62daaf883555ba2212a499f91",
    "submitter": {
        "id": 4,
        "url": "http://patches.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/d455cefa511345994a46994c248c5f5c9ee08a1c.1545307762.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 2897,
            "url": "http://patches.dpdk.org/api/series/2897/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=2897",
            "date": "2018-12-20T12:09:48",
            "name": "[v2,1/4] bitmap: remove deprecated bsf64 function",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/2897/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/49184/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/49184/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 6873D1BCB7;\n\tThu, 20 Dec 2018 13:10:07 +0100 (CET)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 23D751BCA3\n\tfor <dev@dpdk.org>; Thu, 20 Dec 2018 13:10:01 +0100 (CET)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t20 Dec 2018 04:10:00 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga005.jf.intel.com with ESMTP; 20 Dec 2018 04:09:57 -0800",
            "from sivswdev05.ir.intel.com (sivswdev05.ir.intel.com\n\t[10.243.17.64])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\twBKC9vif014139; Thu, 20 Dec 2018 12:09:57 GMT",
            "from sivswdev05.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev05.ir.intel.com with ESMTP id wBKC9vO2001206;\n\tThu, 20 Dec 2018 12:09:57 GMT",
            "(from aburakov@localhost)\n\tby sivswdev05.ir.intel.com with LOCAL id wBKC9uSb001202;\n\tThu, 20 Dec 2018 12:09:57 GMT"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.56,376,1539673200\"; d=\"scan'208\";a=\"285260242\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, \n\tBernard Iremonger <bernard.iremonger@intel.com>,\n\tjerin.jacob@caviumnetworks.com, thomas@monjalon.net",
        "Date": "Thu, 20 Dec 2018 12:09:50 +0000",
        "Message-Id": "<d455cefa511345994a46994c248c5f5c9ee08a1c.1545307762.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": [
            "<ec15434d0c3ac3c9c0f6d89a865120b29bb6737a.1545307762.git.anatoly.burakov@intel.com>",
            "<1cf22c82b6ca7561966be674afb8a02add0913b9.1544550999.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<ec15434d0c3ac3c9c0f6d89a865120b29bb6737a.1545307762.git.anatoly.burakov@intel.com>",
            "<1cf22c82b6ca7561966be674afb8a02add0913b9.1544550999.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v2 4/4] common: add 64-bit log2 function",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Add missing implementation for 64-bit log2 function, and extend\nthe unit test to test this new function. Also, remove duplicate\nreimplementation of this function from testpmd and memalloc.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n app/test-pmd/testpmd.c                     | 17 +----------------\n lib/librte_eal/common/include/rte_common.h | 18 ++++++++++++++++++\n lib/librte_eal/linuxapp/eal/eal_memalloc.c | 17 +----------------\n test/test/test_common.c                    | 20 +++++++++++++++++++-\n 4 files changed, 39 insertions(+), 33 deletions(-)",
    "diff": "diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex a10bc40bb..8d584b008 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -649,28 +649,13 @@ calc_mem_size(uint32_t nb_mbufs, uint32_t mbuf_sz, size_t pgsz, size_t *out)\n \treturn 0;\n }\n \n-static inline uint32_t\n-bsf64(uint64_t v)\n-{\n-\treturn (uint32_t)__builtin_ctzll(v);\n-}\n-\n-static inline uint32_t\n-log2_u64(uint64_t v)\n-{\n-\tif (v == 0)\n-\t\treturn 0;\n-\tv = rte_align64pow2(v);\n-\treturn bsf64(v);\n-}\n-\n static int\n pagesz_flags(uint64_t page_sz)\n {\n \t/* as per mmap() manpage, all page sizes are log2 of page size\n \t * shifted by MAP_HUGE_SHIFT\n \t */\n-\tint log2 = log2_u64(page_sz);\n+\tint log2 = rte_log2_u64(page_sz);\n \n \treturn (log2 << HUGE_SHIFT);\n }\ndiff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h\nindex 7b50b8479..7178ba1e9 100644\n--- a/lib/librte_eal/common/include/rte_common.h\n+++ b/lib/librte_eal/common/include/rte_common.h\n@@ -565,6 +565,24 @@ rte_fls_u64(uint64_t x)\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+ * @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/librte_eal/linuxapp/eal/eal_memalloc.c b/lib/librte_eal/linuxapp/eal/eal_memalloc.c\nindex 784939566..6e6af5b06 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_memalloc.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_memalloc.c\n@@ -208,28 +208,13 @@ get_file_size(int fd)\n \treturn st.st_size;\n }\n \n-static inline uint32_t\n-bsf64(uint64_t v)\n-{\n-\treturn (uint32_t)__builtin_ctzll(v);\n-}\n-\n-static inline uint32_t\n-log2_u64(uint64_t v)\n-{\n-\tif (v == 0)\n-\t\treturn 0;\n-\tv = rte_align64pow2(v);\n-\treturn bsf64(v);\n-}\n-\n static int\n pagesz_flags(uint64_t page_sz)\n {\n \t/* as per mmap() manpage, all page sizes are log2 of page size\n \t * shifted by MAP_HUGE_SHIFT\n \t */\n-\tint log2 = log2_u64(page_sz);\n+\tint log2 = rte_log2_u64(page_sz);\n \treturn log2 << RTE_MAP_HUGE_SHIFT;\n }\n \ndiff --git a/test/test/test_common.c b/test/test/test_common.c\nindex f6dd4c18d..94d367471 100644\n--- a/test/test/test_common.c\n+++ b/test/test/test_common.c\n@@ -213,13 +213,31 @@ test_log2(void)\n \tconst uint32_t step = 1;\n \n \tfor (i = 0; i < max; i = i + step) {\n+\t\tuint64_t i64;\n+\n+\t\t/* extend range for 64-bit */\n+\t\ti64 = (uint64_t)i << 32;\n+\t\tbase = (uint32_t)ceilf(log2(i64));\n+\t\tcompare = rte_log2_u64(i64);\n+\t\tif (base != compare) {\n+\t\t\tprintf(\"Wrong rte_log2_u64(%\" PRIx64 \") val %x, expected %x\\n\",\n+\t\t\t\ti64, compare, base);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\n \t\tbase = (uint32_t)ceilf(log2((uint32_t)i));\n-\t\tcompare = rte_log2_u32(i);\n+\t\tcompare = rte_log2_u32((uint32_t)i);\n \t\tif (base != compare) {\n \t\t\tprintf(\"Wrong rte_log2_u32(%x) val %x, expected %x\\n\",\n \t\t\t\ti, compare, base);\n \t\t\treturn TEST_FAILED;\n \t\t}\n+\t\tcompare = rte_log2_u64((uint64_t)i);\n+\t\tif (base != compare) {\n+\t\t\tprintf(\"Wrong rte_log2_u64(%x) val %x, expected %x\\n\",\n+\t\t\t\ti, compare, base);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n \t}\n \treturn 0;\n }\n",
    "prefixes": [
        "v2",
        "4/4"
    ]
}