get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 44573,
    "url": "http://patchwork.dpdk.org/api/patches/44573/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1536675645-10105-6-git-send-email-reshma.pattan@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": "<1536675645-10105-6-git-send-email-reshma.pattan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1536675645-10105-6-git-send-email-reshma.pattan@intel.com",
    "date": "2018-09-11T14:20:35",
    "name": "[v2,05/15] net/softnic: add free table and find out port functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "8f32bdd39d2c4b1a3aa8248c6d831b553aace5c1",
    "submitter": {
        "id": 70,
        "url": "http://patchwork.dpdk.org/api/people/70/?format=api",
        "name": "Pattan, Reshma",
        "email": "reshma.pattan@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/1536675645-10105-6-git-send-email-reshma.pattan@intel.com/mbox/",
    "series": [
        {
            "id": 1271,
            "url": "http://patchwork.dpdk.org/api/series/1271/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=1271",
            "date": "2018-09-11T14:20:35",
            "name": null,
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/1271/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/44573/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/44573/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 BA57858EC;\n\tTue, 11 Sep 2018 16:20:59 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 4A2724F94\n\tfor <dev@dpdk.org>; Tue, 11 Sep 2018 16:20:54 +0200 (CEST)",
            "from fmsmga007.fm.intel.com ([10.253.24.52])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t11 Sep 2018 07:20:53 -0700",
            "from sivswdev02.ir.intel.com (HELO localhost.localdomain)\n\t([10.237.217.46])\n\tby fmsmga007.fm.intel.com with ESMTP; 11 Sep 2018 07:20:53 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.53,360,1531810800\"; d=\"scan'208\";a=\"69156871\"",
        "From": "Reshma Pattan <reshma.pattan@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>,\n\tReshma Pattan <reshma.pattan@intel.com>",
        "Date": "Tue, 11 Sep 2018 15:20:35 +0100",
        "Message-Id": "<1536675645-10105-6-git-send-email-reshma.pattan@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": "<1536251222-17275-1-git-send-email-reshma.pattan@intel.com>",
        "References": "<1536251222-17275-1-git-send-email-reshma.pattan@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 05/15] net/softnic: add free table and find\n\tout port functions",
        "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": "Added utility function to freeup the\npipeline tables.\n\nAdded utility functions to find the pipeline\noutput port.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\nSigned-off-by: Reshma Pattan <reshma.pattan@intel.com>\n---\n drivers/net/softnic/rte_eth_softnic_internals.h | 13 ++++++\n drivers/net/softnic/rte_eth_softnic_pipeline.c  | 57 +++++++++++++++++++++++++\n 2 files changed, 70 insertions(+)",
    "diff": "diff --git a/drivers/net/softnic/rte_eth_softnic_internals.h b/drivers/net/softnic/rte_eth_softnic_internals.h\nindex f40215dfe..9c587bc7d 100644\n--- a/drivers/net/softnic/rte_eth_softnic_internals.h\n+++ b/drivers/net/softnic/rte_eth_softnic_internals.h\n@@ -415,10 +415,15 @@ struct softnic_port_in {\n \tstruct rte_port_in_action *a;\n };\n \n+struct softnic_port_out {\n+\tstruct softnic_port_out_params params;\n+};\n+\n struct softnic_table {\n \tstruct softnic_table_params params;\n \tstruct softnic_table_action_profile *ap;\n \tstruct rte_table_action *a;\n+\tstruct flow_list flows;\n };\n \n struct pipeline {\n@@ -426,7 +431,9 @@ struct pipeline {\n \tchar name[NAME_SIZE];\n \n \tstruct rte_pipeline *p;\n+\tstruct pipeline_params params;\n \tstruct softnic_port_in port_in[RTE_PIPELINE_PORT_IN_MAX];\n+\tstruct softnic_port_out port_out[RTE_PIPELINE_PORT_OUT_MAX];\n \tstruct softnic_table table[RTE_PIPELINE_TABLE_MAX];\n \tuint32_t n_ports_in;\n \tuint32_t n_ports_out;\n@@ -725,6 +732,12 @@ softnic_pipeline_port_out_create(struct pmd_internals *p,\n \tconst char *pipeline_name,\n \tstruct softnic_port_out_params *params);\n \n+int\n+softnic_pipeline_port_out_find(struct pmd_internals *softnic,\n+\t\tconst char *pipeline_name,\n+\t\tconst char *name,\n+\t\tuint32_t *port_id);\n+\n int\n softnic_pipeline_table_create(struct pmd_internals *p,\n \tconst char *pipeline_name,\ndiff --git a/drivers/net/softnic/rte_eth_softnic_pipeline.c b/drivers/net/softnic/rte_eth_softnic_pipeline.c\nindex dacf7bc9a..d1084ea36 100644\n--- a/drivers/net/softnic/rte_eth_softnic_pipeline.c\n+++ b/drivers/net/softnic/rte_eth_softnic_pipeline.c\n@@ -43,17 +43,41 @@ softnic_pipeline_init(struct pmd_internals *p)\n \treturn 0;\n }\n \n+static void\n+softnic_pipeline_table_free(struct softnic_table *table)\n+{\n+\tfor ( ; ; ) {\n+\t\tstruct rte_flow *flow;\n+\n+\t\tflow = TAILQ_FIRST(&table->flows);\n+\t\tif (flow == NULL)\n+\t\t\tbreak;\n+\n+\t\tTAILQ_REMOVE(&table->flows, flow, node);\n+\t\tfree(flow);\n+\t}\n+}\n+\n void\n softnic_pipeline_free(struct pmd_internals *p)\n {\n \tfor ( ; ; ) {\n \t\tstruct pipeline *pipeline;\n+\t\tuint32_t table_id;\n \n \t\tpipeline = TAILQ_FIRST(&p->pipeline_list);\n \t\tif (pipeline == NULL)\n \t\t\tbreak;\n \n \t\tTAILQ_REMOVE(&p->pipeline_list, pipeline, node);\n+\n+\t\tfor (table_id = 0; table_id < pipeline->n_tables; table_id++) {\n+\t\t\tstruct softnic_table *table =\n+\t\t\t\t&pipeline->table[table_id];\n+\n+\t\t\tsoftnic_pipeline_table_free(table);\n+\t\t}\n+\n \t\trte_ring_free(pipeline->msgq_req);\n \t\trte_ring_free(pipeline->msgq_rsp);\n \t\trte_pipeline_free(pipeline->p);\n@@ -160,6 +184,7 @@ softnic_pipeline_create(struct pmd_internals *softnic,\n \t/* Node fill in */\n \tstrlcpy(pipeline->name, name, sizeof(pipeline->name));\n \tpipeline->p = p;\n+\tmemcpy(&pipeline->params, params, sizeof(*params));\n \tpipeline->n_ports_in = 0;\n \tpipeline->n_ports_out = 0;\n \tpipeline->n_tables = 0;\n@@ -401,6 +426,7 @@ softnic_pipeline_port_out_create(struct pmd_internals *softnic,\n \t} pp_nodrop;\n \n \tstruct pipeline *pipeline;\n+\tstruct softnic_port_out *port_out;\n \tuint32_t port_id;\n \tint status;\n \n@@ -542,6 +568,8 @@ softnic_pipeline_port_out_create(struct pmd_internals *softnic,\n \t\treturn -1;\n \n \t/* Pipeline */\n+\tport_out = &pipeline->port_out[pipeline->n_ports_out];\n+\tmemcpy(&port_out->params, params, sizeof(*params));\n \tpipeline->n_ports_out++;\n \n \treturn 0;\n@@ -960,7 +988,36 @@ softnic_pipeline_table_create(struct pmd_internals *softnic,\n \tmemcpy(&table->params, params, sizeof(*params));\n \ttable->ap = ap;\n \ttable->a = action;\n+\tTAILQ_INIT(&table->flows);\n \tpipeline->n_tables++;\n \n \treturn 0;\n }\n+\n+int\n+softnic_pipeline_port_out_find(struct pmd_internals *softnic,\n+\t\tconst char *pipeline_name,\n+\t\tconst char *name,\n+\t\tuint32_t *port_id)\n+{\n+\tstruct pipeline *pipeline;\n+\tuint32_t i;\n+\n+\tif (softnic == NULL ||\n+\t\t\tpipeline_name == NULL ||\n+\t\t\tname == NULL ||\n+\t\t\tport_id == NULL)\n+\t\treturn -1;\n+\n+\tpipeline = softnic_pipeline_find(softnic, pipeline_name);\n+\tif (pipeline == NULL)\n+\t\treturn -1;\n+\n+\tfor (i = 0; i < pipeline->n_ports_out; i++)\n+\t\tif (strcmp(pipeline->port_out[i].params.dev_name, name) == 0) {\n+\t\t\t*port_id = i;\n+\t\t\treturn 0;\n+\t\t}\n+\n+\treturn -1;\n+}\n",
    "prefixes": [
        "v2",
        "05/15"
    ]
}