get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 27756,
    "url": "http://patches.dpdk.org/api/patches/27756/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1503488186-90047-2-git-send-email-cristian.dumitrescu@intel.com/",
    "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": "<1503488186-90047-2-git-send-email-cristian.dumitrescu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1503488186-90047-2-git-send-email-cristian.dumitrescu@intel.com",
    "date": "2017-08-23T11:36:23",
    "name": "[dpdk-dev,1/4] meter: add meter configuration profile",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "5116d3f3c832e1779f5c4434e405dad2a4df750a",
    "submitter": {
        "id": 19,
        "url": "http://patches.dpdk.org/api/people/19/?format=api",
        "name": "Cristian Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1503488186-90047-2-git-send-email-cristian.dumitrescu@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/27756/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/27756/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 22A9B7D62;\n\tWed, 23 Aug 2017 13:36:35 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 88D5C7D3A\n\tfor <dev@dpdk.org>; Wed, 23 Aug 2017 13:36:30 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t23 Aug 2017 04:36:28 -0700",
            "from silpixa00382658.ir.intel.com ([10.237.223.29])\n\tby FMSMGA003.fm.intel.com with ESMTP; 23 Aug 2017 04:36:26 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.41,416,1498546800\"; d=\"scan'208\";a=\"893316385\"",
        "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net",
        "Date": "Wed, 23 Aug 2017 12:36:23 +0100",
        "Message-Id": "<1503488186-90047-2-git-send-email-cristian.dumitrescu@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1503488186-90047-1-git-send-email-cristian.dumitrescu@intel.com>",
        "References": "<1503488186-90047-1-git-send-email-cristian.dumitrescu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 1/4] meter: add meter configuration profile",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\n---\n lib/librte_meter/rte_meter.c           |  88 ++++++++++-------\n lib/librte_meter/rte_meter.h           | 170 ++++++++++++++++++++++-----------\n lib/librte_meter/rte_meter_version.map |   8 ++\n 3 files changed, 174 insertions(+), 92 deletions(-)",
    "diff": "diff --git a/lib/librte_meter/rte_meter.c b/lib/librte_meter/rte_meter.c\nindex 5e2dadb..6f3fa59 100644\n--- a/lib/librte_meter/rte_meter.c\n+++ b/lib/librte_meter/rte_meter.c\n@@ -1,7 +1,7 @@\n /*-\n  *   BSD LICENSE\n  *\n- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ *   Copyright(c) 2010-2017 Intel Corporation. All rights reserved.\n  *   All rights reserved.\n  *\n  *   Redistribution and use in source and binary forms, with or without\n@@ -60,61 +60,75 @@ rte_meter_get_tb_params(uint64_t hz, uint64_t rate, uint64_t *tb_period, uint64_\n }\n \n int\n-rte_meter_srtcm_config(struct rte_meter_srtcm *m, struct rte_meter_srtcm_params *params)\n+rte_meter_srtcm_profile_config(struct rte_meter_srtcm_profile *p, struct rte_meter_srtcm_params *params)\n {\n-\tuint64_t hz;\n+\tuint64_t hz = rte_get_tsc_hz();\n \n \t/* Check input parameters */\n-\tif ((m == NULL) || (params == NULL)) {\n-\t\treturn -1;\n-\t}\n+\tif ((p == NULL) ||\n+\t\t(params == NULL) ||\n+\t\t(params->cir == 0) ||\n+\t\t((params->cbs == 0) && (params->ebs == 0)))\n+\t\treturn -EINVAL;\n \n-\tif ((params->cir == 0) || ((params->cbs == 0) && (params->ebs == 0))) {\n-\t\treturn -2;\n-\t}\n+\t/* Initialize srTCM run-time structure */\n+\tp->cbs = params->cbs;\n+\tp->ebs = params->ebs;\n+\trte_meter_get_tb_params(hz, params->cir, &p->cir_period, &p->cir_bytes_per_period);\n+\n+\treturn 0;\n+}\n+\n+int\n+rte_meter_srtcm_config(struct rte_meter_srtcm *m, struct rte_meter_srtcm_profile *p)\n+{\n+\t/* Check input parameters */\n+\tif ((m == NULL) || (p == NULL))\n+\t\treturn -EINVAL;\n \n \t/* Initialize srTCM run-time structure */\n-\thz = rte_get_tsc_hz();\n \tm->time = rte_get_tsc_cycles();\n-\tm->tc = m->cbs = params->cbs;\n-\tm->te = m->ebs = params->ebs;\n-\trte_meter_get_tb_params(hz, params->cir, &m->cir_period, &m->cir_bytes_per_period);\n-\n-\tRTE_LOG(INFO, METER, \"Low level srTCM config: \\n\"\n-\t\t\"\\tCIR period = %\" PRIu64 \", CIR bytes per period = %\" PRIu64 \"\\n\",\n-\t\tm->cir_period, m->cir_bytes_per_period);\n+\tm->tc = p->cbs;\n+\tm->te = p->ebs;\n \n \treturn 0;\n }\n \n int\n-rte_meter_trtcm_config(struct rte_meter_trtcm *m, struct rte_meter_trtcm_params *params)\n+rte_meter_trtcm_profile_config(struct rte_meter_trtcm_profile *p, struct rte_meter_trtcm_params *params)\n {\n-\tuint64_t hz;\n+\tuint64_t hz = rte_get_tsc_hz();\n \n \t/* Check input parameters */\n-\tif ((m == NULL) || (params == NULL)) {\n-\t\treturn -1;\n-\t}\n+\tif ((p == NULL) ||\n+\t\t(params == NULL) ||\n+\t\t(params->cir == 0) ||\n+\t\t(params->pir == 0) ||\n+\t\t(params->pir < params->cir) ||\n+\t\t(params->cbs == 0) ||\n+\t\t(params->pbs == 0))\n+\t\treturn -EINVAL;\n \n-\tif ((params->cir == 0) || (params->pir == 0) || (params->pir < params->cir) ||\n-\t\t(params->cbs == 0) || (params->pbs == 0)) {\n-\t\treturn -2;\n-\t}\n+\t/* Initialize trTCM run-time structure */\n+\tp->cbs = params->cbs;\n+\tp->pbs = params->pbs;\n+\trte_meter_get_tb_params(hz, params->cir, &p->cir_period, &p->cir_bytes_per_period);\n+\trte_meter_get_tb_params(hz, params->pir, &p->pir_period, &p->pir_bytes_per_period);\n+\n+\treturn 0;\n+}\n+\n+int\n+rte_meter_trtcm_config(struct rte_meter_trtcm *m, struct rte_meter_trtcm_profile *p)\n+{\n+\t/* Check input parameters */\n+\tif ((m == NULL) || (p == NULL))\n+\t\treturn -EINVAL;\n \n \t/* Initialize trTCM run-time structure */\n-\thz = rte_get_tsc_hz();\n \tm->time_tc = m->time_tp = rte_get_tsc_cycles();\n-\tm->tc = m->cbs = params->cbs;\n-\tm->tp = m->pbs = params->pbs;\n-\trte_meter_get_tb_params(hz, params->cir, &m->cir_period, &m->cir_bytes_per_period);\n-\trte_meter_get_tb_params(hz, params->pir, &m->pir_period, &m->pir_bytes_per_period);\n-\n-\tRTE_LOG(INFO, METER, \"Low level trTCM config: \\n\"\n-\t\t\"\\tCIR period = %\" PRIu64 \", CIR bytes per period = %\" PRIu64 \"\\n\"\n-\t\t\"\\tPIR period = %\" PRIu64 \", PIR bytes per period = %\" PRIu64 \"\\n\",\n-\t\tm->cir_period, m->cir_bytes_per_period,\n-\t\tm->pir_period, m->pir_bytes_per_period);\n+\tm->tc = p->cbs;\n+\tm->tp = p->pbs;\n \n \treturn 0;\n }\ndiff --git a/lib/librte_meter/rte_meter.h b/lib/librte_meter/rte_meter.h\nindex 2ab7184..c4bf9fd 100644\n--- a/lib/librte_meter/rte_meter.h\n+++ b/lib/librte_meter/rte_meter.h\n@@ -1,7 +1,7 @@\n /*-\n  *   BSD LICENSE\n  *\n- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ *   Copyright(c) 2010-2017 Intel Corporation. All rights reserved.\n  *   All rights reserved.\n  *\n  *   Redistribution and use in source and binary forms, with or without\n@@ -82,6 +82,18 @@ struct rte_meter_trtcm_params {\n \tuint64_t pbs; /**< Peak Burst Size (PBS). Measured in bytes. */\n };\n \n+/**\n+ * Internal data structure storing the srTCM configuration profile. Typically\n+ * shared by multiple srTCM objects.\n+ */\n+struct rte_meter_srtcm_profile;\n+\n+/**\n+  * Internal data structure storing the trTCM configuration profile. Typically\n+  * shared by multiple trTCM objects.\n+  */\n+struct rte_meter_trtcm_profile;\n+\n /** Internal data structure storing the srTCM run-time context per metered traffic flow. */\n struct rte_meter_srtcm;\n \n@@ -89,38 +101,66 @@ struct rte_meter_srtcm;\n struct rte_meter_trtcm;\n \n /**\n+ * srTCM profile configuration\n+ *\n+ * @param p\n+ *    Pointer to pre-allocated srTCM profile data structure\n+ * @param params\n+ *    srTCM profile parameters\n+ * @return\n+ *    0 upon success, error code otherwise\n+ */\n+int rte_meter_srtcm_profile_config(struct rte_meter_srtcm_profile *p,\n+\tstruct rte_meter_srtcm_params *params);\n+\n+/**\n+ * trTCM profile configuration\n+ *\n+ * @param p\n+ *    Pointer to pre-allocated trTCM profile data structure\n+ * @param params\n+ *    trTCM profile parameters\n+ * @return\n+ *    0 upon success, error code otherwise\n+ */\n+int rte_meter_trtcm_profile_config(struct rte_meter_trtcm_profile *p,\n+\tstruct rte_meter_trtcm_params *params);\n+\n+/**\n  * srTCM configuration per metered traffic flow\n  *\n  * @param m\n  *    Pointer to pre-allocated srTCM data structure\n- * @param params\n- *    User parameters per srTCM metered traffic flow\n+ * @param p\n+ *    srTCM profile. Needs to be valid.\n  * @return\n  *    0 upon success, error code otherwise\n  */\n int\n rte_meter_srtcm_config(struct rte_meter_srtcm *m,\n-\tstruct rte_meter_srtcm_params *params);\n+\tstruct rte_meter_srtcm_profile *p);\n \n /**\n  * trTCM configuration per metered traffic flow\n  *\n  * @param m\n  *    Pointer to pre-allocated trTCM data structure\n- * @param params\n- *    User parameters per trTCM metered traffic flow\n+ * @param p\n+ *    trTCM profile. Needs to be valid.\n  * @return\n  *    0 upon success, error code otherwise\n  */\n int\n rte_meter_trtcm_config(struct rte_meter_trtcm *m,\n-\tstruct rte_meter_trtcm_params *params);\n+\tstruct rte_meter_trtcm_profile *p);\n \n /**\n  * srTCM color blind traffic metering\n  *\n  * @param m\n  *    Handle to srTCM instance\n+ * @param p\n+ *    srTCM profile specified at srTCM object creation time\n  * @param time\n  *    Current CPU time stamp (measured in CPU cycles)\n  * @param pkt_len\n@@ -130,6 +170,7 @@ rte_meter_trtcm_config(struct rte_meter_trtcm *m,\n  */\n static inline enum rte_meter_color\n rte_meter_srtcm_color_blind_check(struct rte_meter_srtcm *m,\n+\tstruct rte_meter_srtcm_profile *p,\n \tuint64_t time,\n \tuint32_t pkt_len);\n \n@@ -138,6 +179,8 @@ rte_meter_srtcm_color_blind_check(struct rte_meter_srtcm *m,\n  *\n  * @param m\n  *    Handle to srTCM instance\n+ * @param p\n+ *    srTCM profile specified at srTCM object creation time\n  * @param time\n  *    Current CPU time stamp (measured in CPU cycles)\n  * @param pkt_len\n@@ -149,6 +192,7 @@ rte_meter_srtcm_color_blind_check(struct rte_meter_srtcm *m,\n  */\n static inline enum rte_meter_color\n rte_meter_srtcm_color_aware_check(struct rte_meter_srtcm *m,\n+\tstruct rte_meter_srtcm_profile *p,\n \tuint64_t time,\n \tuint32_t pkt_len,\n \tenum rte_meter_color pkt_color);\n@@ -158,6 +202,8 @@ rte_meter_srtcm_color_aware_check(struct rte_meter_srtcm *m,\n  *\n  * @param m\n  *    Handle to trTCM instance\n+ * @param p\n+ *    trTCM profile specified at trTCM object creation time\n  * @param time\n  *    Current CPU time stamp (measured in CPU cycles)\n  * @param pkt_len\n@@ -167,6 +213,7 @@ rte_meter_srtcm_color_aware_check(struct rte_meter_srtcm *m,\n  */\n static inline enum rte_meter_color\n rte_meter_trtcm_color_blind_check(struct rte_meter_trtcm *m,\n+\tstruct rte_meter_trtcm_profile *p,\n \tuint64_t time,\n \tuint32_t pkt_len);\n \n@@ -175,6 +222,8 @@ rte_meter_trtcm_color_blind_check(struct rte_meter_trtcm *m,\n  *\n  * @param m\n  *    Handle to trTCM instance\n+ * @param p\n+ *    trTCM profile specified at trTCM object creation time\n  * @param time\n  *    Current CPU time stamp (measured in CPU cycles)\n  * @param pkt_len\n@@ -186,6 +235,7 @@ rte_meter_trtcm_color_blind_check(struct rte_meter_trtcm *m,\n  */\n static inline enum rte_meter_color\n rte_meter_trtcm_color_aware_check(struct rte_meter_trtcm *m,\n+\tstruct rte_meter_trtcm_profile *p,\n \tuint64_t time,\n \tuint32_t pkt_len,\n \tenum rte_meter_color pkt_color);\n@@ -195,23 +245,21 @@ rte_meter_trtcm_color_aware_check(struct rte_meter_trtcm *m,\n  *\n  ***/\n \n+struct rte_meter_srtcm_profile {\n+\tuint64_t cbs;  /* Upper limit for C token bucket */\n+\tuint64_t ebs;  /* Upper limit for E token bucket */\n+\tuint64_t cir_period; /* Number of CPU cycles for one update of C and E token buckets */\n+\tuint64_t cir_bytes_per_period; /* Number of bytes to add to C and E token buckets on each update */\n+};\n+\n /* Internal data structure storing the srTCM run-time context per metered traffic flow. */\n struct rte_meter_srtcm {\n \tuint64_t time; /* Time of latest update of C and E token buckets */\n \tuint64_t tc;   /* Number of bytes currently available in the committed (C) token bucket */\n \tuint64_t te;   /* Number of bytes currently available in the excess (E) token bucket */\n-\tuint64_t cbs;  /* Upper limit for C token bucket */\n-\tuint64_t ebs;  /* Upper limit for E token bucket */\n-\tuint64_t cir_period; /* Number of CPU cycles for one update of C and E token buckets */\n-\tuint64_t cir_bytes_per_period; /* Number of bytes to add to C and E token buckets on each update */\n };\n \n-/* Internal data structure storing the trTCM run-time context per metered traffic flow. */\n-struct rte_meter_trtcm {\n-\tuint64_t time_tc; /* Time of latest update of C token bucket */\n-\tuint64_t time_tp; /* Time of latest update of E token bucket */\n-\tuint64_t tc;      /* Number of bytes currently available in the committed (C) token bucket */\n-\tuint64_t tp;      /* Number of bytes currently available in the peak (P) token bucket */\n+struct rte_meter_trtcm_profile {\n \tuint64_t cbs;     /* Upper limit for C token bucket */\n \tuint64_t pbs;     /* Upper limit for P token bucket */\n \tuint64_t cir_period; /* Number of CPU cycles for one update of C token bucket */\n@@ -220,8 +268,17 @@ struct rte_meter_trtcm {\n \tuint64_t pir_bytes_per_period; /* Number of bytes to add to P token bucket on each update */\n };\n \n+/* Internal data structure storing the trTCM run-time context per metered traffic flow. */\n+struct rte_meter_trtcm {\n+\tuint64_t time_tc; /* Time of latest update of C token bucket */\n+\tuint64_t time_tp; /* Time of latest update of E token bucket */\n+\tuint64_t tc;      /* Number of bytes currently available in the committed (C) token bucket */\n+\tuint64_t tp;      /* Number of bytes currently available in the peak (P) token bucket */\n+};\n+\n static inline enum rte_meter_color\n rte_meter_srtcm_color_blind_check(struct rte_meter_srtcm *m,\n+\tstruct rte_meter_srtcm_profile *p,\n \tuint64_t time,\n \tuint32_t pkt_len)\n {\n@@ -229,17 +286,17 @@ rte_meter_srtcm_color_blind_check(struct rte_meter_srtcm *m,\n \n \t/* Bucket update */\n \ttime_diff = time - m->time;\n-\tn_periods = time_diff / m->cir_period;\n-\tm->time += n_periods * m->cir_period;\n+\tn_periods = time_diff / p->cir_period;\n+\tm->time += n_periods * p->cir_period;\n \n \t/* Put the tokens overflowing from tc into te bucket */\n-\ttc = m->tc + n_periods * m->cir_bytes_per_period;\n+\ttc = m->tc + n_periods * p->cir_bytes_per_period;\n \tte = m->te;\n-\tif (tc > m->cbs) {\n-\t\tte += (tc - m->cbs);\n-\t\tif (te > m->ebs)\n-\t\t\tte = m->ebs;\n-\t\ttc = m->cbs;\n+\tif (tc > p->cbs) {\n+\t\tte += (tc - p->cbs);\n+\t\tif (te > p->ebs)\n+\t\t\tte = p->ebs;\n+\t\ttc = p->cbs;\n \t}\n \n \t/* Color logic */\n@@ -262,6 +319,7 @@ rte_meter_srtcm_color_blind_check(struct rte_meter_srtcm *m,\n \n static inline enum rte_meter_color\n rte_meter_srtcm_color_aware_check(struct rte_meter_srtcm *m,\n+\tstruct rte_meter_srtcm_profile *p,\n \tuint64_t time,\n \tuint32_t pkt_len,\n \tenum rte_meter_color pkt_color)\n@@ -270,17 +328,17 @@ rte_meter_srtcm_color_aware_check(struct rte_meter_srtcm *m,\n \n \t/* Bucket update */\n \ttime_diff = time - m->time;\n-\tn_periods = time_diff / m->cir_period;\n-\tm->time += n_periods * m->cir_period;\n+\tn_periods = time_diff / p->cir_period;\n+\tm->time += n_periods * p->cir_period;\n \n \t/* Put the tokens overflowing from tc into te bucket */\n-\ttc = m->tc + n_periods * m->cir_bytes_per_period;\n+\ttc = m->tc + n_periods * p->cir_bytes_per_period;\n \tte = m->te;\n-\tif (tc > m->cbs) {\n-\t\tte += (tc - m->cbs);\n-\t\tif (te > m->ebs)\n-\t\t\tte = m->ebs;\n-\t\ttc = m->cbs;\n+\tif (tc > p->cbs) {\n+\t\tte += (tc - p->cbs);\n+\t\tif (te > p->ebs)\n+\t\t\tte = p->ebs;\n+\t\ttc = p->cbs;\n \t}\n \n \t/* Color logic */\n@@ -303,6 +361,7 @@ rte_meter_srtcm_color_aware_check(struct rte_meter_srtcm *m,\n \n static inline enum rte_meter_color\n rte_meter_trtcm_color_blind_check(struct rte_meter_trtcm *m,\n+\tstruct rte_meter_trtcm_profile *p,\n \tuint64_t time,\n \tuint32_t pkt_len)\n {\n@@ -311,18 +370,18 @@ rte_meter_trtcm_color_blind_check(struct rte_meter_trtcm *m,\n \t/* Bucket update */\n \ttime_diff_tc = time - m->time_tc;\n \ttime_diff_tp = time - m->time_tp;\n-\tn_periods_tc = time_diff_tc / m->cir_period;\n-\tn_periods_tp = time_diff_tp / m->pir_period;\n-\tm->time_tc += n_periods_tc * m->cir_period;\n-\tm->time_tp += n_periods_tp * m->pir_period;\n+\tn_periods_tc = time_diff_tc / p->cir_period;\n+\tn_periods_tp = time_diff_tp / p->pir_period;\n+\tm->time_tc += n_periods_tc * p->cir_period;\n+\tm->time_tp += n_periods_tp * p->pir_period;\n \n-\ttc = m->tc + n_periods_tc * m->cir_bytes_per_period;\n-\tif (tc > m->cbs)\n-\t\ttc = m->cbs;\n+\ttc = m->tc + n_periods_tc * p->cir_bytes_per_period;\n+\tif (tc > p->cbs)\n+\t\ttc = p->cbs;\n \n-\ttp = m->tp + n_periods_tp * m->pir_bytes_per_period;\n-\tif (tp > m->pbs)\n-\t\ttp = m->pbs;\n+\ttp = m->tp + n_periods_tp * p->pir_bytes_per_period;\n+\tif (tp > p->pbs)\n+\t\ttp = p->pbs;\n \n \t/* Color logic */\n \tif (tp < pkt_len) {\n@@ -344,6 +403,7 @@ rte_meter_trtcm_color_blind_check(struct rte_meter_trtcm *m,\n \n static inline enum rte_meter_color\n rte_meter_trtcm_color_aware_check(struct rte_meter_trtcm *m,\n+\tstruct rte_meter_trtcm_profile *p,\n \tuint64_t time,\n \tuint32_t pkt_len,\n \tenum rte_meter_color pkt_color)\n@@ -353,18 +413,18 @@ rte_meter_trtcm_color_aware_check(struct rte_meter_trtcm *m,\n \t/* Bucket update */\n \ttime_diff_tc = time - m->time_tc;\n \ttime_diff_tp = time - m->time_tp;\n-\tn_periods_tc = time_diff_tc / m->cir_period;\n-\tn_periods_tp = time_diff_tp / m->pir_period;\n-\tm->time_tc += n_periods_tc * m->cir_period;\n-\tm->time_tp += n_periods_tp * m->pir_period;\n-\n-\ttc = m->tc + n_periods_tc * m->cir_bytes_per_period;\n-\tif (tc > m->cbs)\n-\t\ttc = m->cbs;\n-\n-\ttp = m->tp + n_periods_tp * m->pir_bytes_per_period;\n-\tif (tp > m->pbs)\n-\t\ttp = m->pbs;\n+\tn_periods_tc = time_diff_tc / p->cir_period;\n+\tn_periods_tp = time_diff_tp / p->pir_period;\n+\tm->time_tc += n_periods_tc * p->cir_period;\n+\tm->time_tp += n_periods_tp * p->pir_period;\n+\n+\ttc = m->tc + n_periods_tc * p->cir_bytes_per_period;\n+\tif (tc > p->cbs)\n+\t\ttc = p->cbs;\n+\n+\ttp = m->tp + n_periods_tp * p->pir_bytes_per_period;\n+\tif (tp > p->pbs)\n+\t\ttp = p->pbs;\n \n \t/* Color logic */\n \tif ((pkt_color == e_RTE_METER_RED) || (tp < pkt_len)) {\ndiff --git a/lib/librte_meter/rte_meter_version.map b/lib/librte_meter/rte_meter_version.map\nindex 2fd647c..8bc8190 100644\n--- a/lib/librte_meter/rte_meter_version.map\n+++ b/lib/librte_meter/rte_meter_version.map\n@@ -10,3 +10,11 @@ DPDK_2.0 {\n \n \tlocal: *;\n };\n+\n+DPDK_17.11 {\n+\tglobal:\n+\n+\trte_meter_srtcm_profile_config;\n+\trte_meter_trtcm_profile_config;\n+\n+} DPDK_2.0;\n",
    "prefixes": [
        "dpdk-dev",
        "1/4"
    ]
}