get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 98632,
    "url": "http://patches.dpdk.org/api/patches/98632/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210910123003.85448-24-cristian.dumitrescu@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": "<20210910123003.85448-24-cristian.dumitrescu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210910123003.85448-24-cristian.dumitrescu@intel.com",
    "date": "2021-09-10T12:30:03",
    "name": "[24/24] pipeline: enable pipeline compilation",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0279b7af6372f65d398794b0f2e179477948da8e",
    "submitter": {
        "id": 19,
        "url": "http://patches.dpdk.org/api/people/19/?format=api",
        "name": "Cristian Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210910123003.85448-24-cristian.dumitrescu@intel.com/mbox/",
    "series": [
        {
            "id": 18838,
            "url": "http://patches.dpdk.org/api/series/18838/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=18838",
            "date": "2021-09-10T12:29:44",
            "name": "[01/24] pipeline: move data structures to internal header file",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/18838/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/98632/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/98632/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 2C861A0547;\n\tFri, 10 Sep 2021 14:33:36 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 92FE0411F4;\n\tFri, 10 Sep 2021 14:30:59 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by mails.dpdk.org (Postfix) with ESMTP id A58E241154\n for <dev@dpdk.org>; Fri, 10 Sep 2021 14:30:28 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Sep 2021 05:30:26 -0700",
            "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com) ([10.237.223.107])\n by orsmga001.jf.intel.com with ESMTP; 10 Sep 2021 05:30:26 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10102\"; a=\"243386342\"",
            "E=Sophos;i=\"5.85,282,1624345200\"; d=\"scan'208\";a=\"243386342\"",
            "E=Sophos;i=\"5.85,282,1624345200\"; d=\"scan'208\";a=\"514279861\""
        ],
        "X-ExtLoop1": "1",
        "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 10 Sep 2021 13:30:03 +0100",
        "Message-Id": "<20210910123003.85448-24-cristian.dumitrescu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20210910123003.85448-1-cristian.dumitrescu@intel.com>",
        "References": "<20210910123003.85448-1-cristian.dumitrescu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 24/24] pipeline: enable pipeline compilation",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Commit the pipeline changes when the compilation process is\nsuccessful: change the table lookup instructions to execute the action\nfunction for each action, replace the regular pipeline instructions\nwith the custom instructions.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\n lib/pipeline/rte_swx_pipeline.c | 55 +++++++++++++++++++++++++++++++++\n 1 file changed, 55 insertions(+)",
    "diff": "diff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c\nindex 4be43c94a9..88b8687278 100644\n--- a/lib/pipeline/rte_swx_pipeline.c\n+++ b/lib/pipeline/rte_swx_pipeline.c\n@@ -12304,6 +12304,58 @@ pipeline_libload(struct rte_swx_pipeline *p, struct instruction_group_list *igl)\n \treturn status;\n }\n \n+static void\n+pipeline_adjust(struct rte_swx_pipeline *p, struct instruction_group_list *igl)\n+{\n+\tstruct instruction_group *g;\n+\tuint32_t i;\n+\n+\t/* Pipeline table instructions. */\n+\tfor (i = 0; i < p->n_instructions; i++) {\n+\t\tstruct instruction *instr = &p->instructions[i];\n+\n+\t\tif (instr->type == INSTR_TABLE)\n+\t\t\tinstr->type = INSTR_TABLE_AF;\n+\n+\t\tif (instr->type == INSTR_LEARNER)\n+\t\t\tinstr->type = INSTR_LEARNER_AF;\n+\t}\n+\n+\t/* Pipeline custom instructions. */\n+\ti = 0;\n+\tTAILQ_FOREACH(g, igl, node) {\n+\t\tstruct instruction *instr = &p->instructions[g->first_instr_id];\n+\t\tuint32_t j;\n+\n+\t\tif (g->first_instr_id == g->last_instr_id)\n+\t\t\tcontinue;\n+\n+\t\t/* Install a new custom instruction. */\n+\t\tinstruction_table[INSTR_CUSTOM_0 + i] = g->func;\n+\n+\t\t/* First instruction of the group: change its type to the new custom instruction. */\n+\t\tinstr->type = INSTR_CUSTOM_0 + i;\n+\n+\t\t/* All the subsequent instructions of the group: invalidate. */\n+\t\tfor (j = g->first_instr_id + 1; j <= g->last_instr_id; j++) {\n+\t\t\tstruct instruction_data *data = &p->instruction_data[j];\n+\n+\t\t\tdata->invalid = 1;\n+\t\t}\n+\n+\t\ti++;\n+\t}\n+\n+\t/* Remove the invalidated instructions. */\n+\tp->n_instructions = instr_compact(p->instructions, p->instruction_data, p->n_instructions);\n+\n+\t/* Resolve the jump destination for any \"standalone\" jump instructions (i.e. those jump\n+\t * instructions that are the only instruction within their group, so they were left\n+\t * unmodified).\n+\t */\n+\tinstr_jmp_resolve(p->instructions, p->instruction_data, p->n_instructions);\n+}\n+\n static int\n pipeline_compile(struct rte_swx_pipeline *p)\n {\n@@ -12326,6 +12378,9 @@ pipeline_compile(struct rte_swx_pipeline *p)\n \tif (status)\n \t\tgoto free;\n \n+\t/* Adjust instructions. */\n+\tpipeline_adjust(p, igl);\n+\n free:\n \tinstruction_group_list_free(igl);\n \n",
    "prefixes": [
        "24/24"
    ]
}