get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 104722,
    "url": "http://patchwork.dpdk.org/api/patches/104722/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20211127000254.36148-1-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": "<20211127000254.36148-1-cristian.dumitrescu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211127000254.36148-1-cristian.dumitrescu@intel.com",
    "date": "2021-11-27T00:02:51",
    "name": "[V2,1/4] pipeline: improve the drop instruction",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "ca52808eb86a66d464d90dab6c36d9865a3870e6",
    "submitter": {
        "id": 19,
        "url": "http://patchwork.dpdk.org/api/people/19/?format=api",
        "name": "Cristian Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20211127000254.36148-1-cristian.dumitrescu@intel.com/mbox/",
    "series": [
        {
            "id": 20794,
            "url": "http://patchwork.dpdk.org/api/series/20794/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=20794",
            "date": "2021-11-27T00:02:51",
            "name": "[V2,1/4] pipeline: improve the drop instruction",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/20794/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/104722/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/104722/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 8D9A0A0C43;\n\tSat, 27 Nov 2021 01:02:59 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 1830D40C35;\n\tSat, 27 Nov 2021 01:02:59 +0100 (CET)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by mails.dpdk.org (Postfix) with ESMTP id 5B7114068A\n for <dev@dpdk.org>; Sat, 27 Nov 2021 01:02:56 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 26 Nov 2021 16:02:56 -0800",
            "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com) ([10.237.223.107])\n by fmsmga001.fm.intel.com with ESMTP; 26 Nov 2021 16:02:55 -0800"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10180\"; a=\"215751233\"",
            "E=Sophos;i=\"5.87,267,1631602800\"; d=\"scan'208\";a=\"215751233\"",
            "E=Sophos;i=\"5.87,267,1631602800\"; d=\"scan'208\";a=\"652292971\""
        ],
        "X-ExtLoop1": "1",
        "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "yogesh.jangra@intel.com",
        "Subject": "[PATCH V2 1/4] pipeline: improve the drop instruction",
        "Date": "Sat, 27 Nov 2021 00:02:51 +0000",
        "Message-Id": "<20211127000254.36148-1-cristian.dumitrescu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20211126235129.35781-1-cristian.dumitrescu@intel.com>",
        "References": "<20211126235129.35781-1-cristian.dumitrescu@intel.com>",
        "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"
    },
    "content": "The output port to be used as the drop port is now determined when the\ndrop instruction is executed as opposed to being statically determined\nat instruction translation time and hardcoded in the opcode.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\nSigned-off-by: Yogesh Jangra <yogesh.jangra@intel.com>:\n---\n lib/pipeline/rte_swx_pipeline.c          | 38 ++++++++++++++++++------\n lib/pipeline/rte_swx_pipeline_internal.h | 20 +++++++++++++\n 2 files changed, 49 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c\nindex 2145ca0a42..ff2fe964a5 100644\n--- a/lib/pipeline/rte_swx_pipeline.c\n+++ b/lib/pipeline/rte_swx_pipeline.c\n@@ -1370,6 +1370,7 @@ instruction_is_tx(enum instruction_type type)\n \tswitch (type) {\n \tcase INSTR_TX:\n \tcase INSTR_TX_I:\n+\tcase INSTR_DROP:\n \t\treturn 1;\n \n \tdefault:\n@@ -1383,6 +1384,7 @@ instruction_does_tx(struct instruction *instr)\n \tswitch (instr->type) {\n \tcase INSTR_TX:\n \tcase INSTR_TX_I:\n+\tcase INSTR_DROP:\n \tcase INSTR_HDR_EMIT_TX:\n \tcase INSTR_HDR_EMIT2_TX:\n \tcase INSTR_HDR_EMIT3_TX:\n@@ -1591,7 +1593,7 @@ instr_tx_translate(struct rte_swx_pipeline *p,\n }\n \n static int\n-instr_drop_translate(struct rte_swx_pipeline *p,\n+instr_drop_translate(struct rte_swx_pipeline *p __rte_unused,\n \t\t     struct action *action __rte_unused,\n \t\t     char **tokens __rte_unused,\n \t\t     int n_tokens,\n@@ -1600,9 +1602,8 @@ instr_drop_translate(struct rte_swx_pipeline *p,\n {\n \tCHECK(n_tokens == 1, EINVAL);\n \n-\t/* TX_I. */\n-\tinstr->type = INSTR_TX_I;\n-\tinstr->io.io.val = p->n_ports_out - 1;\n+\t/* DROP. */\n+\tinstr->type = INSTR_DROP;\n \treturn 0;\n }\n \n@@ -1632,6 +1633,19 @@ instr_tx_i_exec(struct rte_swx_pipeline *p)\n \tinstr_rx_exec(p);\n }\n \n+static inline void\n+instr_drop_exec(struct rte_swx_pipeline *p)\n+{\n+\tstruct thread *t = &p->threads[p->thread_id];\n+\tstruct instruction *ip = t->ip;\n+\n+\t__instr_drop_exec(p, t, ip);\n+\n+\t/* Thread. */\n+\tthread_ip_reset(p, t);\n+\tinstr_rx_exec(p);\n+}\n+\n /*\n  * extract.\n  */\n@@ -6199,7 +6213,7 @@ instr_pattern_emit_many_tx_search(struct instruction *instr,\n \tif (!i)\n \t\treturn 0;\n \n-\tif (!instruction_is_tx(instr[i].type))\n+\tif (instr[i].type != INSTR_TX)\n \t\treturn 0;\n \n \tif (data[i].n_users)\n@@ -6643,6 +6657,7 @@ static instr_exec_t instruction_table[] = {\n \t[INSTR_RX] = instr_rx_exec,\n \t[INSTR_TX] = instr_tx_exec,\n \t[INSTR_TX_I] = instr_tx_i_exec,\n+\t[INSTR_DROP] = instr_drop_exec,\n \n \t[INSTR_HDR_EXTRACT] = instr_hdr_extract_exec,\n \t[INSTR_HDR_EXTRACT2] = instr_hdr_extract2_exec,\n@@ -9901,6 +9916,7 @@ instr_type_to_name(struct instruction *instr)\n \n \tcase INSTR_TX: return \"INSTR_TX\";\n \tcase INSTR_TX_I: return \"INSTR_TX_I\";\n+\tcase INSTR_DROP: return \"INSTR_DROP\";\n \n \tcase INSTR_HDR_EXTRACT: return \"INSTR_HDR_EXTRACT\";\n \tcase INSTR_HDR_EXTRACT2: return \"INSTR_HDR_EXTRACT2\";\n@@ -10126,8 +10142,9 @@ instr_io_export(struct instruction *instr, FILE *f)\n \t\tinstr_type_to_name(instr));\n \n \t/* instr.io. */\n-\tfprintf(f,\n-\t\t\"\\t\\t.io = {\\n\");\n+\tif (n_io || n_io_imm || n_hdrs)\n+\t\tfprintf(f,\n+\t\t\t\"\\t\\t.io = {\\n\");\n \n \t/* instr.io.io. */\n \tif (n_io)\n@@ -10193,8 +10210,9 @@ instr_io_export(struct instruction *instr, FILE *f)\n \t}\n \n \t/* instr.io - closing curly brace. */\n-\tfprintf(f,\n-\t\t\"\\t\\t},\\n\");\n+\tif (n_io || n_io_imm || n_hdrs)\n+\t\tfprintf(f,\n+\t\t\t\"\\t\\t},\\n\");\n \n \t/* instr - closing curly brace. */\n \tfprintf(f,\n@@ -10767,6 +10785,7 @@ static instruction_export_t export_table[] = {\n \n \t[INSTR_TX] = instr_io_export,\n \t[INSTR_TX_I] = instr_io_export,\n+\t[INSTR_DROP] = instr_io_export,\n \n \t[INSTR_HDR_EXTRACT] = instr_io_export,\n \t[INSTR_HDR_EXTRACT2] = instr_io_export,\n@@ -10984,6 +11003,7 @@ instr_type_to_func(struct instruction *instr)\n \n \tcase INSTR_TX: return \"__instr_tx_exec\";\n \tcase INSTR_TX_I: return \"__instr_tx_i_exec\";\n+\tcase INSTR_DROP: return \"__instr_drop_exec\";\n \n \tcase INSTR_HDR_EXTRACT: return \"__instr_hdr_extract_exec\";\n \tcase INSTR_HDR_EXTRACT2: return \"__instr_hdr_extract2_exec\";\ndiff --git a/lib/pipeline/rte_swx_pipeline_internal.h b/lib/pipeline/rte_swx_pipeline_internal.h\nindex 1921fdcd78..2e86383e45 100644\n--- a/lib/pipeline/rte_swx_pipeline_internal.h\n+++ b/lib/pipeline/rte_swx_pipeline_internal.h\n@@ -225,6 +225,7 @@ enum instruction_type {\n \t */\n \tINSTR_TX,   /* port_out = M */\n \tINSTR_TX_I, /* port_out = I */\n+\tINSTR_DROP,\n \n \t/* extract h.header */\n \tINSTR_HDR_EXTRACT,\n@@ -1631,6 +1632,25 @@ __instr_tx_i_exec(struct rte_swx_pipeline *p, struct thread *t, const struct ins\n \tport->pkt_tx(port->obj, pkt);\n }\n \n+static inline void\n+__instr_drop_exec(struct rte_swx_pipeline *p,\n+\t\t  struct thread *t,\n+\t\t  const struct instruction *ip __rte_unused)\n+{\n+\tuint64_t port_id = p->n_ports_out - 1;\n+\tstruct port_out_runtime *port = &p->out[port_id];\n+\tstruct rte_swx_pkt *pkt = &t->pkt;\n+\n+\tTRACE(\"[Thread %2u]: drop 1 pkt\\n\",\n+\t      p->thread_id);\n+\n+\t/* Headers. */\n+\temit_handler(t);\n+\n+\t/* Packet. */\n+\tport->pkt_tx(port->obj, pkt);\n+}\n+\n /*\n  * extract.\n  */\n",
    "prefixes": [
        "V2",
        "1/4"
    ]
}