get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 4869,
    "url": "https://patches.dpdk.org/api/patches/4869/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1432316931-18406-4-git-send-email-konstantin.ananyev@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": "<1432316931-18406-4-git-send-email-konstantin.ananyev@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1432316931-18406-4-git-send-email-konstantin.ananyev@intel.com",
    "date": "2015-05-22T17:48:51",
    "name": "[dpdk-dev,3/3] ACL: remove subtree_id calculations at build stage",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b1134b60c7c334ffdd5963cc681259bab08fa2d1",
    "submitter": {
        "id": 33,
        "url": "https://patches.dpdk.org/api/people/33/?format=api",
        "name": "Ananyev, Konstantin",
        "email": "konstantin.ananyev@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1432316931-18406-4-git-send-email-konstantin.ananyev@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/4869/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/4869/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 40DB1C332;\n\tFri, 22 May 2015 19:49:10 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 8CC0D5A49\n\tfor <dev@dpdk.org>; Fri, 22 May 2015 19:49:05 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga103.fm.intel.com with ESMTP; 22 May 2015 10:49:04 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga002.jf.intel.com with ESMTP; 22 May 2015 10:49:03 -0700",
            "from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com\n\t[10.237.217.46])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tt4MHn2MN025966; Fri, 22 May 2015 18:49:03 +0100",
            "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev02.ir.intel.com with ESMTP id t4MHn2X8018471;\n\tFri, 22 May 2015 18:49:02 +0100",
            "(from kananye1@localhost)\n\tby sivswdev02.ir.intel.com with  id t4MHn2s7018467;\n\tFri, 22 May 2015 18:49:02 +0100"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.13,477,1427785200\"; d=\"scan'208\";a=\"733863111\"",
        "From": "Konstantin Ananyev <konstantin.ananyev@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 22 May 2015 18:48:51 +0100",
        "Message-Id": "<1432316931-18406-4-git-send-email-konstantin.ananyev@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1432316931-18406-1-git-send-email-konstantin.ananyev@intel.com>",
        "References": "<1432316931-18406-1-git-send-email-konstantin.ananyev@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 3/3] ACL: remove subtree_id calculations at build\n\tstage",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <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": "As now subtree_id is not used acl_merge_trie() any more,\nthere is no point to calculate and maintain that information.\n\nSigned-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\n---\n lib/librte_acl/acl.h     |   7 ---\n lib/librte_acl/acl_bld.c | 119 +++++------------------------------------------\n 2 files changed, 12 insertions(+), 114 deletions(-)",
    "diff": "diff --git a/lib/librte_acl/acl.h b/lib/librte_acl/acl.h\nindex 4dadab5..eb4930c 100644\n--- a/lib/librte_acl/acl.h\n+++ b/lib/librte_acl/acl.h\n@@ -151,13 +151,6 @@ struct rte_acl_node {\n \t/* free list link or pointer to duplicate node during merge */\n \tstruct rte_acl_node     *prev;\n \t/* points to node from which this node was duplicated */\n-\n-\tuint32_t                subtree_id;\n-\tuint32_t                subtree_ref_count;\n-\n-};\n-enum {\n-\tRTE_ACL_SUBTREE_NODE = 0x80000000\n };\n \n /*\ndiff --git a/lib/librte_acl/acl_bld.c b/lib/librte_acl/acl_bld.c\nindex 92a85df..db23b7b 100644\n--- a/lib/librte_acl/acl_bld.c\n+++ b/lib/librte_acl/acl_bld.c\n@@ -117,7 +117,7 @@ struct acl_build_context {\n \n static int acl_merge_trie(struct acl_build_context *context,\n \tstruct rte_acl_node *node_a, struct rte_acl_node *node_b,\n-\tuint32_t level, uint32_t subtree_id, struct rte_acl_node **node_c);\n+\tuint32_t level, struct rte_acl_node **node_c);\n \n static int acl_merge(struct acl_build_context *context,\n \tstruct rte_acl_node *node_a, struct rte_acl_node *node_b,\n@@ -386,8 +386,8 @@ acl_gen_mask(struct rte_acl_bitset *bitset, uint32_t value, uint32_t mask)\n  * Determine if A and/or B are supersets of the intersection.\n  */\n static int\n-acl_intersect_type(struct rte_acl_bitset *a_bits,\n-\tstruct rte_acl_bitset *b_bits,\n+acl_intersect_type(const struct rte_acl_bitset *a_bits,\n+\tconst struct rte_acl_bitset *b_bits,\n \tstruct rte_acl_bitset *intersect)\n {\n \tuint32_t n;\n@@ -901,94 +901,6 @@ acl_resolve_leaf(struct acl_build_context *context,\n }\n \n /*\n-* Within the existing trie structure, determine which nodes are\n-* part of the subtree of the trie to be merged.\n-*\n-* For these purposes, a subtree is defined as the set of nodes that\n-* are 1) not a superset of the intersection with the same level of\n-* the merging tree, and 2) do not have any references from a node\n-* outside of the subtree.\n-*/\n-static void\n-mark_subtree(struct rte_acl_node *node,\n-\tstruct rte_acl_bitset *level_bits,\n-\tuint32_t level,\n-\tuint32_t id)\n-{\n-\tuint32_t n;\n-\n-\t/* mark this node as part of the subtree */\n-\tnode->subtree_id = id | RTE_ACL_SUBTREE_NODE;\n-\n-\tfor (n = 0; n < node->num_ptrs; n++) {\n-\n-\t\tif (node->ptrs[n].ptr != NULL) {\n-\n-\t\t\tstruct rte_acl_bitset intersect_bits;\n-\t\t\tint intersect;\n-\n-\t\t\t/*\n-\t\t\t* Item 1) :\n-\t\t\t* check if this child pointer is not a superset of the\n-\t\t\t* same level of the merging tree.\n-\t\t\t*/\n-\t\t\tintersect = acl_intersect_type(&node->ptrs[n].values,\n-\t\t\t\t&level_bits[level],\n-\t\t\t\t&intersect_bits);\n-\n-\t\t\tif ((intersect & ACL_INTERSECT_A) == 0) {\n-\n-\t\t\t\tstruct rte_acl_node *child = node->ptrs[n].ptr;\n-\n-\t\t\t\t/*\n-\t\t\t\t * reset subtree reference if this is\n-\t\t\t\t * the first visit by this subtree.\n-\t\t\t\t */\n-\t\t\t\tif (child->subtree_id != id) {\n-\t\t\t\t\tchild->subtree_id = id;\n-\t\t\t\t\tchild->subtree_ref_count = 0;\n-\t\t\t\t}\n-\n-\t\t\t\t/*\n-\t\t\t\t* Item 2) :\n-\t\t\t\t* increment the subtree reference count and if\n-\t\t\t\t* all references are from this subtree then\n-\t\t\t\t* recurse to that child\n-\t\t\t\t*/\n-\t\t\t\tchild->subtree_ref_count++;\n-\t\t\t\tif (child->subtree_ref_count ==\n-\t\t\t\t\t\tchild->ref_count)\n-\t\t\t\t\tmark_subtree(child, level_bits,\n-\t\t\t\t\t\tlevel + 1, id);\n-\t\t\t}\n-\t\t}\n-\t}\n-}\n-\n-/*\n- * Build the set of bits that define the set of transitions\n- * for each level of a trie.\n- */\n-static void\n-build_subset_mask(struct rte_acl_node *node,\n-\tstruct rte_acl_bitset *level_bits,\n-\tint level)\n-{\n-\tuint32_t n;\n-\n-\t/* Add this node's transitions to the set for this level */\n-\tfor (n = 0; n < RTE_ACL_BIT_SET_SIZE; n++)\n-\t\tlevel_bits[level].bits[n] &= node->values.bits[n];\n-\n-\t/* For each child, add the transitions for the next level */\n-\tfor (n = 0; n < node->num_ptrs; n++)\n-\t\tif (node->ptrs[n].ptr != NULL)\n-\t\t\tbuild_subset_mask(node->ptrs[n].ptr, level_bits,\n-\t\t\t\tlevel + 1);\n-}\n-\n-\n-/*\n  * Merge nodes A and B together,\n  *   returns a node that is the path for the intersection\n  *\n@@ -1014,7 +926,7 @@ build_subset_mask(struct rte_acl_node *node,\n static int\n acl_merge_trie(struct acl_build_context *context,\n \tstruct rte_acl_node *node_a, struct rte_acl_node *node_b,\n-\tuint32_t level, uint32_t subtree_id, struct rte_acl_node **return_c)\n+\tuint32_t level, struct rte_acl_node **return_c)\n {\n \tuint32_t n, m, ptrs_c, ptrs_b;\n \tuint32_t min_add_c, min_add_b;\n@@ -1040,14 +952,12 @@ acl_merge_trie(struct acl_build_context *context,\n \t}\n \n \t/*\n-\t * Create node C as a copy of node A if node A is not part of\n-\t * a subtree of the merging tree (node B side). Otherwise,\n-\t * just use node A.\n+\t * Create node C as a copy of node A, and do: C = merge(A,B);\n+\t * If node A can be used instead (A==C), then later we'll\n+\t * destroy C and return A.\n \t */\n-\tif (level > 0) {\n+\tif (level > 0)\n \t\tnode_c = acl_dup_node(context, node_a);\n-\t\tnode_c->subtree_id = subtree_id | RTE_ACL_SUBTREE_NODE;\n-\t}\n \n \t/*\n \t * If the two node transitions intersect then merge the transitions.\n@@ -1094,7 +1004,7 @@ acl_merge_trie(struct acl_build_context *context,\n \t\t\t\t\tif (acl_merge_trie(context,\n \t\t\t\t\t\t\tnode_c->ptrs[n].ptr,\n \t\t\t\t\t\t\tnode_b->ptrs[m].ptr,\n-\t\t\t\t\t\t\tlevel + 1, subtree_id,\n+\t\t\t\t\t\t\tlevel + 1,\n \t\t\t\t\t\t\t&child_node_c))\n \t\t\t\t\t\treturn 1;\n \n@@ -1312,10 +1222,10 @@ build_trie(struct acl_build_context *context, struct rte_acl_build_rule *head,\n \tstruct rte_acl_build_rule *prev, *rule;\n \tstruct rte_acl_node *end, *merge, *root, *end_prev;\n \tconst struct rte_acl_field *fld;\n-\tstruct rte_acl_bitset level_bits[RTE_ACL_MAX_LEVELS];\n \n \tprev = head;\n \trule = head;\n+\t*last = prev;\n \n \ttrie = acl_alloc_node(context, 0);\n \n@@ -1394,7 +1304,7 @@ build_trie(struct acl_build_context *context, struct rte_acl_build_rule *head,\n \n \t\t\t/* merge this field on to the end of the rule */\n \t\t\tif (acl_merge_trie(context, end_prev, merge, 0,\n-\t\t\t\t\t0, NULL) != 0) {\n+\t\t\t\t\tNULL) != 0) {\n \t\t\t\treturn NULL;\n \t\t\t}\n \t\t}\n@@ -1420,15 +1330,10 @@ build_trie(struct acl_build_context *context, struct rte_acl_build_rule *head,\n \t\t}\n \n \t\tnode_count = context->num_nodes;\n-\n-\t\tmemset(&level_bits[0], UINT8_MAX, sizeof(level_bits));\n-\t\tbuild_subset_mask(root, &level_bits[0], 0);\n-\t\tmark_subtree(trie, &level_bits[0], 0, end->match_flag);\n \t\t(*count)++;\n \n \t\t/* merge this rule into the trie */\n-\t\tif (acl_merge_trie(context, trie, root, 0, end->match_flag,\n-\t\t\tNULL))\n+\t\tif (acl_merge_trie(context, trie, root, 0, NULL))\n \t\t\treturn NULL;\n \n \t\tnode_count = context->num_nodes - node_count;\n",
    "prefixes": [
        "dpdk-dev",
        "3/3"
    ]
}