get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77187,
    "url": "http://patches.dpdk.org/api/patches/77187/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200910152645.9342-28-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": "<20200910152645.9342-28-cristian.dumitrescu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200910152645.9342-28-cristian.dumitrescu@intel.com",
    "date": "2020-09-10T15:26:31",
    "name": "[v4,27/41] pipeline: add SWX instruction verifier",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d0a2da6401272e6df32dd8bb4755e8b184ffa2e6",
    "submitter": {
        "id": 19,
        "url": "http://patches.dpdk.org/api/people/19/?format=api",
        "name": "Cristian Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200910152645.9342-28-cristian.dumitrescu@intel.com/mbox/",
    "series": [
        {
            "id": 12106,
            "url": "http://patches.dpdk.org/api/series/12106/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12106",
            "date": "2020-09-10T15:26:04",
            "name": "Pipeline alignment with the P4 language",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/12106/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77187/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/77187/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 104D8A04B5;\n\tThu, 10 Sep 2020 17:32:20 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 9FFB81C211;\n\tThu, 10 Sep 2020 17:27:34 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by dpdk.org (Postfix) with ESMTP id 096991C19A\n for <dev@dpdk.org>; Thu, 10 Sep 2020 17:27:11 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Sep 2020 08:27:11 -0700",
            "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com) ([10.237.223.107])\n by orsmga005.jf.intel.com with ESMTP; 10 Sep 2020 08:27:10 -0700"
        ],
        "IronPort-SDR": [
            "\n bB5BEDP5YQFhlefjfaL6blAMne2J1wbOKWRGpVZlqHgEtDomjsFGL7SHBjaTHsthUyKBOpVUuc\n 0qQlpaH2UQ3w==",
            "\n NKVj+AxiIkEhttME54diROa0ait9NTxepqHQSBUJytrR16teuPA65EVH0BUJglTvTWIZlhrCyr\n nfA8tpmux2Og=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9739\"; a=\"155956170\"",
            "E=Sophos;i=\"5.76,413,1592895600\"; d=\"scan'208\";a=\"155956170\"",
            "E=Sophos;i=\"5.76,413,1592895600\"; d=\"scan'208\";a=\"480932204\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Thu, 10 Sep 2020 16:26:31 +0100",
        "Message-Id": "<20200910152645.9342-28-cristian.dumitrescu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200910152645.9342-1-cristian.dumitrescu@intel.com>",
        "References": "<20200908201830.74206-2-cristian.dumitrescu@intel.com>\n <20200910152645.9342-1-cristian.dumitrescu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 27/41] pipeline: add SWX instruction verifier",
        "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 <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": "Instruction verifier. Executes at instruction translation time during\nSWX pipeline build, i.e. at initialization instead of run-time.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\n lib/librte_pipeline/rte_swx_pipeline.c | 51 ++++++++++++++++++++++++++\n 1 file changed, 51 insertions(+)",
    "diff": "diff --git a/lib/librte_pipeline/rte_swx_pipeline.c b/lib/librte_pipeline/rte_swx_pipeline.c\nindex ef388fec1..d51fec821 100644\n--- a/lib/librte_pipeline/rte_swx_pipeline.c\n+++ b/lib/librte_pipeline/rte_swx_pipeline.c\n@@ -5653,6 +5653,53 @@ instr_jmp_resolve(struct instruction *instructions,\n \treturn 0;\n }\n \n+static int\n+instr_verify(struct rte_swx_pipeline *p __rte_unused,\n+\t     struct action *a,\n+\t     struct instruction *instr,\n+\t     struct instruction_data *data __rte_unused,\n+\t     uint32_t n_instructions)\n+{\n+\tif (!a) {\n+\t\tenum instruction_type type;\n+\t\tuint32_t i;\n+\n+\t\t/* Check that the first instruction is rx. */\n+\t\tCHECK(instr[0].type == INSTR_RX, EINVAL);\n+\n+\t\t/* Check that there is at least one tx instruction. */\n+\t\tfor (i = 0; i < n_instructions; i++) {\n+\t\t\ttype = instr[i].type;\n+\n+\t\t\tif (instr[i].type == INSTR_TX)\n+\t\t\t\tbreak;\n+\t\t}\n+\t\tCHECK(i < n_instructions, EINVAL);\n+\n+\t\t/* Check that the last instruction is either tx or unconditional\n+\t\t * jump.\n+\t\t */\n+\t\ttype = instr[n_instructions - 1].type;\n+\t\tCHECK((type == INSTR_TX) || (type == INSTR_JMP), EINVAL);\n+\t}\n+\n+\tif (a) {\n+\t\tenum instruction_type type;\n+\t\tuint32_t i;\n+\n+\t\t/* Check that there is at least one return or tx instruction. */\n+\t\tfor (i = 0; i < n_instructions; i++) {\n+\t\t\ttype = instr[i].type;\n+\n+\t\t\tif ((type == INSTR_RETURN) || (type == INSTR_TX))\n+\t\t\t\tbreak;\n+\t\t}\n+\t\tCHECK(i < n_instructions, EINVAL);\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int\n instruction_config(struct rte_swx_pipeline *p,\n \t\t   struct action *a,\n@@ -5701,6 +5748,10 @@ instruction_config(struct rte_swx_pipeline *p,\n \tif (err)\n \t\tgoto error;\n \n+\terr = instr_verify(p, a, instr, data, n_instructions);\n+\tif (err)\n+\t\tgoto error;\n+\n \terr = instr_jmp_resolve(instr, data, n_instructions);\n \tif (err)\n \t\tgoto error;\n",
    "prefixes": [
        "v4",
        "27/41"
    ]
}