get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 28534,
    "url": "http://patches.dpdk.org/api/patches/28534/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20170909112132.13936-10-shreyansh.jain@nxp.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": "<20170909112132.13936-10-shreyansh.jain@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20170909112132.13936-10-shreyansh.jain@nxp.com",
    "date": "2017-09-09T11:21:00",
    "name": "[dpdk-dev,v4,09/41] bus/dpaa: add routines for managing a RB tree",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "b07127cf39f65f12dc156eedd6506859914a3552",
    "submitter": {
        "id": 497,
        "url": "http://patches.dpdk.org/api/people/497/?format=api",
        "name": "Shreyansh Jain",
        "email": "shreyansh.jain@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20170909112132.13936-10-shreyansh.jain@nxp.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/28534/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/28534/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 A7C331B1B7;\n\tSat,  9 Sep 2017 13:10:56 +0200 (CEST)",
            "from NAM01-SN1-obe.outbound.protection.outlook.com\n\t(mail-sn1nam01on0043.outbound.protection.outlook.com [104.47.32.43])\n\tby dpdk.org (Postfix) with ESMTP id 930D91B18C\n\tfor <dev@dpdk.org>; Sat,  9 Sep 2017 13:10:52 +0200 (CEST)",
            "from BN3PR03CA0098.namprd03.prod.outlook.com (10.174.66.16) by\n\tCY4PR03MB3317.namprd03.prod.outlook.com (10.171.246.150) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.20.13.10; Sat, 9 Sep 2017 11:10:50 +0000",
            "from BN1BFFO11FD010.protection.gbl (2a01:111:f400:7c10::1:120) by\n\tBN3PR03CA0098.outlook.office365.com (2603:10b6:400:4::16) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.20.35.12 via Frontend Transport; Sat, 9 Sep 2017 11:10:50 +0000",
            "from tx30smr01.am.freescale.net (192.88.168.50) by\n\tBN1BFFO11FD010.mail.protection.outlook.com (10.58.144.73) with\n\tMicrosoft SMTP Server (version=TLS1_0,\n\tcipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1385.11\n\tvia Frontend Transport; Sat, 9 Sep 2017 11:10:50 +0000",
            "from Tophie.ap.freescale.net ([10.232.14.39])\n\tby tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id\n\tv89BAUh9026326; Sat, 9 Sep 2017 04:10:48 -0700"
        ],
        "Authentication-Results": "spf=fail (sender IP is 192.88.168.50)\n\tsmtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed)\n\theader.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;",
        "Received-SPF": "Fail (protection.outlook.com: domain of nxp.com does not\n\tdesignate 192.88.168.50 as permitted sender)\n\treceiver=protection.outlook.com; \n\tclient-ip=192.88.168.50; helo=tx30smr01.am.freescale.net;",
        "From": "Shreyansh Jain <shreyansh.jain@nxp.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@intel.com>, <hemant.agrawal@nxp.com>",
        "Date": "Sat, 9 Sep 2017 16:51:00 +0530",
        "Message-ID": "<20170909112132.13936-10-shreyansh.jain@nxp.com>",
        "X-Mailer": "git-send-email 2.9.3",
        "In-Reply-To": "<20170909112132.13936-1-shreyansh.jain@nxp.com>",
        "References": "<20170823141213.25476-1-shreyansh.jain@nxp.com>\n\t<20170909112132.13936-1-shreyansh.jain@nxp.com>",
        "X-EOPAttributedMessage": "0",
        "X-Matching-Connectors": "131494290505480304;\n\t(91ab9b29-cfa4-454e-5278-08d120cd25b8); ()",
        "X-Forefront-Antispam-Report": "CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI;\n\tSFV:NSPM;\n\tSFS:(10009020)(6009001)(336005)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(53936002)(2906002)(8656003)(54906002)(50226002)(85426001)(1076002)(47776003)(68736007)(498600001)(36756003)(97736004)(5003940100001)(356003)(2950100002)(6666003)(33646002)(77096006)(189998001)(105606002)(50466002)(48376002)(8676002)(81156014)(81166006)(305945005)(106466001)(8936002)(6916009)(2351001)(104016004)(86362001)(110136004)(5660300001)(76176999)(50986999)(4326008);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB3317;\n\tH:tx30smr01.am.freescale.net; \n\tFPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; ",
        "X-Microsoft-Exchange-Diagnostics": [
            "1; BN1BFFO11FD010;\n\t1:uYqTDVyVb4TqTAMSmaN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5GiDQbDjZSqSS7pOaXnBXpd25LrGTI=;\n\t7:+TgRds4Wiu65FuW+vmN5QtnchQvawbYahvYaelQ4rtdLPC5PtYaF3kkLV26PauFVUGO+pJCrInj8NpUaY/CmhIhaSQJ1JcEwwqVZx2xrYIzzVOFCiP3HLghuztMWcGesB27/SfFeeFvzp7BSkHkyRgyKIOZJu/VHs1D/uk+/Nl3nz/yMi2Ui6PH2ZjZ70Eq1vv3xZQZHx0QFE4GB8+jRqiyhyXWMbEnL8NZYyTykmZo="
        ],
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "e03945b9-1542-4d4e-3870-08d4f7736e09",
        "X-Microsoft-Antispam": "UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:CY4PR03MB3317; ",
        "X-MS-TrafficTypeDiagnostic": "CY4PR03MB3317:",
        "X-Exchange-Antispam-Report-Test": "UriScan:(185117386973197);",
        "X-Microsoft-Antispam-PRVS": "<CY4PR03MB3317B5DDEEE5CD8D6C640FCC906A0@CY4PR03MB3317.namprd03.prod.outlook.com>",
        "X-Exchange-Antispam-Report-CFA-Test": "BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123563025)(20161123559100)(20161123565025)(20161123561025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123556025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:CY4PR03MB3317; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:CY4PR03MB3317; ",
        "X-Forefront-PRVS": "0425A67DEF",
        "SpamDiagnosticOutput": "1:99",
        "SpamDiagnosticMetadata": "NSPM",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "09 Sep 2017 11:10:50.2204\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-Id": "5afe0b00-7697-4969-b663-5eab37d5f47e",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;\n\tIp=[192.88.168.50]; \n\tHelo=[tx30smr01.am.freescale.net]",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "CY4PR03MB3317",
        "Subject": "[dpdk-dev] [PATCH v4 09/41] bus/dpaa: add routines for managing a\n\tRB tree",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "QMAN frames are managed over a RB tree data structure.\nThis patch introduces necessary routines for implementing a RB tree.\n\nSigned-off-by: Geoff Thorpe <geoff.thorpe@nxp.com>\nSigned-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>\nSigned-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>\n---\n drivers/bus/dpaa/include/dpaa_rbtree.h | 143 +++++++++++++++++++++++++++++++++\n 1 file changed, 143 insertions(+)\n create mode 100644 drivers/bus/dpaa/include/dpaa_rbtree.h",
    "diff": "diff --git a/drivers/bus/dpaa/include/dpaa_rbtree.h b/drivers/bus/dpaa/include/dpaa_rbtree.h\nnew file mode 100644\nindex 0000000..f8c9b59\n--- /dev/null\n+++ b/drivers/bus/dpaa/include/dpaa_rbtree.h\n@@ -0,0 +1,143 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright 2017 NXP.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of NXP nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef __DPAA_RBTREE_H\n+#define __DPAA_RBTREE_H\n+\n+#include <rte_common.h>\n+/************/\n+/* RB-trees */\n+/************/\n+\n+/* Linux has a good RB-tree implementation, that we can't use (GPL). It also has\n+ * a flat/hooked-in interface that virtually requires license-contamination in\n+ * order to write a caller-compatible implementation. Instead, I've created an\n+ * RB-tree encapsulation on top of linux's primitives (it does some of the work\n+ * the client logic would normally do), and this gives us something we can\n+ * reimplement on LWE. Unfortunately there's no good+free RB-tree\n+ * implementations out there that are license-compatible and \"flat\" (ie. no\n+ * dynamic allocation). I did find a malloc-based one that I could convert, but\n+ * that will be a task for later on. For now, LWE's RB-tree is implemented using\n+ * an ordered linked-list.\n+ *\n+ * Note, the only linux-esque type is \"struct rb_node\", because it's used\n+ * statically in the exported header, so it can't be opaque. Our version doesn't\n+ * include a \"rb_parent_color\" field because we're doing linked-list instead of\n+ * a true rb-tree.\n+ */\n+\n+struct rb_node {\n+\tstruct rb_node *prev, *next;\n+};\n+\n+struct dpa_rbtree {\n+\tstruct rb_node *head, *tail;\n+};\n+\n+#define DPAA_RBTREE { NULL, NULL }\n+static inline void dpa_rbtree_init(struct dpa_rbtree *tree)\n+{\n+\ttree->head = tree->tail = NULL;\n+}\n+\n+#define QMAN_NODE2OBJ(ptr, type, node_field) \\\n+\t(type *)((char *)ptr - offsetof(type, node_field))\n+\n+#define IMPLEMENT_DPAA_RBTREE(name, type, node_field, val_field) \\\n+static inline int name##_push(struct dpa_rbtree *tree, type *obj) \\\n+{ \\\n+\tstruct rb_node *node = tree->head; \\\n+\tif (!node) { \\\n+\t\ttree->head = tree->tail = &obj->node_field; \\\n+\t\tobj->node_field.prev = obj->node_field.next = NULL; \\\n+\t\treturn 0; \\\n+\t} \\\n+\twhile (node) { \\\n+\t\ttype *item = QMAN_NODE2OBJ(node, type, node_field); \\\n+\t\tif (obj->val_field == item->val_field) \\\n+\t\t\treturn -EBUSY; \\\n+\t\tif (obj->val_field < item->val_field) { \\\n+\t\t\tif (tree->head == node) \\\n+\t\t\t\ttree->head = &obj->node_field; \\\n+\t\t\telse \\\n+\t\t\t\tnode->prev->next = &obj->node_field; \\\n+\t\t\tobj->node_field.prev = node->prev; \\\n+\t\t\tobj->node_field.next = node; \\\n+\t\t\tnode->prev = &obj->node_field; \\\n+\t\t\treturn 0; \\\n+\t\t} \\\n+\t\tnode = node->next; \\\n+\t} \\\n+\tobj->node_field.prev = tree->tail; \\\n+\tobj->node_field.next = NULL; \\\n+\ttree->tail->next = &obj->node_field; \\\n+\ttree->tail = &obj->node_field; \\\n+\treturn 0; \\\n+} \\\n+static inline void name##_del(struct dpa_rbtree *tree, type *obj) \\\n+{ \\\n+\tif (tree->head == &obj->node_field) { \\\n+\t\tif (tree->tail == &obj->node_field) \\\n+\t\t\t/* Only item in the list */ \\\n+\t\t\ttree->head = tree->tail = NULL; \\\n+\t\telse { \\\n+\t\t\t/* Is the head, next != NULL */ \\\n+\t\t\ttree->head = tree->head->next; \\\n+\t\t\ttree->head->prev = NULL; \\\n+\t\t} \\\n+\t} else { \\\n+\t\tif (tree->tail == &obj->node_field) { \\\n+\t\t\t/* Is the tail, prev != NULL */ \\\n+\t\t\ttree->tail = tree->tail->prev; \\\n+\t\t\ttree->tail->next = NULL; \\\n+\t\t} else { \\\n+\t\t\t/* Is neither the head nor the tail */ \\\n+\t\t\tobj->node_field.prev->next = obj->node_field.next; \\\n+\t\t\tobj->node_field.next->prev = obj->node_field.prev; \\\n+\t\t} \\\n+\t} \\\n+} \\\n+static inline type *name##_find(struct dpa_rbtree *tree, u32 val) \\\n+{ \\\n+\tstruct rb_node *node = tree->head; \\\n+\twhile (node) { \\\n+\t\ttype *item = QMAN_NODE2OBJ(node, type, node_field); \\\n+\t\tif (val == item->val_field) \\\n+\t\t\treturn item; \\\n+\t\tif (val < item->val_field) \\\n+\t\t\treturn NULL; \\\n+\t\tnode = node->next; \\\n+\t} \\\n+\treturn NULL; \\\n+}\n+\n+#endif /* __DPAA_RBTREE_H */\n",
    "prefixes": [
        "dpdk-dev",
        "v4",
        "09/41"
    ]
}