get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 48353,
    "url": "http://patches.dpdk.org/api/patches/48353/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/154333209296.44971.3377040475797021434.stgit@dbuild/",
    "project": {
        "id": 1,
        "url": "http://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": "<154333209296.44971.3377040475797021434.stgit@dbuild>",
    "list_archive_url": "https://inbox.dpdk.org/dev/154333209296.44971.3377040475797021434.stgit@dbuild",
    "date": "2018-11-27T15:21:33",
    "name": "[2/3] test/test_meter: update meter test to include RFC4115 meters",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "5338a7840473c1d19cd66ad1de30ee1708d8b2f9",
    "submitter": {
        "id": 672,
        "url": "http://patches.dpdk.org/api/people/672/?format=api",
        "name": "Eelco Chaudron",
        "email": "echaudro@redhat.com"
    },
    "delegate": {
        "id": 10018,
        "url": "http://patches.dpdk.org/api/users/10018/?format=api",
        "username": "cristian_dumitrescu",
        "first_name": "Cristian",
        "last_name": "Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/154333209296.44971.3377040475797021434.stgit@dbuild/mbox/",
    "series": [
        {
            "id": 2581,
            "url": "http://patches.dpdk.org/api/series/2581/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=2581",
            "date": "2018-11-27T15:20:44",
            "name": "lib/librte_meter: add RFC4115 trTCM meter support",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/2581/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/48353/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/48353/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id E58E81B438;\n\tTue, 27 Nov 2018 16:21:38 +0100 (CET)",
            "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby dpdk.org (Postfix) with ESMTP id 2843A1B101\n\tfor <dev@dpdk.org>; Tue, 27 Nov 2018 16:21:37 +0100 (CET)",
            "from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 66A19308339A;\n\tTue, 27 Nov 2018 15:21:36 +0000 (UTC)",
            "from localhost.localdomain (ovpn-116-193.ams2.redhat.com\n\t[10.36.116.193])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id A56412CE56;\n\tTue, 27 Nov 2018 15:21:35 +0000 (UTC)"
        ],
        "From": "Eelco Chaudron <echaudro@redhat.com>",
        "To": "cristian.dumitrescu@intel.com",
        "Cc": "dev@dpdk.org",
        "Date": "Tue, 27 Nov 2018 15:21:33 +0000",
        "Message-Id": "<154333209296.44971.3377040475797021434.stgit@dbuild>",
        "In-Reply-To": "<154333204294.44971.12989297399338053044.stgit@dbuild>",
        "References": "<154333204294.44971.12989297399338053044.stgit@dbuild>",
        "User-Agent": "StGit/unknown-version",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.16",
        "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.44]); Tue, 27 Nov 2018 15:21:36 +0000 (UTC)",
        "Subject": "[dpdk-dev] [PATCH 2/3] test/test_meter: update meter test to\n\tinclude RFC4115 meters",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Add test cases for RFC4115 meters\n\nSigned-off-by: Eelco Chaudron <echaudro@redhat.com>\n---\n test/test/test_meter.c |  212 ++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 212 insertions(+)",
    "diff": "diff --git a/test/test/test_meter.c b/test/test/test_meter.c\nindex 8bb47e75c..097da0143 100644\n--- a/test/test/test_meter.c\n+++ b/test/test/test_meter.c\n@@ -32,8 +32,10 @@\n \n #define TM_TEST_TRTCM_CIR_DF 46000000\n #define TM_TEST_TRTCM_PIR_DF 69000000\n+#define TM_TEST_TRTCM_EIR_DF 69000000\n #define TM_TEST_TRTCM_CBS_DF 2048\n #define TM_TEST_TRTCM_PBS_DF 4096\n+#define TM_TEST_TRTCM_EBS_DF 4096\n \n static struct rte_meter_srtcm_params sparams =\n \t\t\t\t{.cir = TM_TEST_SRTCM_CIR_DF,\n@@ -46,6 +48,12 @@ static struct\trte_meter_trtcm_params tparams=\n \t\t\t\t .cbs = TM_TEST_TRTCM_CBS_DF,\n \t\t\t\t .pbs = TM_TEST_TRTCM_PBS_DF,};\n \n+static struct rte_meter_trtcm_params rfc4115params =\n+\t\t\t\t{.cir = TM_TEST_TRTCM_CIR_DF,\n+\t\t\t\t .eir = TM_TEST_TRTCM_EIR_DF,\n+\t\t\t\t .cbs = TM_TEST_TRTCM_CBS_DF,\n+\t\t\t\t .ebs = TM_TEST_TRTCM_EBS_DF,};\n+\n /**\n  * functional test for rte_meter_srtcm_config\n  */\n@@ -148,6 +156,45 @@ tm_test_trtcm_config(void)\n \treturn 0;\n }\n \n+/**\n+ * functional test for rte_meter_trtcm_rfc4115_config\n+ */\n+static inline int\n+tm_test_trtcm_rfc4115_config(void)\n+{\n+\tstruct rte_meter_trtcm_profile tp;\n+\tstruct  rte_meter_trtcm_params rfc4115params1;\n+#define TRTCM_RFC4115_CFG_MSG \"trtcm_rfc4115_config\"\n+\n+\t/* invalid parameter test */\n+\tif (rte_meter_trtcm_rfc4115_profile_config(NULL, NULL) == 0)\n+\t\tmelog(TRTCM_RFC4115_CFG_MSG);\n+\tif (rte_meter_trtcm_rfc4115_profile_config(&tp, NULL) == 0)\n+\t\tmelog(TRTCM_RFC4115_CFG_MSG);\n+\tif (rte_meter_trtcm_rfc4115_profile_config(NULL, &rfc4115params) == 0)\n+\t\tmelog(TRTCM_RFC4115_CFG_MSG);\n+\n+\t/*\n+\t * cbs and pbs should be none-zero if cir and eir are none-zero\n+\t * respectively\n+\t */\n+\trfc4115params1 = rfc4115params;\n+\trfc4115params1.cbs = 0;\n+\tif (rte_meter_trtcm_profile_config(&tp, &rfc4115params1) == 0)\n+\t\tmelog(TRTCM_RFC4115_CFG_MSG);\n+\n+\trfc4115params1 = rfc4115params;\n+\trfc4115params1.pbs = 0;\n+\tif (rte_meter_trtcm_profile_config(&tp, &rfc4115params1) == 0)\n+\t\tmelog(TRTCM_RFC4115_CFG_MSG);\n+\n+\t/* usual parameter, should be successful */\n+\tif (rte_meter_trtcm_profile_config(&tp, &rfc4115params) != 0)\n+\t\tmelog(TRTCM_RFC4115_CFG_MSG);\n+\n+\treturn 0;\n+}\n+\n /**\n  * functional test for rte_meter_srtcm_color_blind_check\n  */\n@@ -265,6 +312,65 @@ tm_test_trtcm_color_blind_check(void)\n \treturn 0;\n }\n \n+/**\n+ * functional test for rte_meter_trtcm_rfc4115_color_blind_check\n+ */\n+static inline int\n+tm_test_trtcm_rfc4115_color_blind_check(void)\n+{\n+#define TRTCM_RFC4115_BLIND_CHECK_MSG \"trtcm_rfc4115_blind_check\"\n+\n+\tuint64_t time;\n+\tstruct rte_meter_trtcm_profile tp;\n+\tstruct rte_meter_trtcm tm;\n+\tuint64_t hz = rte_get_tsc_hz();\n+\n+\t/* Test green */\n+\tif (rte_meter_trtcm_rfc4115_profile_config(&tp, &rfc4115params) != 0)\n+\t\tmelog(TRTCM_RFC4115_BLIND_CHECK_MSG);\n+\tif (rte_meter_trtcm_rfc4115_config(&tm, &tp) != 0)\n+\t\tmelog(TRTCM_RFC4115_BLIND_CHECK_MSG);\n+\ttime = rte_get_tsc_cycles() + hz;\n+\tif (rte_meter_trtcm_rfc4115_color_blind_check(\n+\t\t&tm, &tp, time, TM_TEST_TRTCM_CBS_DF - 1)\n+\t\t!= e_RTE_METER_GREEN)\n+\t\tmelog(TRTCM_RFC4115_BLIND_CHECK_MSG\" GREEN\");\n+\n+\t/* Test yellow */\n+\tif (rte_meter_trtcm_rfc4115_profile_config(&tp, &rfc4115params) != 0)\n+\t\tmelog(TRTCM_RFC4115_BLIND_CHECK_MSG);\n+\tif (rte_meter_trtcm_rfc4115_config(&tm, &tp) != 0)\n+\t\tmelog(TRTCM_RFC4115_BLIND_CHECK_MSG);\n+\ttime = rte_get_tsc_cycles() + hz;\n+\tif (rte_meter_trtcm_rfc4115_color_blind_check(\n+\t\t&tm, &tp, time, TM_TEST_TRTCM_CBS_DF + 1)\n+\t\t!= e_RTE_METER_YELLOW)\n+\t\tmelog(TRTCM_RFC4115_BLIND_CHECK_MSG\" YELLOW\");\n+\n+\tif (rte_meter_trtcm_rfc4115_profile_config(&tp, &rfc4115params) != 0)\n+\t\tmelog(TRTCM_RFC4115_BLIND_CHECK_MSG);\n+\tif (rte_meter_trtcm_rfc4115_config(&tm, &tp) != 0)\n+\t\tmelog(TRTCM_RFC4115_BLIND_CHECK_MSG);\n+\ttime = rte_get_tsc_cycles() + hz;\n+\tif (rte_meter_trtcm_rfc4115_color_blind_check(\n+\t\t&tm, &tp, time, TM_TEST_TRTCM_EBS_DF - 1)\n+\t\t!= e_RTE_METER_YELLOW)\n+\t\tmelog(TRTCM_RFC4115_BLIND_CHECK_MSG\" YELLOW\");\n+\n+\t/* Test red */\n+\tif (rte_meter_trtcm_rfc4115_profile_config(&tp, &rfc4115params) != 0)\n+\t\tmelog(TRTCM_RFC4115_BLIND_CHECK_MSG);\n+\tif (rte_meter_trtcm_rfc4115_config(&tm, &tp) != 0)\n+\t\tmelog(TRTCM_RFC4115_BLIND_CHECK_MSG);\n+\ttime = rte_get_tsc_cycles() + hz;\n+\tif (rte_meter_trtcm_rfc4115_color_blind_check(\n+\t\t&tm, &tp, time, TM_TEST_TRTCM_EBS_DF + 1)\n+\t\t!= e_RTE_METER_RED)\n+\t\tmelog(TRTCM_RFC4115_BLIND_CHECK_MSG\" RED\");\n+\n+\treturn 0;\n+}\n+\n \n /**\n  * @in[4] : the flags packets carries.\n@@ -473,6 +579,103 @@ tm_test_trtcm_color_aware_check(void)\n \treturn 0;\n }\n \n+/**\n+ * @in[4] : the flags packets carries.\n+ * @in[4] : the flags function expect to return.\n+ * It will do blind check at the time of 1 second from beginning.\n+ * At the time, it will use packets length of cbs -1, cbs + 1,\n+ * ebs -1 and ebs +1 with flag in[0], in[1], in[2] and in[3] to do\n+ * aware check, expect flag out[0], out[1], out[2] and out[3]\n+ */\n+static inline int\n+tm_test_trtcm_rfc4115_aware_check\n+(enum rte_meter_color in[4], enum rte_meter_color out[4])\n+{\n+#define TRTCM_RFC4115_AWARE_CHECK_MSG \"trtcm_rfc4115_aware_check\"\n+\tstruct rte_meter_trtcm_profile tp;\n+\tstruct rte_meter_trtcm tm;\n+\tuint64_t time;\n+\tuint64_t hz = rte_get_tsc_hz();\n+\n+\tif (rte_meter_trtcm_rfc4115_profile_config(&tp, &rfc4115params) != 0)\n+\t\tmelog(TRTCM_AWARE_CHECK_MSG);\n+\tif (rte_meter_trtcm_rfc4115_config(&tm, &tp) != 0)\n+\t\tmelog(TRTCM_RFC4115_AWARE_CHECK_MSG);\n+\ttime = rte_get_tsc_cycles() + hz;\n+\tif (rte_meter_trtcm_rfc4115_color_aware_check(\n+\t\t&tm, &tp, time, TM_TEST_TRTCM_CBS_DF - 1, in[0]) != out[0])\n+\t\tmelog(TRTCM_RFC4115_AWARE_CHECK_MSG\" %u:%u\", in[0], out[0]);\n+\n+\tif (rte_meter_trtcm_rfc4115_profile_config(&tp, &rfc4115params) != 0)\n+\t\tmelog(TRTCM_RFC4115_AWARE_CHECK_MSG);\n+\tif (rte_meter_trtcm_rfc4115_config(&tm, &tp) != 0)\n+\t\tmelog(TRTCM_RFC4115_AWARE_CHECK_MSG);\n+\ttime = rte_get_tsc_cycles() + hz;\n+\tif (rte_meter_trtcm_rfc4115_color_aware_check(\n+\t\t&tm, &tp, time, TM_TEST_TRTCM_CBS_DF + 1, in[1]) != out[1])\n+\t\tmelog(TRTCM_RFC4115_AWARE_CHECK_MSG\" %u:%u\", in[1], out[1]);\n+\n+\tif (rte_meter_trtcm_rfc4115_profile_config(&tp, &rfc4115params) != 0)\n+\t\tmelog(TRTCM_RFC4115_AWARE_CHECK_MSG);\n+\tif (rte_meter_trtcm_rfc4115_config(&tm, &tp) != 0)\n+\t\tmelog(TRTCM_RFC4115_AWARE_CHECK_MSG);\n+\ttime = rte_get_tsc_cycles() + hz;\n+\tif (rte_meter_trtcm_rfc4115_color_aware_check(\n+\t\t&tm, &tp, time, TM_TEST_TRTCM_EBS_DF - 1, in[2]) != out[2])\n+\t\tmelog(TRTCM_RFC4115_AWARE_CHECK_MSG\" %u:%u\", in[2], out[2]);\n+\n+\tif (rte_meter_trtcm_rfc4115_profile_config(&tp, &rfc4115params) != 0)\n+\t\tmelog(TRTCM_RFC4115_AWARE_CHECK_MSG);\n+\tif (rte_meter_trtcm_rfc4115_config(&tm, &tp) != 0)\n+\t\tmelog(TRTCM_RFC4115_AWARE_CHECK_MSG);\n+\ttime = rte_get_tsc_cycles() + hz;\n+\tif (rte_meter_trtcm_rfc4115_color_aware_check(\n+\t\t&tm, &tp, time, TM_TEST_TRTCM_EBS_DF + 1, in[3]) != out[3])\n+\t\tmelog(TRTCM_RFC4115_AWARE_CHECK_MSG\" %u:%u\", in[3], out[3]);\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * functional test for rte_meter_trtcm_rfc4115_color_aware_check\n+ */\n+static inline int\n+tm_test_trtcm_rfc4115_color_aware_check(void)\n+{\n+\tenum rte_meter_color in[4], out[4];\n+\t/**\n+\t  * test 4 points that will produce green, yellow, yellow, red flag\n+\t  * if using blind check\n+\t  */\n+\n+\t/* previouly have a green, test points should keep unchanged */\n+\tin[0] = in[1] = in[2] = in[3] = e_RTE_METER_GREEN;\n+\tout[0] = e_RTE_METER_GREEN;\n+\tout[1] = e_RTE_METER_YELLOW;\n+\tout[2] = e_RTE_METER_YELLOW;\n+\tout[3] = e_RTE_METER_RED;\n+\tif (tm_test_trtcm_rfc4115_aware_check(in, out) != 0)\n+\t\treturn -1;\n+\n+\tin[0] = in[1] = in[2] = in[3] = e_RTE_METER_YELLOW;\n+\tout[0] = e_RTE_METER_YELLOW;\n+\tout[1] = e_RTE_METER_YELLOW;\n+\tout[2] = e_RTE_METER_YELLOW;\n+\tout[3] = e_RTE_METER_RED;\n+\tif (tm_test_trtcm_rfc4115_aware_check(in, out) != 0)\n+\t\treturn -1;\n+\n+\tin[0] = in[1] = in[2] = in[3] = e_RTE_METER_RED;\n+\tout[0] = e_RTE_METER_RED;\n+\tout[1] = e_RTE_METER_RED;\n+\tout[2] = e_RTE_METER_RED;\n+\tout[3] = e_RTE_METER_RED;\n+\tif (tm_test_trtcm_rfc4115_aware_check(in, out) != 0)\n+\t\treturn -1;\n+\n+\treturn 0;\n+}\n+\n /**\n  * test main entrance for library meter\n  */\n@@ -485,18 +688,27 @@ test_meter(void)\n \tif (tm_test_trtcm_config() != 0)\n \t\treturn -1;\n \n+\tif (tm_test_trtcm_rfc4115_config() != 0)\n+\t\treturn -1;\n+\n \tif (tm_test_srtcm_color_blind_check() != 0)\n \t\treturn -1;\n \n \tif (tm_test_trtcm_color_blind_check() != 0)\n \t\treturn -1;\n \n+\tif (tm_test_trtcm_rfc4115_color_blind_check() != 0)\n+\t\treturn -1;\n+\n \tif (tm_test_srtcm_color_aware_check() != 0)\n \t\treturn -1;\n \n \tif (tm_test_trtcm_color_aware_check() != 0)\n \t\treturn -1;\n \n+\tif (tm_test_trtcm_rfc4115_color_aware_check() != 0)\n+\t\treturn -1;\n+\n \treturn 0;\n \n }\n",
    "prefixes": [
        "2/3"
    ]
}