get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 7770,
    "url": "https://patches.dpdk.org/api/patches/7770/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1445346087-2880-4-git-send-email-michalx.k.jastrzebski@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": "<1445346087-2880-4-git-send-email-michalx.k.jastrzebski@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1445346087-2880-4-git-send-email-michalx.k.jastrzebski@intel.com",
    "date": "2015-10-20T13:01:25",
    "name": "[dpdk-dev,v4,3/5] test_table: added check for bulk add/delete to acl table unit test",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "7a648558e235e2b465a26bcaf7ee7c6f6dab58ef",
    "submitter": {
        "id": 74,
        "url": "https://patches.dpdk.org/api/people/74/?format=api",
        "name": "Michal Jastrzebski",
        "email": "michalx.k.jastrzebski@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1445346087-2880-4-git-send-email-michalx.k.jastrzebski@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/7770/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/7770/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 E2E648E8D;\n\tTue, 20 Oct 2015 15:04:32 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id A29CF8E8D\n\tfor <dev@dpdk.org>; Tue, 20 Oct 2015 15:04:30 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga102.fm.intel.com with ESMTP; 20 Oct 2015 06:02:00 -0700",
            "from unknown (HELO Sent) ([10.217.248.25])\n\tby orsmga002.jf.intel.com with SMTP; 20 Oct 2015 06:01:59 -0700",
            "by Sent (sSMTP sendmail emulation); Tue, 20 Oct 2015 15:01:57 +0116"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.17,707,1437462000\"; d=\"scan'208\";a=\"830846998\"",
        "From": "Michal Jastrzebski <michalx.k.jastrzebski@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Tue, 20 Oct 2015 15:01:25 +0200",
        "Message-Id": "<1445346087-2880-4-git-send-email-michalx.k.jastrzebski@intel.com>",
        "X-Mailer": "git-send-email 2.1.1",
        "In-Reply-To": "<1445346087-2880-1-git-send-email-michalx.k.jastrzebski@intel.com>",
        "References": "<1445346087-2880-1-git-send-email-michalx.k.jastrzebski@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 3/5] test_table: added check for bulk\n\tadd/delete to acl table unit test",
        "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": "From: Marcin Kerlin <marcinx.kerlin@intel.com>\n\nAdded to acl table unit test check for bulk add and bulk delete.\n\nSigned-off-by: Maciej Gajdzica <maciejx.t.gajdzica@intel.com>\nAcked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\n app/test/test_table_acl.c | 166 ++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 166 insertions(+)",
    "diff": "diff --git a/app/test/test_table_acl.c b/app/test/test_table_acl.c\nindex e4e9b9c..fe8e545 100644\n--- a/app/test/test_table_acl.c\n+++ b/app/test/test_table_acl.c\n@@ -253,6 +253,94 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v)\n \treturn 0;\n }\n \n+static int\n+parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v)\n+{\n+\tint i, rc;\n+\tchar *s, *sp, *in[CB_FLD_NUM];\n+\tstatic const char *dlm = \" \\t\\n\";\n+\n+\t/*\n+\t** Skip leading '@'\n+\t*/\n+\tif (strchr(str, '@') != str)\n+\t\treturn -EINVAL;\n+\n+\ts = str + 1;\n+\n+\t/*\n+\t* Populate the 'in' array with the location of each\n+\t* field in the string we're parsing\n+\t*/\n+\tfor (i = 0; i != DIM(in); i++) {\n+\t\tin[i] = strtok_r(s, dlm, &sp);\n+\t\tif (in[i] == NULL)\n+\t\t\treturn -EINVAL;\n+\t\ts = NULL;\n+\t}\n+\n+\t/* Parse x.x.x.x/x */\n+\trc = parse_ipv4_net(in[CB_FLD_SRC_ADDR],\n+\t\t&v->field_value[SRC_FIELD_IPV4].value.u32,\n+\t\t&v->field_value[SRC_FIELD_IPV4].mask_range.u32);\n+\tif (rc != 0) {\n+\t\tRTE_LOG(ERR, PIPELINE, \"failed to read src address/mask: %s\\n\",\n+\t\t\tin[CB_FLD_SRC_ADDR]);\n+\t\treturn rc;\n+\t}\n+\n+\tprintf(\"V=%u, mask=%u\\n\", v->field_value[SRC_FIELD_IPV4].value.u32,\n+\t\tv->field_value[SRC_FIELD_IPV4].mask_range.u32);\n+\n+\t/* Parse x.x.x.x/x */\n+\trc = parse_ipv4_net(in[CB_FLD_DST_ADDR],\n+\t\t&v->field_value[DST_FIELD_IPV4].value.u32,\n+\t\t&v->field_value[DST_FIELD_IPV4].mask_range.u32);\n+\tif (rc != 0) {\n+\t\tRTE_LOG(ERR, PIPELINE, \"failed to read dest address/mask: %s\\n\",\n+\t\t\tin[CB_FLD_DST_ADDR]);\n+\t\treturn rc;\n+\t}\n+\n+\tprintf(\"V=%u, mask=%u\\n\", v->field_value[DST_FIELD_IPV4].value.u32,\n+\tv->field_value[DST_FIELD_IPV4].mask_range.u32);\n+\t/* Parse n:n */\n+\trc = parse_port_range(in[CB_FLD_SRC_PORT_RANGE],\n+\t\t&v->field_value[SRCP_FIELD_IPV4].value.u16,\n+\t\t&v->field_value[SRCP_FIELD_IPV4].mask_range.u16);\n+\tif (rc != 0) {\n+\t\tRTE_LOG(ERR, PIPELINE, \"failed to read source port range: %s\\n\",\n+\t\t\tin[CB_FLD_SRC_PORT_RANGE]);\n+\t\treturn rc;\n+\t}\n+\n+\tprintf(\"V=%u, mask=%u\\n\", v->field_value[SRCP_FIELD_IPV4].value.u16,\n+\t\tv->field_value[SRCP_FIELD_IPV4].mask_range.u16);\n+\t/* Parse n:n */\n+\trc = parse_port_range(in[CB_FLD_DST_PORT_RANGE],\n+\t\t&v->field_value[DSTP_FIELD_IPV4].value.u16,\n+\t\t&v->field_value[DSTP_FIELD_IPV4].mask_range.u16);\n+\tif (rc != 0) {\n+\t\tRTE_LOG(ERR, PIPELINE, \"failed to read dest port range: %s\\n\",\n+\t\t\tin[CB_FLD_DST_PORT_RANGE]);\n+\t\treturn rc;\n+\t}\n+\n+\tprintf(\"V=%u, mask=%u\\n\", v->field_value[DSTP_FIELD_IPV4].value.u16,\n+\t\tv->field_value[DSTP_FIELD_IPV4].mask_range.u16);\n+\t/* parse 0/0xnn */\n+\tGET_CB_FIELD(in[CB_FLD_PROTO],\n+\t\tv->field_value[PROTO_FIELD_IPV4].value.u8,\n+\t\t0, UINT8_MAX, '/');\n+\tGET_CB_FIELD(in[CB_FLD_PROTO],\n+\t\tv->field_value[PROTO_FIELD_IPV4].mask_range.u8,\n+\t\t0, UINT8_MAX, 0);\n+\n+\tprintf(\"V=%u, mask=%u\\n\",\n+\t\t(unsigned int)v->field_value[PROTO_FIELD_IPV4].value.u8,\n+\t\tv->field_value[PROTO_FIELD_IPV4].mask_range.u8);\n+\treturn 0;\n+}\n \n /*\n  * The format for these rules DO NOT need the port ranges to be\n@@ -393,6 +481,84 @@ setup_acl_pipeline(void)\n \t\t}\n \t}\n \n+\t/* Add bulk entries to tables */\n+\tfor (i = 0; i < N_PORTS; i++) {\n+\t\tstruct rte_table_acl_rule_add_params keys[5];\n+\t\tstruct rte_pipeline_table_entry entries[5];\n+\t\tstruct rte_table_acl_rule_add_params *key_array[5];\n+\t\tstruct rte_pipeline_table_entry *table_entries[5];\n+\t\tint key_found[5];\n+\t\tstruct rte_pipeline_table_entry *table_entries_ptr[5];\n+\t\tstruct rte_pipeline_table_entry entries_ptr[5];\n+\n+\t\tparser = parse_cb_ipv4_rule;\n+\t\tfor (n = 0; n < 5; n++) {\n+\t\t\tmemset(&keys[n], 0, sizeof(struct rte_table_acl_rule_add_params));\n+\t\t\tkey_array[n] = &keys[n];\n+\n+\t\t\tsnprintf(line, sizeof(line), \"%s\", lines[n]);\n+\t\t\tprintf(\"PARSING [%s]\\n\", line);\n+\n+\t\t\tret = parser(line, &keys[n]);\n+\t\t\tif (ret != 0) {\n+\t\t\t\tRTE_LOG(ERR, PIPELINE,\n+\t\t\t\t\t\"line %u: parse_cb_ipv4vlan_rule\"\n+\t\t\t\t\t\" failed, error code: %d (%s)\\n\",\n+\t\t\t\t\tn, ret, strerror(-ret));\n+\t\t\t\treturn ret;\n+\t\t\t}\n+\n+\t\t\tkeys[n].priority = RTE_ACL_MAX_PRIORITY - n - 1;\n+\n+\t\t\tentries[n].action = RTE_PIPELINE_ACTION_PORT;\n+\t\t\tentries[n].port_id = port_out_id[i^1];\n+\t\t\ttable_entries[n] = &entries[n];\n+\t\t\ttable_entries_ptr[n] = &entries_ptr[n];\n+\t\t}\n+\n+\t\tret = rte_pipeline_table_entry_add_bulk(p, table_id[i],\n+\t\t\t\t(void **)key_array, table_entries, 5, key_found, table_entries_ptr);\n+\t\tif (ret < 0) {\n+\t\t\trte_panic(\"Add entry bulk to table %u failed (%d)\\n\",\n+\t\t\t\ttable_id[i], ret);\n+\t\t\tgoto fail;\n+\t\t}\n+\t}\n+\n+\t/* Delete bulk entries from tables */\n+\tfor (i = 0; i < N_PORTS; i++) {\n+\t\tstruct rte_table_acl_rule_delete_params keys[5];\n+\t\tstruct rte_table_acl_rule_delete_params *key_array[5];\n+\t\tstruct rte_pipeline_table_entry *table_entries[5];\n+\t\tint key_found[5];\n+\n+\t\tfor (n = 0; n < 5; n++) {\n+\t\t\tmemset(&keys[n], 0, sizeof(struct rte_table_acl_rule_delete_params));\n+\t\t\tkey_array[n] = &keys[n];\n+\n+\t\t\tsnprintf(line, sizeof(line), \"%s\", lines[n]);\n+\t\t\tprintf(\"PARSING [%s]\\n\", line);\n+\n+\t\t\tret = parse_cb_ipv4_rule_del(line, &keys[n]);\n+\t\t\tif (ret != 0) {\n+\t\t\t\tRTE_LOG(ERR, PIPELINE,\n+\t\t\t\t\t\"line %u: parse_cb_ipv4vlan_rule\"\n+\t\t\t\t\t\" failed, error code: %d (%s)\\n\",\n+\t\t\t\t\tn, ret, strerror(-ret));\n+\t\t\t\treturn ret;\n+\t\t\t}\n+\t\t}\n+\n+\t\tret = rte_pipeline_table_entry_delete_bulk(p, table_id[i],\n+\t\t\t(void **)key_array, 5, key_found, table_entries);\n+\t\tif (ret < 0) {\n+\t\t\trte_panic(\"Delete bulk entries from table %u failed (%d)\\n\",\n+\t\t\t\ttable_id[i], ret);\n+\t\t\tgoto fail;\n+\t\t} else\n+\t\t\tprintf(\"Bulk deleted rules.\\n\");\n+\t}\n+\n \t/* Add entries to tables */\n \tfor (i = 0; i < N_PORTS; i++) {\n \t\tstruct rte_pipeline_table_entry table_entry = {\n",
    "prefixes": [
        "dpdk-dev",
        "v4",
        "3/5"
    ]
}