Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/48653/?format=api
http://patchwork.dpdk.org/api/patches/48653/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/e45a0cd3276537ce1d52b937bd2d08db9c4a348e.1544550999.git.anatoly.burakov@intel.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": "<e45a0cd3276537ce1d52b937bd2d08db9c4a348e.1544550999.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/e45a0cd3276537ce1d52b937bd2d08db9c4a348e.1544550999.git.anatoly.burakov@intel.com", "date": "2018-12-11T17:57:11", "name": "[3/6] common: add missing implementations", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "778ff385d111b2de76c18c9ec1c0554bbf415e84", "submitter": { "id": 4, "url": "http://patchwork.dpdk.org/api/people/4/?format=api", "name": "Anatoly Burakov", "email": "anatoly.burakov@intel.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/e45a0cd3276537ce1d52b937bd2d08db9c4a348e.1544550999.git.anatoly.burakov@intel.com/mbox/", "series": [ { "id": 2733, "url": "http://patchwork.dpdk.org/api/series/2733/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=2733", "date": "2018-12-11T17:57:12", "name": "[1/6] bitmap: remove deprecated bsf64 function", "version": 1, "mbox": "http://patchwork.dpdk.org/series/2733/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/48653/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/48653/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 E66CA1B107;\n\tTue, 11 Dec 2018 18:57:37 +0100 (CET)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id A6F926904\n\tfor <dev@dpdk.org>; Tue, 11 Dec 2018 18:57:32 +0100 (CET)", "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t11 Dec 2018 09:57:31 -0800", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga005.jf.intel.com with ESMTP; 11 Dec 2018 09:57:30 -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\twBBHvTYX014324; Tue, 11 Dec 2018 17:57:29 GMT", "from sivswdev05.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev05.ir.intel.com with ESMTP id wBBHvTga024655;\n\tTue, 11 Dec 2018 17:57:29 GMT", "(from aburakov@localhost)\n\tby sivswdev05.ir.intel.com with LOCAL id wBBHvTmO024651;\n\tTue, 11 Dec 2018 17:57:29 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,343,1539673200\"; d=\"scan'208\";a=\"282756745\"", "From": "Anatoly Burakov <anatoly.burakov@intel.com>", "To": "dev@dpdk.org", "Cc": "thomas@monjalon.net, jasvinder.singh@intel.com,\n\tcristian.dumitrescu@intel.com, jerin.jacob@caviumnetworks.com", "Date": "Tue, 11 Dec 2018 17:57:11 +0000", "Message-Id": "<e45a0cd3276537ce1d52b937bd2d08db9c4a348e.1544550999.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": [ "<1cf22c82b6ca7561966be674afb8a02add0913b9.1544550999.git.anatoly.burakov@intel.com>", "<1cf22c82b6ca7561966be674afb8a02add0913b9.1544550999.git.anatoly.burakov@intel.com>" ], "References": [ "<1cf22c82b6ca7561966be674afb8a02add0913b9.1544550999.git.anatoly.burakov@intel.com>", "<1cf22c82b6ca7561966be674afb8a02add0913b9.1544550999.git.anatoly.burakov@intel.com>" ], "Subject": "[dpdk-dev] [PATCH 3/6] common: add missing implementations", "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": "Implement missing functions for 32-bit safe bsf, as well as 64-bit\nfls and log2.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n\nNotes:\n v4:\n - Fixed to use proper rte_bsf64\n \n v3:\n - Added clarification that pos is not checked\n\n lib/librte_eal/common/include/rte_common.h | 62 +++++++++++++++++++++-\n 1 file changed, 61 insertions(+), 1 deletion(-)", "diff": "diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h\nindex 2735dcca7..4bbfef7a0 100644\n--- a/lib/librte_eal/common/include/rte_common.h\n+++ b/lib/librte_eal/common/include/rte_common.h\n@@ -447,6 +447,30 @@ rte_bsf32(uint32_t v)\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(uint64_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@@ -464,7 +488,6 @@ rte_log2_u32(uint32_t v)\n \treturn rte_bsf32(v);\n }\n \n-\n /**\n * Return the last (most-significant) bit set.\n *\n@@ -523,6 +546,43 @@ rte_bsf64_safe(uint64_t v, uint32_t *pos)\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 int\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+ * @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+\n #ifndef offsetof\n /** Return the offset of a field in a structure. */\n #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)\n", "prefixes": [ "3/6" ] }{ "id": 48653, "url": "