get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 115464,
    "url": "https://patches.dpdk.org/api/patches/115464/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220826103605.1579589-2-cristian.dumitrescu@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20220826103605.1579589-2-cristian.dumitrescu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220826103605.1579589-2-cristian.dumitrescu@intel.com",
    "date": "2022-08-26T10:35:59",
    "name": "[1/7] table: add entry ID for regular tables",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "3eccf84e29ad6944c4efcb46b89e37528fb690fb",
    "submitter": {
        "id": 19,
        "url": "https://patches.dpdk.org/api/people/19/?format=api",
        "name": "Cristian Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220826103605.1579589-2-cristian.dumitrescu@intel.com/mbox/",
    "series": [
        {
            "id": 24426,
            "url": "https://patches.dpdk.org/api/series/24426/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=24426",
            "date": "2022-08-26T10:35:58",
            "name": "pipeline: support direct registers and meters",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/24426/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/115464/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/115464/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 906F5A0554;\n\tFri, 26 Aug 2022 12:36:16 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4539440146;\n\tFri, 26 Aug 2022 12:36:12 +0200 (CEST)",
            "from mga06.intel.com (mga06b.intel.com [134.134.136.31])\n by mails.dpdk.org (Postfix) with ESMTP id 85B7F40143\n for <dev@dpdk.org>; Fri, 26 Aug 2022 12:36:10 +0200 (CEST)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 26 Aug 2022 03:36:08 -0700",
            "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com.) ([10.237.223.157])\n by fmsmga008.fm.intel.com with ESMTP; 26 Aug 2022 03:36:07 -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=1661510170; x=1693046170;\n h=from:to:subject:date:message-id:in-reply-to:references:\n mime-version:content-transfer-encoding;\n bh=LIe1Db/ahV3Y4yVUVelEXN9T5EjffV0QH1AT7aQtB9I=;\n b=gkdx7dpzhrC9xUKFaQLxl/9HiICAbmkPTiOlNZc3W8u/w2vjGoyhYOtC\n R/VZ8RTWUIeO+yClgnLuV0KIZMSuN0MUFDexm9czqFaHHTx41de0TUFqn\n xDy4j8UmdBLAz+FUCdl5Uqogw5140a+AzpVtdqyJudlGfmATEZ2VA/njI\n fn0xh/2JU3u6sDKrUIiT6/NwVDz6nw+HVXiHUFueMzu0eeiYlzK1+X3PM\n 1ZBIxxw5k1UpNOIJo0tplnwZhYbYRyaYkOTx8S7/gvxW7fiMR5etLs87g\n vRlrUuE5yHoqGSt7jZ7ENO6lzcUt9/gsYsENiytdmIE4bx9QFqCSzbhMl A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10450\"; a=\"356194323\"",
            "E=Sophos;i=\"5.93,265,1654585200\"; d=\"scan'208\";a=\"356194323\"",
            "E=Sophos;i=\"5.93,265,1654585200\"; d=\"scan'208\";a=\"671414277\""
        ],
        "X-ExtLoop1": "1",
        "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "To": "dev@dpdk.org",
        "Subject": "[PATCH 1/7] table: add entry ID for regular tables",
        "Date": "Fri, 26 Aug 2022 10:35:59 +0000",
        "Message-Id": "<20220826103605.1579589-2-cristian.dumitrescu@intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20220826103605.1579589-1-cristian.dumitrescu@intel.com>",
        "References": "<20220826103605.1579589-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 support for unique ID for each table entry. The entry ID is\nretrieved as part of the table lookup operation and is saved by the\npipeline for later use.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\n lib/pipeline/rte_swx_pipeline.c          |  9 +++++++++\n lib/pipeline/rte_swx_pipeline_internal.h |  1 +\n lib/table/rte_swx_table.h                | 13 +++++++++++++\n lib/table/rte_swx_table_em.c             |  5 +++++\n lib/table/rte_swx_table_wm.c             |  2 ++\n 5 files changed, 30 insertions(+)",
    "diff": "diff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c\nindex 1c49622be7..e271cc50eb 100644\n--- a/lib/pipeline/rte_swx_pipeline.c\n+++ b/lib/pipeline/rte_swx_pipeline.c\n@@ -2401,6 +2401,7 @@ instr_table_exec(struct rte_swx_pipeline *p)\n \tstruct table_statistics *stats = &p->table_stats[table_id];\n \tuint64_t action_id, n_pkts_hit, n_pkts_action;\n \tuint8_t *action_data;\n+\tsize_t entry_id;\n \tint done, hit;\n \n \t/* Table. */\n@@ -2409,6 +2410,7 @@ instr_table_exec(struct rte_swx_pipeline *p)\n \t\t\t   table->key,\n \t\t\t   &action_id,\n \t\t\t   &action_data,\n+\t\t\t   &entry_id,\n \t\t\t   &hit);\n \tif (!done) {\n \t\t/* Thread. */\n@@ -2422,6 +2424,7 @@ instr_table_exec(struct rte_swx_pipeline *p)\n \n \taction_id = hit ? action_id : ts->default_action_id;\n \taction_data = hit ? action_data : ts->default_action_data;\n+\tentry_id = hit ? (1 + entry_id) : 0;\n \tn_pkts_hit = stats->n_pkts_hit[hit];\n \tn_pkts_action = stats->n_pkts_action[action_id];\n \n@@ -2433,6 +2436,7 @@ instr_table_exec(struct rte_swx_pipeline *p)\n \n \tt->action_id = action_id;\n \tt->structs[0] = action_data;\n+\tt->entry_id = entry_id;\n \tt->hit = hit;\n \tstats->n_pkts_hit[hit] = n_pkts_hit + 1;\n \tstats->n_pkts_action[action_id] = n_pkts_action + 1;\n@@ -2452,6 +2456,7 @@ instr_table_af_exec(struct rte_swx_pipeline *p)\n \tstruct table_statistics *stats = &p->table_stats[table_id];\n \tuint64_t action_id, n_pkts_hit, n_pkts_action;\n \tuint8_t *action_data;\n+\tsize_t entry_id;\n \taction_func_t action_func;\n \tint done, hit;\n \n@@ -2461,6 +2466,7 @@ instr_table_af_exec(struct rte_swx_pipeline *p)\n \t\t\t   table->key,\n \t\t\t   &action_id,\n \t\t\t   &action_data,\n+\t\t\t   &entry_id,\n \t\t\t   &hit);\n \tif (!done) {\n \t\t/* Thread. */\n@@ -2474,6 +2480,7 @@ instr_table_af_exec(struct rte_swx_pipeline *p)\n \n \taction_id = hit ? action_id : ts->default_action_id;\n \taction_data = hit ? action_data : ts->default_action_data;\n+\tentry_id = hit ? (1 + entry_id) : 0;\n \taction_func = p->action_funcs[action_id];\n \tn_pkts_hit = stats->n_pkts_hit[hit];\n \tn_pkts_action = stats->n_pkts_action[action_id];\n@@ -2486,6 +2493,7 @@ instr_table_af_exec(struct rte_swx_pipeline *p)\n \n \tt->action_id = action_id;\n \tt->structs[0] = action_data;\n+\tt->entry_id = entry_id;\n \tt->hit = hit;\n \tstats->n_pkts_hit[hit] = n_pkts_hit + 1;\n \tstats->n_pkts_action[action_id] = n_pkts_action + 1;\n@@ -8283,6 +8291,7 @@ table_stub_lkp(void *table __rte_unused,\n \t       uint8_t **key __rte_unused,\n \t       uint64_t *action_id __rte_unused,\n \t       uint8_t **action_data __rte_unused,\n+\t       size_t *entry_id __rte_unused,\n \t       int *hit)\n {\n \t*hit = 0;\ndiff --git a/lib/pipeline/rte_swx_pipeline_internal.h b/lib/pipeline/rte_swx_pipeline_internal.h\nindex ef60288dca..8f96b67d76 100644\n--- a/lib/pipeline/rte_swx_pipeline_internal.h\n+++ b/lib/pipeline/rte_swx_pipeline_internal.h\n@@ -1009,6 +1009,7 @@ struct thread {\n \tstruct learner_runtime *learners;\n \tstruct rte_swx_table_state *table_state;\n \tuint64_t action_id;\n+\tsize_t entry_id;\n \tint hit; /* 0 = Miss, 1 = Hit. */\n \tuint32_t learner_id;\n \tuint64_t time;\ndiff --git a/lib/table/rte_swx_table.h b/lib/table/rte_swx_table.h\nindex 4b8dc06798..ac01e19781 100644\n--- a/lib/table/rte_swx_table.h\n+++ b/lib/table/rte_swx_table.h\n@@ -233,6 +233,15 @@ typedef int\n  * data likely to be read from the CPU cache with no CPU pipeline stall, which\n  * significantly improves the table lookup performance.\n  *\n+ * The table entry consists of the action ID and the action data. Each table\n+ * entry is unique, although different table entries can have identical content,\n+ * i.e. same values for the action ID and the action data. The table entry ID is\n+ * also returned by the table lookup operation. It can be used to index into an\n+ * external array of resources such as counters, registers or meters to identify\n+ * the resource directly associated with the current table entry with no need to\n+ * store the corresponding index into the table entry. The index of the external\n+ * resource is thus auto-generated instead of being stored in the table entry.\n+ *\n  * @param[in] table\n  *   Table handle.\n  * @param[in] mailbox\n@@ -247,6 +256,9 @@ typedef int\n  *   Action data for the *action_id* action. Must point to a valid array of\n  *   table *action_data_size* bytes. Only valid when the function returns 1 and\n  *   *hit* is set to true.\n+ * @param[out] entry_id\n+ *   Table entry unique ID. Must point to a valid 32-bit variable. Only valid\n+ *   when the function returns 1 and *hit* is set to true.\n  * @param[out] hit\n  *   Only valid when the function returns 1. Set to non-zero (true) on table\n  *   lookup hit and to zero (false) on table lookup miss.\n@@ -260,6 +272,7 @@ typedef int\n \t\t\t  uint8_t **key,\n \t\t\t  uint64_t *action_id,\n \t\t\t  uint8_t **action_data,\n+\t\t\t  size_t *entry_id,\n \t\t\t  int *hit);\n \n /**\ndiff --git a/lib/table/rte_swx_table_em.c b/lib/table/rte_swx_table_em.c\nindex 568e76e249..2b5201e006 100644\n--- a/lib/table/rte_swx_table_em.c\n+++ b/lib/table/rte_swx_table_em.c\n@@ -403,6 +403,7 @@ table_lookup_unoptimized(void *table,\n \t\t\t uint8_t **key,\n \t\t\t uint64_t *action_id,\n \t\t\t uint8_t **action_data,\n+\t\t\t size_t *entry_id,\n \t\t\t int *hit)\n {\n \tstruct table *t = table;\n@@ -431,6 +432,7 @@ table_lookup_unoptimized(void *table,\n \t\t\t\tbkt_data = table_key_data(t, bkt_key_id);\n \t\t\t\t*action_id = bkt_data[0];\n \t\t\t\t*action_data = (uint8_t *)&bkt_data[1];\n+\t\t\t\t*entry_id = bkt_key_id;\n \t\t\t\t*hit = 1;\n \t\t\t\treturn 1;\n \t\t\t}\n@@ -500,6 +502,7 @@ table_lookup(void *table,\n \t     uint8_t **key,\n \t     uint64_t *action_id,\n \t     uint8_t **action_data,\n+\t     size_t *entry_id,\n \t     int *hit)\n {\n \tstruct table *t = table;\n@@ -576,6 +579,7 @@ table_lookup(void *table,\n \t\tlkp_hit &= m->sig_match;\n \t\t*action_id = bkt_data[0];\n \t\t*action_data = (uint8_t *)&bkt_data[1];\n+\t\t*entry_id = bkt_key_id;\n \t\t*hit = lkp_hit;\n \n \t\tm->state = 0;\n@@ -586,6 +590,7 @@ table_lookup(void *table,\n \t\t\t\t\t\t\tkey,\n \t\t\t\t\t\t\taction_id,\n \t\t\t\t\t\t\taction_data,\n+\t\t\t\t\t\t\tentry_id,\n \t\t\t\t\t\t\thit);\n \n \t\treturn 1;\ndiff --git a/lib/table/rte_swx_table_wm.c b/lib/table/rte_swx_table_wm.c\nindex ce2a78f94c..58afb35d46 100644\n--- a/lib/table/rte_swx_table_wm.c\n+++ b/lib/table/rte_swx_table_wm.c\n@@ -436,6 +436,7 @@ table_lookup(void *table,\n \t     const uint8_t **key,\n \t     uint64_t *action_id,\n \t     uint8_t **action_data,\n+\t     size_t *entry_id,\n \t     int *hit)\n {\n \tstruct table *t = table;\n@@ -451,6 +452,7 @@ table_lookup(void *table,\n \tdata = &t->data[(user_data - 1) * t->entry_data_size];\n \t*action_id = ((uint64_t *)data)[0];\n \t*action_data = &data[8];\n+\t*entry_id = user_data - 1;\n \t*hit = 1;\n \treturn 1;\n }\n",
    "prefixes": [
        "1/7"
    ]
}