get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 115474,
    "url": "http://patchwork.dpdk.org/api/patches/115474/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20220826112127.1580044-4-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": "<20220826112127.1580044-4-cristian.dumitrescu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220826112127.1580044-4-cristian.dumitrescu@intel.com",
    "date": "2022-08-26T11:21:23",
    "name": "[V2,3/7] pipeline: add table entry ID read instruction",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "3dc9fbc63e7653b10382d51afff6f19695f85c4c",
    "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/20220826112127.1580044-4-cristian.dumitrescu@intel.com/mbox/",
    "series": [
        {
            "id": 24427,
            "url": "http://patchwork.dpdk.org/api/series/24427/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=24427",
            "date": "2022-08-26T11:21:20",
            "name": "pipeline: support direct registers and meters",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/24427/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/115474/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/115474/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 85232A0555;\n\tFri, 26 Aug 2022 13:21:48 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 92AE840146;\n\tFri, 26 Aug 2022 13:21:36 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id 847BF40A80\n for <dev@dpdk.org>; Fri, 26 Aug 2022 13:21:32 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 26 Aug 2022 04:21:31 -0700",
            "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com.) ([10.237.223.157])\n by fmsmga004.fm.intel.com with ESMTP; 26 Aug 2022 04:21:31 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1661512892; x=1693048892;\n h=from:to:subject:date:message-id:in-reply-to:references:\n mime-version:content-transfer-encoding;\n bh=c5YHVF51WVwQBQOJ5eVbyFRUuGco+5s4B9CoVKSTnjw=;\n b=PJQG7i1+2MlR1c24d7w0xh3tGfcB+gr/S+QRHlVarbtuac9KKhfnz19/\n ntl4LRFZxVEVYs5erDk+MgXMmuaMR0Ugkuk+j56hh+K5JQ24YVAwefQNp\n FOrgNn9/tBImcPpuCBDgBax2QRU7y5HE1osx46RvxWaI3WHyNh/H5EkQD\n 4R+onji/mvKcYbUgGUAlGgewrgLg7cza2/ym3iM9+Ia0+WHaW1xz7/c5c\n M57dbjSe3Ksn941mw9zmc1VV9thf8wPORB4Wjq7ZdQWizlfIlXXNiqgbi\n +CYlaA25d9lUvaYhfIPuTDkxpIcLpujibboJfpXd72MIUgHuHF71iKpxv w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10450\"; a=\"295264077\"",
            "E=Sophos;i=\"5.93,265,1654585200\"; d=\"scan'208\";a=\"295264077\"",
            "E=Sophos;i=\"5.93,265,1654585200\"; d=\"scan'208\";a=\"678834800\""
        ],
        "X-ExtLoop1": "1",
        "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "To": "dev@dpdk.org",
        "Subject": "[PATCH V2 3/7] pipeline: add table entry ID read instruction",
        "Date": "Fri, 26 Aug 2022 11:21:23 +0000",
        "Message-Id": "<20220826112127.1580044-4-cristian.dumitrescu@intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20220826112127.1580044-1-cristian.dumitrescu@intel.com>",
        "References": "<20220826103605.1579589-1-cristian.dumitrescu@intel.com>\n <20220826112127.1580044-1-cristian.dumitrescu@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "Add the entry ID instruction that reads the entry ID of the latest\ntable lookup operation from the pipeline into the meta-data. The entry\nID is then used by the register and meter instructions as the index\ninto the register or meter array.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\n lib/pipeline/rte_swx_pipeline.c          | 68 ++++++++++++++++++++++++\n lib/pipeline/rte_swx_pipeline_internal.h | 20 +++++++\n 2 files changed, 88 insertions(+)",
    "diff": "diff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c\nindex 80108b8916..ec8268b7f8 100644\n--- a/lib/pipeline/rte_swx_pipeline.c\n+++ b/lib/pipeline/rte_swx_pipeline.c\n@@ -2834,6 +2834,43 @@ instr_forget_exec(struct rte_swx_pipeline *p)\n \tthread_ip_inc(p);\n }\n \n+/*\n+ * entryid.\n+ */\n+static int\n+instr_entryid_translate(struct rte_swx_pipeline *p,\n+\t\t\tstruct action *action __rte_unused,\n+\t\t\tchar **tokens,\n+\t\t\tint n_tokens,\n+\t\t\tstruct instruction *instr,\n+\t\t\tstruct instruction_data *data __rte_unused)\n+{\n+\tstruct field *f;\n+\n+\tCHECK(n_tokens == 2, EINVAL);\n+\n+\tf = metadata_field_parse(p, tokens[1]);\n+\tCHECK(f, EINVAL);\n+\tCHECK(f->n_bits <= 64, EINVAL);\n+\n+\tinstr->type = INSTR_ENTRYID;\n+\tinstr->mov.dst.n_bits = f->n_bits;\n+\tinstr->mov.dst.offset = f->offset / 8;\n+\treturn 0;\n+}\n+\n+static inline void\n+instr_entryid_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_entryid_exec(p, t, ip);\n+\n+\t/* Thread. */\n+\tthread_ip_inc(p);\n+}\n+\n /*\n  * extern.\n  */\n@@ -6336,6 +6373,14 @@ instr_translate(struct rte_swx_pipeline *p,\n \t\t\t\t\t      instr,\n \t\t\t\t\t      data);\n \n+\tif (!strcmp(tokens[tpos], \"entryid\"))\n+\t\treturn instr_entryid_translate(p,\n+\t\t\t\t\t       action,\n+\t\t\t\t\t       &tokens[tpos],\n+\t\t\t\t\t       n_tokens - tpos,\n+\t\t\t\t\t       instr,\n+\t\t\t\t\t       data);\n+\n \tif (!strcmp(tokens[tpos], \"extern\"))\n \t\treturn instr_extern_translate(p,\n \t\t\t\t\t      action,\n@@ -7321,6 +7366,8 @@ static instr_exec_t instruction_table[] = {\n \t[INSTR_LEARNER_REARM] = instr_rearm_exec,\n \t[INSTR_LEARNER_REARM_NEW] = instr_rearm_new_exec,\n \t[INSTR_LEARNER_FORGET] = instr_forget_exec,\n+\t[INSTR_ENTRYID] = instr_entryid_exec,\n+\n \t[INSTR_EXTERN_OBJ] = instr_extern_obj_exec,\n \t[INSTR_EXTERN_FUNC] = instr_extern_func_exec,\n \t[INSTR_HASH_FUNC] = instr_hash_func_exec,\n@@ -11222,6 +11269,7 @@ instr_type_to_name(struct instruction *instr)\n \tcase INSTR_LEARNER_REARM: return \"INSTR_LEARNER_REARM\";\n \tcase INSTR_LEARNER_REARM_NEW: return \"INSTR_LEARNER_REARM_NEW\";\n \tcase INSTR_LEARNER_FORGET: return \"INSTR_LEARNER_FORGET\";\n+\tcase INSTR_ENTRYID: return \"INSTR_ENTRYID\";\n \n \tcase INSTR_EXTERN_OBJ: return \"INSTR_EXTERN_OBJ\";\n \tcase INSTR_EXTERN_FUNC: return \"INSTR_EXTERN_FUNC\";\n@@ -11922,6 +11970,24 @@ instr_forget_export(struct instruction *instr, FILE *f)\n \t\tinstr_type_to_name(instr));\n }\n \n+static void\n+instr_entryid_export(struct instruction *instr, FILE *f)\n+{\n+\tfprintf(f,\n+\t\t\"\\t{\\n\"\n+\t\t\"\\t\\t.type = %s,\\n\"\n+\t\t\"\\t\\t.mov = {\\n\"\n+\t\t\"\\t\\t\\t.dst = {\\n\"\n+\t\t\"\\t\\t\\t\\t.n_bits = %u,\\n\"\n+\t\t\"\\t\\t\\t\\t.offset = %u,\\n\"\n+\t\t\"\\t\\t\\t},\\n\"\n+\t\t\"\\t\\t},\\n\"\n+\t\t\"\\t},\\n\",\n+\t\tinstr_type_to_name(instr),\n+\t\tinstr->mov.dst.n_bits,\n+\t\tinstr->mov.dst.offset);\n+}\n+\n static void\n instr_extern_export(struct instruction *instr, FILE *f)\n {\n@@ -12212,6 +12278,7 @@ static instruction_export_t export_table[] = {\n \t[INSTR_LEARNER_REARM] = instr_rearm_export,\n \t[INSTR_LEARNER_REARM_NEW] = instr_rearm_export,\n \t[INSTR_LEARNER_FORGET] = instr_forget_export,\n+\t[INSTR_ENTRYID] = instr_entryid_export,\n \n \t[INSTR_EXTERN_OBJ] = instr_extern_export,\n \t[INSTR_EXTERN_FUNC] = instr_extern_export,\n@@ -12438,6 +12505,7 @@ instr_type_to_func(struct instruction *instr)\n \tcase INSTR_LEARNER_REARM: return \"__instr_rearm_exec\";\n \tcase INSTR_LEARNER_REARM_NEW: return \"__instr_rearm_new_exec\";\n \tcase INSTR_LEARNER_FORGET: return \"__instr_forget_exec\";\n+\tcase INSTR_ENTRYID: return \"__instr_entryid_exec\";\n \n \tcase INSTR_EXTERN_OBJ: return NULL;\n \tcase INSTR_EXTERN_FUNC: return NULL;\ndiff --git a/lib/pipeline/rte_swx_pipeline_internal.h b/lib/pipeline/rte_swx_pipeline_internal.h\nindex 8f96b67d76..335506039b 100644\n--- a/lib/pipeline/rte_swx_pipeline_internal.h\n+++ b/lib/pipeline/rte_swx_pipeline_internal.h\n@@ -504,6 +504,11 @@ enum instruction_type {\n \t/* forget */\n \tINSTR_LEARNER_FORGET,\n \n+\t/* entryid m.table_entry_id\n+\t * Read the internal table entry ID into the specified meta-data field.\n+\t */\n+\tINSTR_ENTRYID,\n+\n \t/* extern e.obj.func */\n \tINSTR_EXTERN_OBJ,\n \n@@ -2377,6 +2382,21 @@ __instr_forget_exec(struct rte_swx_pipeline *p,\n \tstats->n_pkts_forget += 1;\n }\n \n+/*\n+ * entryid.\n+ */\n+static inline void\n+__instr_entryid_exec(struct rte_swx_pipeline *p __rte_unused,\n+\t\t       struct thread *t,\n+\t\t       const struct instruction *ip)\n+{\n+\tTRACE(\"[Thread %2u]: entryid\\n\",\n+\t      p->thread_id);\n+\n+\t/* Meta-data. */\n+\tMETADATA_WRITE(t, ip->mov.dst.offset, ip->mov.dst.n_bits, t->entry_id);\n+}\n+\n /*\n  * extern.\n  */\n",
    "prefixes": [
        "V2",
        "3/7"
    ]
}