get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 84819,
    "url": "https://patches.dpdk.org/api/patches/84819/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1607446804-160076-1-git-send-email-vladimir.medvedkin@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1607446804-160076-1-git-send-email-vladimir.medvedkin@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1607446804-160076-1-git-send-email-vladimir.medvedkin@intel.com",
    "date": "2020-12-08T17:00:04",
    "name": "rib: fix undefined behavior",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "1dd6f04bfd855aaea246afa889609fbcb8551e96",
    "submitter": {
        "id": 1216,
        "url": "https://patches.dpdk.org/api/people/1216/?format=api",
        "name": "Vladimir Medvedkin",
        "email": "vladimir.medvedkin@intel.com"
    },
    "delegate": {
        "id": 24651,
        "url": "https://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1607446804-160076-1-git-send-email-vladimir.medvedkin@intel.com/mbox/",
    "series": [
        {
            "id": 14210,
            "url": "https://patches.dpdk.org/api/series/14210/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14210",
            "date": "2020-12-08T17:00:04",
            "name": "rib: fix undefined behavior",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/14210/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/84819/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/84819/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 62B3AA09E9;\n\tTue,  8 Dec 2020 18:00:41 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 91EE172D9;\n\tTue,  8 Dec 2020 18:00:39 +0100 (CET)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by dpdk.org (Postfix) with ESMTP id 7A3CD98;\n Tue,  8 Dec 2020 18:00:37 +0100 (CET)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 08 Dec 2020 09:00:35 -0800",
            "from silpixa00400072.ir.intel.com ([10.237.222.213])\n by orsmga005.jf.intel.com with ESMTP; 08 Dec 2020 09:00:33 -0800"
        ],
        "IronPort-SDR": [
            "\n 37Dq0oqBkKqs6fbXaoT5Rvgn//PPvFz34ry8XfoQXA7/UOM1jN/XUL6I+fgmQQPeW+QkngXlu9\n Y7iSdi6Qci5A==",
            "\n MNPNsqU1qWJIC9p4AwA9vFJjuUciqyuHDsshck3uL75GN+wcxenoP9mPM/8hiS5gGZjezGi5bW\n JrC/GnP6lq7Q=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9829\"; a=\"153164696\"",
            "E=Sophos;i=\"5.78,402,1599548400\"; d=\"scan'208\";a=\"153164696\"",
            "E=Sophos;i=\"5.78,402,1599548400\"; d=\"scan'208\";a=\"552289029\""
        ],
        "X-ExtLoop1": "1",
        "From": "Vladimir Medvedkin <vladimir.medvedkin@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "david.marchand@redhat.com, vladimir.medvedkin@intel.com, stable@dpdk.org",
        "Date": "Tue,  8 Dec 2020 17:00:04 +0000",
        "Message-Id": "<1607446804-160076-1-git-send-email-vladimir.medvedkin@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "Subject": "[dpdk-dev] [PATCH] rib: fix undefined behavior",
        "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 <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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "According to GCC documentation for __builtin_clz:\nReturns the number of leading 0-bits in x,\nstarting at the most significant bit position.\nIf x is 0, the result is undefined.\n__builtin_clz will be called with 0 if the existing\nprefix address matches the one we want to insert.\n\nFixes: 5a5793a5ffa2 (\"rib: add RIB library\")\nCc: vladimir.medvedkin@intel.com\nCc: stable@dpdk.org\n\nReported-by: David Marchand <david.marchand@redhat.com>\nSigned-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>\n---\n lib/librte_rib/rte_rib.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)",
    "diff": "diff --git a/lib/librte_rib/rte_rib.c b/lib/librte_rib/rte_rib.c\nindex 2a370d7..6c29e1c 100644\n--- a/lib/librte_rib/rte_rib.c\n+++ b/lib/librte_rib/rte_rib.c\n@@ -301,7 +301,7 @@ rte_rib_insert(struct rte_rib *rib, uint32_t ip, uint8_t depth)\n \t/* closest node found, new_node should be inserted in the middle */\n \tcommon_depth = RTE_MIN(depth, (*tmp)->depth);\n \tcommon_prefix = ip ^ (*tmp)->ip;\n-\td = __builtin_clz(common_prefix);\n+\td = (common_prefix == 0) ? 32 : __builtin_clz(common_prefix);\n \n \tcommon_depth = RTE_MIN(d, common_depth);\n \tcommon_prefix = ip & rte_rib_depth_to_mask(common_depth);\n",
    "prefixes": []
}