get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 88304,
    "url": "https://patches.dpdk.org/api/patches/88304/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210301094000.183002-5-lizh@nvidia.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": "<20210301094000.183002-5-lizh@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210301094000.183002-5-lizh@nvidia.com",
    "date": "2021-03-01T09:40:00",
    "name": "[RFC,v3,4/4] app/testpmd: add meter pps mode cmd",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "5343c508a84da12de89adc501f60a48332a13e20",
    "submitter": {
        "id": 1967,
        "url": "https://patches.dpdk.org/api/people/1967/?format=api",
        "name": "Li Zhang",
        "email": "lizh@nvidia.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210301094000.183002-5-lizh@nvidia.com/mbox/",
    "series": [
        {
            "id": 15414,
            "url": "https://patches.dpdk.org/api/series/15414/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=15414",
            "date": "2021-03-01T09:39:57",
            "name": "adds support PPS(packet per second) on meter",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/15414/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/88304/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/88304/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 1D583A0561;\n\tMon,  1 Mar 2021 10:40:34 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 650AB1CC4DB;\n\tMon,  1 Mar 2021 10:40:18 +0100 (CET)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by mails.dpdk.org (Postfix) with ESMTP id 715B21CC4DA\n for <dev@dpdk.org>; Mon,  1 Mar 2021 10:40:17 +0100 (CET)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n lizh@nvidia.com)\n with SMTP; 1 Mar 2021 11:40:11 +0200",
            "from nvidia.com (c-235-17-1-009.mtl.labs.mlnx [10.235.17.9])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 1219e4VR020473;\n Mon, 1 Mar 2021 11:40:11 +0200"
        ],
        "From": "Li Zhang <lizh@nvidia.com>",
        "To": "dekelp@nvidia.com, orika@nvidia.com, viacheslavo@nvidia.com,\n matan@nvidia.com",
        "Cc": "dev@dpdk.org, thomas@monjalon.net, rasland@nvidia.com,\n mb@smartsharesystems.com, ajit.khaparde@broadcom.com",
        "Date": "Mon,  1 Mar 2021 11:40:00 +0200",
        "Message-Id": "<20210301094000.183002-5-lizh@nvidia.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20210301094000.183002-1-lizh@nvidia.com>",
        "References": "<20210125012023.1769769-2-lizh@nvidia.com>\n <20210301094000.183002-1-lizh@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [RFC v3 4/4] app/testpmd: add meter pps mode cmd",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Support meter pps mode\n\nSigned-off-by: Li Zhang <lizh@nvidia.com>\n---\n app/test-pmd/cmdline.c                      |   4 +\n app/test-pmd/cmdline_mtr.c                  | 105 ++++++++++++++++++++\n app/test-pmd/cmdline_mtr.h                  |   1 +\n doc/guides/testpmd_app_ug/testpmd_funcs.rst |  15 +++\n 4 files changed, 125 insertions(+)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex d274a7cb8c..1a3fc644dc 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -698,6 +698,9 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\"add port meter profile trtcm_rfc4115 (port_id) (profile_id) (cir) (eir) (cbs) (ebs)\\n\"\n \t\t\t\"    meter profile add - trtcm rfc 4115\\n\\n\"\n \n+\t\t\t\"add port meter profile srtcmp (port_id) (profile_id) (cipr) (cpbs) (epbs)\\n\"\n+\t\t\t\"    meter profile add - srtcmp packet per second\\n\\n\"\n+\n \t\t\t\"del port meter profile (port_id) (profile_id)\\n\"\n \t\t\t\"    meter profile delete\\n\\n\"\n \n@@ -17006,6 +17009,7 @@ cmdline_parse_ctx_t main_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_show_port_meter_cap,\n \t(cmdline_parse_inst_t *)&cmd_add_port_meter_profile_srtcm,\n \t(cmdline_parse_inst_t *)&cmd_add_port_meter_profile_trtcm,\n+\t(cmdline_parse_inst_t *)&cmd_add_port_meter_profile_srtcmp,\n \t(cmdline_parse_inst_t *)&cmd_del_port_meter_profile,\n \t(cmdline_parse_inst_t *)&cmd_create_port_meter,\n \t(cmdline_parse_inst_t *)&cmd_enable_port_meter,\ndiff --git a/app/test-pmd/cmdline_mtr.c b/app/test-pmd/cmdline_mtr.c\nindex 399ee56e07..3f62240a0d 100644\n--- a/app/test-pmd/cmdline_mtr.c\n+++ b/app/test-pmd/cmdline_mtr.c\n@@ -295,6 +295,8 @@ static void cmd_show_port_meter_cap_parsed(void *parsed_result,\n \t\tcap.meter_trtcm_rfc2698_n_max);\n \tprintf(\"cap.meter_trtcm_rfc4115_n_max %\" PRIu32 \"\\n\",\n \t\tcap.meter_trtcm_rfc4115_n_max);\n+\tprintf(\"cap.meter_srtcmp_n_max %\" PRIu32 \"\\n\",\n+\t\tcap.meter_srtcmp_n_max);\n \tprintf(\"cap.meter_rate_max %\" PRIu64 \"\\n\", cap.meter_rate_max);\n \tprintf(\"cap.color_aware_srtcm_rfc2697_supported %\" PRId32 \"\\n\",\n \t\tcap.color_aware_srtcm_rfc2697_supported);\n@@ -302,6 +304,8 @@ static void cmd_show_port_meter_cap_parsed(void *parsed_result,\n \t\tcap.color_aware_trtcm_rfc2698_supported);\n \tprintf(\"cap.color_aware_trtcm_rfc4115_supported %\" PRId32 \"\\n\",\n \t\tcap.color_aware_trtcm_rfc4115_supported);\n+\tprintf(\"cap.color_aware_srtcmp_supported %\" PRId32 \"\\n\",\n+\t\tcap.color_aware_srtcmp_supported);\n \tprintf(\"cap.policer_action_recolor_supported %\" PRId32 \"\\n\",\n \t\tcap.policer_action_recolor_supported);\n \tprintf(\"cap.policer_action_drop_supported %\" PRId32 \"\\n\",\n@@ -644,6 +648,107 @@ cmdline_parse_inst_t cmd_add_port_meter_profile_trtcm_rfc4115 = {\n \t},\n };\n \n+/* *** Add Port Meter Profile srtcmp *** */\n+struct cmd_add_port_meter_profile_srtcmp_result {\n+\tcmdline_fixed_string_t add;\n+\tcmdline_fixed_string_t port;\n+\tcmdline_fixed_string_t meter;\n+\tcmdline_fixed_string_t profile;\n+\tcmdline_fixed_string_t srtcmp;\n+\tuint16_t port_id;\n+\tuint32_t profile_id;\n+\tuint64_t cir;\n+\tuint64_t cbs;\n+\tuint64_t ebs;\n+};\n+\n+cmdline_parse_token_string_t cmd_add_port_meter_profile_srtcmp_add =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_meter_profile_srtcmp_result, add, \"add\");\n+cmdline_parse_token_string_t cmd_add_port_meter_profile_srtcmp_port =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_meter_profile_srtcmp_result,\n+\t\t\tport, \"port\");\n+cmdline_parse_token_string_t cmd_add_port_meter_profile_srtcmp_meter =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_meter_profile_srtcmp_result,\n+\t\t\tmeter, \"meter\");\n+cmdline_parse_token_string_t cmd_add_port_meter_profile_srtcmp_profile =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_meter_profile_srtcmp_result,\n+\t\t\tprofile, \"profile\");\n+cmdline_parse_token_string_t cmd_add_port_meter_profile_srtcmp_srtcmp =\n+\tTOKEN_STRING_INITIALIZER(\n+\t\tstruct cmd_add_port_meter_profile_srtcmp_result,\n+\t\t\tsrtcmp, \"srtcmp\");\n+cmdline_parse_token_num_t cmd_add_port_meter_profile_srtcmp_port_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_meter_profile_srtcmp_result,\n+\t\t\tport_id, RTE_UINT16);\n+cmdline_parse_token_num_t cmd_add_port_meter_profile_srtcmp_profile_id =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_meter_profile_srtcmp_result,\n+\t\t\tprofile_id, RTE_UINT32);\n+cmdline_parse_token_num_t cmd_add_port_meter_profile_srtcmp_cir =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_meter_profile_srtcmp_result,\n+\t\t\tcir, RTE_UINT64);\n+cmdline_parse_token_num_t cmd_add_port_meter_profile_srtcmp_cbs =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_meter_profile_srtcmp_result,\n+\t\t\tcbs, RTE_UINT64);\n+cmdline_parse_token_num_t cmd_add_port_meter_profile_srtcmp_ebs =\n+\tTOKEN_NUM_INITIALIZER(\n+\t\tstruct cmd_add_port_meter_profile_srtcmp_result,\n+\t\t\tebs, RTE_UINT64);\n+\n+static void cmd_add_port_meter_profile_srtcmp_parsed(void *parsed_result,\n+\t__rte_unused struct cmdline *cl,\n+\t__rte_unused void *data)\n+{\n+\tstruct cmd_add_port_meter_profile_srtcmp_result *res = parsed_result;\n+\tstruct rte_mtr_meter_profile mp;\n+\tstruct rte_mtr_error error;\n+\tuint32_t profile_id = res->profile_id;\n+\tuint16_t port_id = res->port_id;\n+\tint ret;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\t/* Private shaper profile params */\n+\tmemset(&mp, 0, sizeof(struct rte_mtr_meter_profile));\n+\tmp.alg = RTE_MTR_SRTCMP;\n+\tmp.srtcmp.cir = res->cir;\n+\tmp.srtcmp.cbs = res->cbs;\n+\tmp.srtcmp.ebs = res->ebs;\n+\n+\tret = rte_mtr_meter_profile_add(port_id, profile_id, &mp, &error);\n+\tif (ret != 0) {\n+\t\tprint_err_msg(&error);\n+\t\treturn;\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_add_port_meter_profile_srtcmp = {\n+\t.f = cmd_add_port_meter_profile_srtcmp_parsed,\n+\t.data = NULL,\n+\t.help_str = \"Add port meter profile srtcmp\",\n+\t.tokens = {\n+\t\t(void *)&cmd_add_port_meter_profile_srtcmp_add,\n+\t\t(void *)&cmd_add_port_meter_profile_srtcmp_port,\n+\t\t(void *)&cmd_add_port_meter_profile_srtcmp_meter,\n+\t\t(void *)&cmd_add_port_meter_profile_srtcmp_profile,\n+\t\t(void *)&cmd_add_port_meter_profile_srtcmp_srtcmp,\n+\t\t(void *)&cmd_add_port_meter_profile_srtcmp_port_id,\n+\t\t(void *)&cmd_add_port_meter_profile_srtcmp_profile_id,\n+\t\t(void *)&cmd_add_port_meter_profile_srtcmp_cir,\n+\t\t(void *)&cmd_add_port_meter_profile_srtcmp_cbs,\n+\t\t(void *)&cmd_add_port_meter_profile_srtcmp_ebs,\n+\t\tNULL,\n+\t},\n+};\n+\n /* *** Delete Port Meter Profile *** */\n struct cmd_del_port_meter_profile_result {\n \tcmdline_fixed_string_t del;\ndiff --git a/app/test-pmd/cmdline_mtr.h b/app/test-pmd/cmdline_mtr.h\nindex e69d6da023..01ef85e1e7 100644\n--- a/app/test-pmd/cmdline_mtr.h\n+++ b/app/test-pmd/cmdline_mtr.h\n@@ -10,6 +10,7 @@ extern cmdline_parse_inst_t cmd_show_port_meter_cap;\n extern cmdline_parse_inst_t cmd_add_port_meter_profile_srtcm;\n extern cmdline_parse_inst_t cmd_add_port_meter_profile_trtcm;\n extern cmdline_parse_inst_t cmd_add_port_meter_profile_trtcm_rfc4115;\n+extern cmdline_parse_inst_t cmd_add_port_meter_profile_srtcmp;\n extern cmdline_parse_inst_t cmd_del_port_meter_profile;\n extern cmdline_parse_inst_t cmd_create_port_meter;\n extern cmdline_parse_inst_t cmd_enable_port_meter;\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex 37278d31d6..d11de05583 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -2734,6 +2734,21 @@ where:\n * ``cbs``: Committed burst size (bytes).\n * ``ebs``: Excess burst size (bytes).\n \n+add port meter profile (srTcmp)\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+Add meter profile (srTcmp) to the ethernet device::\n+\n+   testpmd> add port meter profile srtcmp (port_id) (profile_id) \\\n+   (cir) (cbs) (ebs)\n+\n+where:\n+\n+* ``profile_id``: ID for the meter profile.\n+* ``cpr``: Committed Information Rate (CIR) (packets/second).\n+* ``cbs``: Committed Burst Size (CBS) (packets).\n+* ``ebs``: Excess Burst Size (EBS) (packets).\n+\n delete port meter profile\n ~~~~~~~~~~~~~~~~~~~~~~~~~\n \n",
    "prefixes": [
        "RFC",
        "v3",
        "4/4"
    ]
}