get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 115476,
    "url": "http://patchwork.dpdk.org/api/patches/115476/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20220826112127.1580044-6-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-6-cristian.dumitrescu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220826112127.1580044-6-cristian.dumitrescu@intel.com",
    "date": "2022-08-26T11:21:25",
    "name": "[V2,5/7] pipeline: support direct meters on the control path",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "75422150d6b13c7f72ea49c0948f959af6db0dd4",
    "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-6-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/115476/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/115476/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 8B856A0555;\n\tFri, 26 Aug 2022 13:21:58 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 37A8542826;\n\tFri, 26 Aug 2022 13:21:38 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id 7F97940A80\n for <dev@dpdk.org>; Fri, 26 Aug 2022 13:21:33 +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:33 -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:32 -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=1661512893; x=1693048893;\n h=from:to:subject:date:message-id:in-reply-to:references:\n mime-version:content-transfer-encoding;\n bh=BsP9tFH10us3y0x4ESy4voEddYGI/h2vii2wf5Qjvfg=;\n b=a30LKsCiHlp/JkRNrHJmGu+wDDNev8w5zgxUZ+IEdhQbS31JDVLj85Ax\n SY3/VcmCUizv24wHipMpVXu+R09p51v0KN2GN8uFD9G4/aRnBJHfxu9JA\n 9TW19r8FT2mQzZcnqpTKuwEUIlnEZGg0FAhukEb40Xun0vKuhSdst0lKO\n mIKRZVunDIxzg/sdT4nXqOGtqoZnIqQDHxVBGGPzWOYL1Sx7iWAuvilT2\n BGGiXhSHDsMUeFf1NvWyz1f0/qvYkvHTiE2TV2W42kGosJ0ZAj6/Wyf+Z\n AokphrNf6UhTZuLxbMIiASqSXkp7d7y8XGI30cpoMI9uD+ehPQ0yMW+rO g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10450\"; a=\"295264082\"",
            "E=Sophos;i=\"5.93,265,1654585200\"; d=\"scan'208\";a=\"295264082\"",
            "E=Sophos;i=\"5.93,265,1654585200\"; d=\"scan'208\";a=\"678834807\""
        ],
        "X-ExtLoop1": "1",
        "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "To": "dev@dpdk.org",
        "Subject": "[PATCH V2 5/7] pipeline: support direct meters on the control path",
        "Date": "Fri, 26 Aug 2022 11:21:25 +0000",
        "Message-Id": "<20220826112127.1580044-6-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 pipeline control path API to manage direct meters. These meters\nare identified by a table key, whose entry ID is used as the index\ninto the meter array.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\n lib/pipeline/rte_swx_ctl.h      | 81 +++++++++++++++++++++++++++++++++\n lib/pipeline/rte_swx_pipeline.c | 50 ++++++++++++++++++++\n lib/pipeline/version.map        |  3 ++\n 3 files changed, 134 insertions(+)",
    "diff": "diff --git a/lib/pipeline/rte_swx_ctl.h b/lib/pipeline/rte_swx_ctl.h\nindex 1b47820441..2eb51b2c76 100644\n--- a/lib/pipeline/rte_swx_ctl.h\n+++ b/lib/pipeline/rte_swx_ctl.h\n@@ -1440,6 +1440,87 @@ rte_swx_ctl_meter_stats_read(struct rte_swx_pipeline *p,\n \t\t\t     uint32_t metarray_index,\n \t\t\t     struct rte_swx_ctl_meter_stats *stats);\n \n+/**\n+ * Meter reset with table key lookup\n+ *\n+ * Reset a meter within a given meter array to use the default profile that\n+ * causes all the input packets to be colored as green. It is the responsibility\n+ * of the control plane to make sure this meter is not used by the data plane\n+ * pipeline before calling this function.\n+ *\n+ * @param[in] p\n+ *   Pipeline handle.\n+ * @param[in] metarray_name\n+ *   Meter array name.\n+ * @param[in] table_name\n+ *   Regular or learner table name.\n+ * @param[in] table_key\n+ *   Table key.\n+ * @return\n+ *   0 on success or the following error codes otherwise:\n+ *   -EINVAL: Invalid argument.\n+ */\n+__rte_experimental\n+int\n+rte_swx_ctl_meter_reset_with_key(struct rte_swx_pipeline *p,\n+\t\t\t\t const char *metarray_name,\n+\t\t\t\t const char *table_name,\n+\t\t\t\t uint8_t *table_key);\n+\n+/**\n+ * Meter set with table key lookup\n+ *\n+ * Set a meter within a given meter array to use a specific profile. It is the\n+ * responsibility of the control plane to make sure this meter is not used by\n+ * the data plane pipeline before calling this function.\n+ *\n+ * @param[in] p\n+ *   Pipeline handle.\n+ * @param[in] metarray_name\n+ *   Meter array name.\n+ * @param[in] table_name\n+ *   Regular or learner table name.\n+ * @param[in] table_key\n+ *   Table key.\n+ * @param[in] profile_name\n+ *   Existing meter profile name.\n+ * @return\n+ *   0 on success or the following error codes otherwise:\n+ *   -EINVAL: Invalid argument.\n+ */\n+__rte_experimental\n+int\n+rte_swx_ctl_meter_set_with_key(struct rte_swx_pipeline *p,\n+\t\t\t       const char *metarray_name,\n+\t\t\t       const char *table_name,\n+\t\t\t       uint8_t *table_key,\n+\t\t\t       const char *profile_name);\n+\n+/**\n+ * Meter statistics counters read with table key lookup\n+ *\n+ * @param[in] p\n+ *   Pipeline handle.\n+ * @param[in] metarray_name\n+ *   Meter array name.\n+ * @param[in] table_name\n+ *   Regular or learner table name.\n+ * @param[in] table_key\n+ *   Table key.\n+ * @param[out] stats\n+ *   Meter statistics counters.\n+ * @return\n+ *   0 on success or the following error codes otherwise:\n+ *   -EINVAL: Invalid argument.\n+ */\n+__rte_experimental\n+int\n+rte_swx_ctl_meter_stats_read_with_key(struct rte_swx_pipeline *p,\n+\t\t\t\t      const char *metarray_name,\n+\t\t\t\t      const char *table_name,\n+\t\t\t\t      uint8_t *table_key,\n+\t\t\t\t      struct rte_swx_ctl_meter_stats *stats);\n+\n /**\n  * Pipeline control free\n  *\ndiff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c\nindex e726bf1575..4b1b311093 100644\n--- a/lib/pipeline/rte_swx_pipeline.c\n+++ b/lib/pipeline/rte_swx_pipeline.c\n@@ -11315,6 +11315,56 @@ rte_swx_ctl_pipeline_regarray_write_with_key(struct rte_swx_pipeline *p,\n \treturn rte_swx_ctl_pipeline_regarray_write(p, regarray_name, entry_id, value);\n }\n \n+int\n+rte_swx_ctl_meter_reset_with_key(struct rte_swx_pipeline *p,\n+\t\t\t\t const char *metarray_name,\n+\t\t\t\t const char *table_name,\n+\t\t\t\t uint8_t *table_key)\n+{\n+\tsize_t entry_id = 0;\n+\tint status;\n+\n+\tstatus = rte_swx_ctl_pipeline_table_entry_id_get(p, table_name, table_key, &entry_id);\n+\tif (status)\n+\t\treturn status;\n+\n+\treturn rte_swx_ctl_meter_reset(p, metarray_name, entry_id);\n+}\n+\n+int\n+rte_swx_ctl_meter_set_with_key(struct rte_swx_pipeline *p,\n+\t\t\t       const char *metarray_name,\n+\t\t\t       const char *table_name,\n+\t\t\t       uint8_t *table_key,\n+\t\t\t       const char *profile_name)\n+{\n+\tsize_t entry_id = 0;\n+\tint status;\n+\n+\tstatus = rte_swx_ctl_pipeline_table_entry_id_get(p, table_name, table_key, &entry_id);\n+\tif (status)\n+\t\treturn status;\n+\n+\treturn rte_swx_ctl_meter_set(p, metarray_name, entry_id, profile_name);\n+}\n+\n+int\n+rte_swx_ctl_meter_stats_read_with_key(struct rte_swx_pipeline *p,\n+\t\t\t\t      const char *metarray_name,\n+\t\t\t\t      const char *table_name,\n+\t\t\t\t      uint8_t *table_key,\n+\t\t\t\t      struct rte_swx_ctl_meter_stats *stats)\n+{\n+\tsize_t entry_id = 0;\n+\tint status;\n+\n+\tstatus = rte_swx_ctl_pipeline_table_entry_id_get(p, table_name, table_key, &entry_id);\n+\tif (status)\n+\t\treturn status;\n+\n+\treturn rte_swx_ctl_meter_stats_read(p, metarray_name, entry_id, stats);\n+}\n+\n /*\n  * Pipeline compilation.\n  */\ndiff --git a/lib/pipeline/version.map b/lib/pipeline/version.map\nindex 8ed92042d6..f53a037edf 100644\n--- a/lib/pipeline/version.map\n+++ b/lib/pipeline/version.map\n@@ -146,6 +146,9 @@ EXPERIMENTAL {\n \trte_swx_pipeline_hash_func_register;\n \n \t#added in 22.11\n+\trte_swx_ctl_meter_reset_with_key;\n+\trte_swx_ctl_meter_set_with_key;\n+\trte_swx_ctl_meter_stats_read_with_key;\n \trte_swx_ctl_pipeline_find;\n \trte_swx_ctl_pipeline_regarray_read_with_key;\n \trte_swx_ctl_pipeline_regarray_write_with_key;\n",
    "prefixes": [
        "V2",
        "5/7"
    ]
}