get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 27780,
    "url": "http://patches.dpdk.org/api/patches/27780/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20170823141213.25476-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": "<20170823141213.25476-10-shreyansh.jain@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20170823141213.25476-10-shreyansh.jain@nxp.com",
    "date": "2017-08-23T14:11:42",
    "name": "[dpdk-dev,v3,09/40] bus/dpaa: add routines for managing a RB tree",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "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": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20170823141213.25476-10-shreyansh.jain@nxp.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/27780/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/27780/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id E3C699125;\n\tWed, 23 Aug 2017 16:02:51 +0200 (CEST)",
            "from NAM02-CY1-obe.outbound.protection.outlook.com\n\t(mail-cys01nam02on0041.outbound.protection.outlook.com\n\t[104.47.37.41]) by dpdk.org (Postfix) with ESMTP id A98DE90F8\n\tfor <dev@dpdk.org>; Wed, 23 Aug 2017 16:02:48 +0200 (CEST)",
            "from CY1PR03CA0035.namprd03.prod.outlook.com (10.174.128.45) by\n\tCY1PR03MB2267.namprd03.prod.outlook.com (10.166.207.19) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id\n\t15.1.1362.18; Wed, 23 Aug 2017 14:02:47 +0000",
            "from BN1AFFO11FD035.protection.gbl (2a01:111:f400:7c10::129) by\n\tCY1PR03CA0035.outlook.office365.com (2603:10b6:600::45) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id\n\t15.1.1362.18 via Frontend Transport; Wed, 23 Aug 2017 14:02:47 +0000",
            "from tx30smr01.am.freescale.net (192.88.168.50) by\n\tBN1AFFO11FD035.mail.protection.outlook.com (10.58.52.159) with\n\tMicrosoft SMTP Server (version=TLS1_0,\n\tcipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15\n\tvia Frontend Transport; Wed, 23 Aug 2017 14:02:46 +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\tv7NE2Q2t004389; Wed, 23 Aug 2017 07:02:44 -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": "Wed, 23 Aug 2017 19:41:42 +0530",
        "Message-ID": "<20170823141213.25476-10-shreyansh.jain@nxp.com>",
        "X-Mailer": "git-send-email 2.9.3",
        "In-Reply-To": "<20170823141213.25476-1-shreyansh.jain@nxp.com>",
        "References": "<1499179471-19145-1-git-send-email-shreyansh.jain@nxp.com>\n\t<20170823141213.25476-1-shreyansh.jain@nxp.com>",
        "X-EOPAttributedMessage": "0",
        "X-Matching-Connectors": "131479705672367290;\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)(6916009)(1076002)(36756003)(104016004)(47776003)(86362001)(2906002)(2950100002)(77096006)(50226002)(5003940100001)(50986999)(189998001)(97736004)(33646002)(498600001)(48376002)(54906002)(81156014)(81166006)(5660300001)(76176999)(53936002)(85426001)(4326008)(8676002)(8936002)(50466002)(356003)(8656003)(106466001)(105606002)(2351001)(110136004)(626005)(68736007)(305945005);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2267;\n\tH:tx30smr01.am.freescale.net; \n\tFPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; ",
        "X-Microsoft-Exchange-Diagnostics": [
            "1; BN1AFFO11FD035;\n\t1:j2PEqtp3GHatnaP01yOJGJP6aClWQmW8JM1DhSv8vduA6OWfT55Bd36EOEcm9CWN7+Hzlw7gCxUxGLp4fHxZ8riMFmCsQw2wbSp7AuzITylizsKBVJBEadOm+jmju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QzSiUzC58/cWGAsH3vQe9K8HnuSFS1+ge4jQu6RV99dV/0F/J00G+U/QVwkqIHJRVwCHnUYxB0Nwos+II/eNDPyBt5mNUNYMbswHvZcUrg8fYRfPcrJfohdEphWUCRXEkpjWsbSZnVdmpihU+uzgjOEvQ7ZIzD0q5PCkJqAKE8="
        ],
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "c712b414-2e8c-4772-db59-08d4ea2fa23a",
        "X-Microsoft-Antispam": "UriScan:; BCL:0; PCL:0;\n\tRULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603185)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);\n\tSRVR:CY1PR03MB2267; ",
        "X-MS-TrafficTypeDiagnostic": "CY1PR03MB2267:",
        "X-Exchange-Antispam-Report-Test": "UriScan:(185117386973197);",
        "X-Microsoft-Antispam-PRVS": "<CY1PR03MB22673DDDBD247AFD3B96338790850@CY1PR03MB2267.namprd03.prod.outlook.com>",
        "X-Exchange-Antispam-Report-CFA-Test": "BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(13018025)(5005006)(13016025)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123559100)(20161123563025)(20161123556025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123561025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:CY1PR03MB2267; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:CY1PR03MB2267; ",
        "X-Forefront-PRVS": "040866B734",
        "SpamDiagnosticOutput": "1:99",
        "SpamDiagnosticMetadata": "NSPM",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "23 Aug 2017 14:02:46.9247\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": "CY1PR03MB2267",
        "Subject": "[dpdk-dev] [PATCH v3 09/40] 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",
        "v3",
        "09/40"
    ]
}