Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/47738/?format=api
http://patchwork.dpdk.org/api/patches/47738/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1541158623-29742-4-git-send-email-cristian.dumitrescu@intel.com/", "project": { "id": 1, "url": "http://patchwork.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": "<1541158623-29742-4-git-send-email-cristian.dumitrescu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1541158623-29742-4-git-send-email-cristian.dumitrescu@intel.com", "date": "2018-11-02T11:36:55", "name": "[04/12] examples/ip_pipeline: track rules on add default", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "ba56187ae4f582f6aeafc766f63cd4495dacd102", "submitter": { "id": 19, "url": "http://patchwork.dpdk.org/api/people/19/?format=api", "name": "Cristian Dumitrescu", "email": "cristian.dumitrescu@intel.com" }, "delegate": { "id": 10018, "url": "http://patchwork.dpdk.org/api/users/10018/?format=api", "username": "cristian_dumitrescu", "first_name": "Cristian", "last_name": "Dumitrescu", "email": "cristian.dumitrescu@intel.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1541158623-29742-4-git-send-email-cristian.dumitrescu@intel.com/mbox/", "series": [ { "id": 2226, "url": "http://patchwork.dpdk.org/api/series/2226/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=2226", "date": "2018-11-02T11:36:52", "name": "[01/12] examples/ip_pipeline: add rule list per table", "version": 1, "mbox": "http://patchwork.dpdk.org/series/2226/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/47738/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/47738/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 3B57A1B44C;\n\tFri, 2 Nov 2018 12:37:13 +0100 (CET)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id DD1211B43A\n\tfor <dev@dpdk.org>; Fri, 2 Nov 2018 12:37:09 +0100 (CET)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Nov 2018 04:37:09 -0700", "from silpixa00382658.ir.intel.com ([10.237.223.29])\n\tby orsmga002.jf.intel.com with ESMTP; 02 Nov 2018 04:37:08 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.54,455,1534834800\"; d=\"scan'208\";a=\"105381779\"", "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>", "To": "dev@dpdk.org", "Cc": "Jasvinder Singh <jasvinder.singh@intel.com>", "Date": "Fri, 2 Nov 2018 11:36:55 +0000", "Message-Id": "<1541158623-29742-4-git-send-email-cristian.dumitrescu@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1541158623-29742-1-git-send-email-cristian.dumitrescu@intel.com>", "References": "<1541158623-29742-1-git-send-email-cristian.dumitrescu@intel.com>", "Subject": "[dpdk-dev] [PATCH 04/12] examples/ip_pipeline: track rules on add\n\tdefault", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Support table rule tracking on table rule add default operation.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\nSigned-off-by: Jasvinder Singh <jasvinder.singh@intel.com>\n---\n examples/ip_pipeline/cli.c | 4 +---\n examples/ip_pipeline/pipeline.h | 3 +--\n examples/ip_pipeline/thread.c | 39 +++++++++++++++++++++++++++++----------\n 3 files changed, 31 insertions(+), 15 deletions(-)", "diff": "diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c\nindex 5011cad..54d347c 100644\n--- a/examples/ip_pipeline/cli.c\n+++ b/examples/ip_pipeline/cli.c\n@@ -4407,7 +4407,6 @@ cmd_pipeline_table_rule_add_default(char **tokens,\n \tsize_t out_size)\n {\n \tstruct table_rule_action action;\n-\tvoid *data;\n \tchar *pipeline_name;\n \tuint32_t table_id;\n \tint status;\n@@ -4513,8 +4512,7 @@ cmd_pipeline_table_rule_add_default(char **tokens,\n \n \tstatus = pipeline_table_rule_add_default(pipeline_name,\n \t\ttable_id,\n-\t\t&action,\n-\t\t&data);\n+\t\t&action);\n \tif (status) {\n \t\tsnprintf(out, out_size, MSG_CMD_FAIL, tokens[0]);\n \t\treturn;\ndiff --git a/examples/ip_pipeline/pipeline.h b/examples/ip_pipeline/pipeline.h\nindex 8a364a9..15a38fd 100644\n--- a/examples/ip_pipeline/pipeline.h\n+++ b/examples/ip_pipeline/pipeline.h\n@@ -341,8 +341,7 @@ pipeline_table_rule_add_bulk(const char *pipeline_name,\n int\n pipeline_table_rule_add_default(const char *pipeline_name,\n \tuint32_t table_id,\n-\tstruct table_rule_action *action,\n-\tvoid **data);\n+\tstruct table_rule_action *action);\n \n int\n pipeline_table_rule_delete(const char *pipeline_name,\ndiff --git a/examples/ip_pipeline/thread.c b/examples/ip_pipeline/thread.c\nindex 2c0570f..d2daacc 100644\n--- a/examples/ip_pipeline/thread.c\n+++ b/examples/ip_pipeline/thread.c\n@@ -1447,18 +1447,18 @@ pipeline_table_rule_add(const char *pipeline_name,\n int\n pipeline_table_rule_add_default(const char *pipeline_name,\n \tuint32_t table_id,\n-\tstruct table_rule_action *action,\n-\tvoid **data)\n+\tstruct table_rule_action *action)\n {\n \tstruct pipeline *p;\n+\tstruct table *table;\n \tstruct pipeline_msg_req *req;\n \tstruct pipeline_msg_rsp *rsp;\n+\tstruct table_rule *rule;\n \tint status;\n \n \t/* Check input params */\n \tif ((pipeline_name == NULL) ||\n-\t\t(action == NULL) ||\n-\t\t(data == NULL))\n+\t\t(action == NULL))\n \t\treturn -1;\n \n \tp = pipeline_find(pipeline_name);\n@@ -1467,13 +1467,23 @@ pipeline_table_rule_add_default(const char *pipeline_name,\n \t\taction_default_check(action, p, table_id))\n \t\treturn -1;\n \n+\ttable = &p->table[table_id];\n+\n+\trule = calloc(1, sizeof(struct table_rule));\n+\tif (rule == NULL)\n+\t\treturn -1;\n+\n+\tmemcpy(&rule->action, action, sizeof(*action));\n+\n \tif (!pipeline_is_running(p)) {\n \t\tstruct rte_pipeline_table_entry *data_in, *data_out;\n \t\tuint8_t *buffer;\n \n \t\tbuffer = calloc(TABLE_RULE_ACTION_SIZE_MAX, sizeof(uint8_t));\n-\t\tif (buffer == NULL)\n+\t\tif (buffer == NULL) {\n+\t\t\tfree(rule);\n \t\t\treturn -1;\n+\t\t}\n \n \t\t/* Apply actions */\n \t\tdata_in = (struct rte_pipeline_table_entry *)buffer;\n@@ -1491,11 +1501,13 @@ pipeline_table_rule_add_default(const char *pipeline_name,\n \t\t\t\t&data_out);\n \t\tif (status) {\n \t\t\tfree(buffer);\n+\t\t\tfree(rule);\n \t\t\treturn -1;\n \t\t}\n \n \t\t/* Write Response */\n-\t\t*data = data_out;\n+\t\trule->data = data_out;\n+\t\ttable_rule_default_add(table, rule);\n \n \t\tfree(buffer);\n \t\treturn 0;\n@@ -1503,8 +1515,10 @@ pipeline_table_rule_add_default(const char *pipeline_name,\n \n \t/* Allocate request */\n \treq = pipeline_msg_alloc();\n-\tif (req == NULL)\n+\tif (req == NULL) {\n+\t\tfree(rule);\n \t\treturn -1;\n+\t}\n \n \t/* Write request */\n \treq->type = PIPELINE_REQ_TABLE_RULE_ADD_DEFAULT;\n@@ -1513,13 +1527,18 @@ pipeline_table_rule_add_default(const char *pipeline_name,\n \n \t/* Send request and wait for response */\n \trsp = pipeline_msg_send_recv(p, req);\n-\tif (rsp == NULL)\n+\tif (rsp == NULL) {\n+\t\tfree(rule);\n \t\treturn -1;\n+\t}\n \n \t/* Read response */\n \tstatus = rsp->status;\n-\tif (status == 0)\n-\t\t*data = rsp->table_rule_add_default.data;\n+\tif (status == 0) {\n+\t\trule->data = rsp->table_rule_add_default.data;\n+\t\ttable_rule_default_add(table, rule);\n+\t} else\n+\t\tfree(rule);\n \n \t/* Free response */\n \tpipeline_msg_free(rsp);\n", "prefixes": [ "04/12" ] }{ "id": 47738, "url": "