get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 5105,
    "url": "http://patches.dpdk.org/api/patches/5105/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1433353519-20589-3-git-send-email-konstantin.ananyev@intel.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": "<1433353519-20589-3-git-send-email-konstantin.ananyev@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1433353519-20589-3-git-send-email-konstantin.ananyev@intel.com",
    "date": "2015-06-03T17:45:18",
    "name": "[dpdk-dev,PATCHv2,2/3] ACL: add new test case for ranges build",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "2789074c99337e1c9debe8ca380c668ba5e66294",
    "submitter": {
        "id": 33,
        "url": "http://patches.dpdk.org/api/people/33/?format=api",
        "name": "Ananyev, Konstantin",
        "email": "konstantin.ananyev@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1433353519-20589-3-git-send-email-konstantin.ananyev@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/5105/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/5105/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 04478C334;\n\tWed,  3 Jun 2015 19:45:46 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 488F0C328\n\tfor <dev@dpdk.org>; Wed,  3 Jun 2015 19:45:44 +0200 (CEST)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga102.fm.intel.com with ESMTP; 03 Jun 2015 10:45:25 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga003.jf.intel.com with ESMTP; 03 Jun 2015 10:45:24 -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\tt53HjMLb021040; Wed, 3 Jun 2015 18:45:22 +0100",
            "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev02.ir.intel.com with ESMTP id t53HjMen020786;\n\tWed, 3 Jun 2015 18:45:22 +0100",
            "(from kananye1@localhost)\n\tby sivswdev02.ir.intel.com with  id t53HjM5F020782;\n\tWed, 3 Jun 2015 18:45:22 +0100"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.13,548,1427785200\"; d=\"scan'208\";a=\"581497306\"",
        "From": "Konstantin Ananyev <konstantin.ananyev@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Wed,  3 Jun 2015 18:45:18 +0100",
        "Message-Id": "<1433353519-20589-3-git-send-email-konstantin.ananyev@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1433353519-20589-1-git-send-email-konstantin.ananyev@intel.com>",
        "References": "<1433353519-20589-1-git-send-email-konstantin.ananyev@intel.com>",
        "Subject": "[dpdk-dev] [PATCHv2 2/3] ACL: add new test case for ranges build",
        "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": "Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\n---\n app/test/test_acl.c | 147 ++++++++++++++++++++++++++++++++++++++++++++++++++--\n 1 file changed, 143 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/app/test/test_acl.c b/app/test/test_acl.c\nindex 7119ad3..6a032f9 100644\n--- a/app/test/test_acl.c\n+++ b/app/test/test_acl.c\n@@ -191,7 +191,8 @@ err:\n }\n \n static int\n-test_classify_buid(struct rte_acl_ctx *acx)\n+test_classify_buid(struct rte_acl_ctx *acx,\n+\tconst struct rte_acl_ipv4vlan_rule *rules, uint32_t num)\n {\n \tint ret;\n \tconst uint32_t layout[RTE_ACL_IPV4VLAN_NUM] = {\n@@ -203,8 +204,7 @@ test_classify_buid(struct rte_acl_ctx *acx)\n \t};\n \n \t/* add rules to the context */\n-\tret = rte_acl_ipv4vlan_add_rules(acx, acl_test_rules,\n-\t\t\tRTE_DIM(acl_test_rules));\n+\tret = rte_acl_ipv4vlan_add_rules(acx, rules, num);\n \tif (ret != 0) {\n \t\tprintf(\"Line %i: Adding rules to ACL context failed!\\n\",\n \t\t\t__LINE__);\n@@ -246,7 +246,8 @@ test_classify(void)\n \t\telse\n \t\t\trte_acl_reset_rules(acx);\n \n-\t\tret = test_classify_buid(acx);\n+\t\tret = test_classify_buid(acx, acl_test_rules,\n+\t\t\tRTE_DIM(acl_test_rules));\n \t\tif (ret != 0) {\n \t\t\tprintf(\"Line %i, iter: %d: \"\n \t\t\t\t\"Adding rules to ACL context failed!\\n\",\n@@ -275,6 +276,142 @@ test_classify(void)\n \treturn ret;\n }\n \n+static int\n+test_build_ports_range(void)\n+{\n+\tstatic const struct rte_acl_ipv4vlan_rule test_rules[] = {\n+\t\t{\n+\t\t\t/* match all packets. */\n+\t\t\t.data = {\n+\t\t\t\t.userdata = 1,\n+\t\t\t\t.category_mask = ACL_ALLOW_MASK,\n+\t\t\t\t.priority = 101,\n+\t\t\t},\n+\t\t\t.src_port_low = 0,\n+\t\t\t.src_port_high = UINT16_MAX,\n+\t\t\t.dst_port_low = 0,\n+\t\t\t.dst_port_high = UINT16_MAX,\n+\t\t},\n+\t\t{\n+\t\t\t/* match all packets with dst ports [54-65280]. */\n+\t\t\t.data = {\n+\t\t\t\t.userdata = 2,\n+\t\t\t\t.category_mask = ACL_ALLOW_MASK,\n+\t\t\t\t.priority = 102,\n+\t\t\t},\n+\t\t\t.src_port_low = 0,\n+\t\t\t.src_port_high = UINT16_MAX,\n+\t\t\t.dst_port_low = 54,\n+\t\t\t.dst_port_high = 65280,\n+\t\t},\n+\t\t{\n+\t\t\t/* match all packets with dst ports [0-52]. */\n+\t\t\t.data = {\n+\t\t\t\t.userdata = 3,\n+\t\t\t\t.category_mask = ACL_ALLOW_MASK,\n+\t\t\t\t.priority = 103,\n+\t\t\t},\n+\t\t\t.src_port_low = 0,\n+\t\t\t.src_port_high = UINT16_MAX,\n+\t\t\t.dst_port_low = 0,\n+\t\t\t.dst_port_high = 52,\n+\t\t},\n+\t\t{\n+\t\t\t/* match all packets with dst ports [53]. */\n+\t\t\t.data = {\n+\t\t\t\t.userdata = 4,\n+\t\t\t\t.category_mask = ACL_ALLOW_MASK,\n+\t\t\t\t.priority = 99,\n+\t\t\t},\n+\t\t\t.src_port_low = 0,\n+\t\t\t.src_port_high = UINT16_MAX,\n+\t\t\t.dst_port_low = 53,\n+\t\t\t.dst_port_high = 53,\n+\t\t},\n+\t\t{\n+\t\t\t/* match all packets with dst ports [65279-65535]. */\n+\t\t\t.data = {\n+\t\t\t\t.userdata = 5,\n+\t\t\t\t.category_mask = ACL_ALLOW_MASK,\n+\t\t\t\t.priority = 98,\n+\t\t\t},\n+\t\t\t.src_port_low = 0,\n+\t\t\t.src_port_high = UINT16_MAX,\n+\t\t\t.dst_port_low = 65279,\n+\t\t\t.dst_port_high = UINT16_MAX,\n+\t\t},\n+\t};\n+\n+\tstatic struct ipv4_7tuple test_data[] = {\n+\t\t{\n+\t\t\t.proto = 6,\n+\t\t\t.ip_src = IPv4(10, 1, 1, 1),\n+\t\t\t.ip_dst = IPv4(192, 168, 0, 33),\n+\t\t\t.port_dst = 53,\n+\t\t\t.allow = 1,\n+\t\t},\n+\t\t{\n+\t\t\t.proto = 6,\n+\t\t\t.ip_src = IPv4(127, 84, 33, 1),\n+\t\t\t.ip_dst = IPv4(1, 2, 3, 4),\n+\t\t\t.port_dst = 65281,\n+\t\t\t.allow = 1,\n+\t\t},\n+\t};\n+\n+\tstruct rte_acl_ctx *acx;\n+\tint32_t ret, i, j;\n+\tuint32_t results[RTE_DIM(test_data)];\n+\tconst uint8_t *data[RTE_DIM(test_data)];\n+\n+\tacx = rte_acl_create(&acl_param);\n+\tif (acx == NULL) {\n+\t\tprintf(\"Line %i: Error creating ACL context!\\n\", __LINE__);\n+\t\treturn -1;\n+\t}\n+\n+\t/* swap all bytes in the data to network order */\n+\tbswap_test_data(test_data, RTE_DIM(test_data), 1);\n+\n+\t/* store pointers to test data */\n+\tfor (i = 0; i != RTE_DIM(test_data); i++)\n+\t\tdata[i] = (uint8_t *)&test_data[i];\n+\n+\tfor (i = 0; i != RTE_DIM(test_rules); i++) {\n+\t\trte_acl_reset(acx);\n+\t\tret = test_classify_buid(acx, test_rules, i + 1);\n+\t\tif (ret != 0) {\n+\t\t\tprintf(\"Line %i, iter: %d: \"\n+\t\t\t\t\"Adding rules to ACL context failed!\\n\",\n+\t\t\t\t__LINE__, i);\n+\t\t\tbreak;\n+\t\t}\n+\t\tret = rte_acl_classify(acx, data, results,\n+\t\t\tRTE_DIM(data), 1);\n+\t\tif (ret != 0) {\n+\t\t\tprintf(\"Line %i, iter: %d: classify failed!\\n\",\n+\t\t\t\t__LINE__, i);\n+\t\t\tbreak;\n+\t\t}\n+\n+\t\t/* check results */\n+\t\tfor (j = 0; j != RTE_DIM(results); j++) {\n+\t\t\tif (results[j] != test_data[j].allow) {\n+\t\t\t\tprintf(\"Line %i: Error in allow results at %i \"\n+\t\t\t\t\t\"(expected %\"PRIu32\" got %\"PRIu32\")!\\n\",\n+\t\t\t\t\t__LINE__, j, test_data[j].allow,\n+\t\t\t\t\tresults[j]);\n+\t\t\t\tret = -EINVAL;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\tbswap_test_data(test_data, RTE_DIM(test_data), 0);\n+\n+\trte_acl_free(acx);\n+\treturn ret;\n+}\n+\n /*\n  * Test wrong layout behavior\n  * This test supplies the ACL context with invalid layout, which results in\n@@ -930,6 +1067,8 @@ test_acl(void)\n \t\treturn -1;\n \tif (test_classify() < 0)\n \t\treturn -1;\n+\tif (test_build_ports_range() < 0)\n+\t\treturn -1;\n \n \treturn 0;\n }\n",
    "prefixes": [
        "dpdk-dev",
        "PATCHv2",
        "2/3"
    ]
}