get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 55349,
    "url": "http://patches.dpdk.org/api/patches/55349/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190625153217.24301-26-jasvinder.singh@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": "<20190625153217.24301-26-jasvinder.singh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190625153217.24301-26-jasvinder.singh@intel.com",
    "date": "2019-06-25T15:32:14",
    "name": "[v2,25/28] examples/qos_sched: update qos sched sample app",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "475a59ee7a60e097e25e778c39985a929ad304ab",
    "submitter": {
        "id": 285,
        "url": "http://patches.dpdk.org/api/people/285/?format=api",
        "name": "Jasvinder Singh",
        "email": "jasvinder.singh@intel.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/20190625153217.24301-26-jasvinder.singh@intel.com/mbox/",
    "series": [
        {
            "id": 5160,
            "url": "http://patches.dpdk.org/api/series/5160/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5160",
            "date": "2019-06-25T15:31:49",
            "name": "sched: feature enhancements",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/5160/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/55349/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/55349/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 3C6771BC01;\n\tTue, 25 Jun 2019 17:32:59 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 5D0541BB32\n\tfor <dev@dpdk.org>; Tue, 25 Jun 2019 17:32:37 +0200 (CEST)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Jun 2019 08:32:36 -0700",
            "from silpixa00381635.ir.intel.com (HELO\n\tsilpixa00381635.ger.corp.intel.com) ([10.237.223.4])\n\tby orsmga006.jf.intel.com with ESMTP; 25 Jun 2019 08:32:34 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.63,416,1557212400\"; d=\"scan'208\";a=\"166711699\"",
        "From": "Jasvinder Singh <jasvinder.singh@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "cristian.dumitrescu@intel.com, Abraham Tovar <abrahamx.tovar@intel.com>, \n\tLukasz Krakowiak <lukaszx.krakowiak@intel.com>",
        "Date": "Tue, 25 Jun 2019 16:32:14 +0100",
        "Message-Id": "<20190625153217.24301-26-jasvinder.singh@intel.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190625153217.24301-1-jasvinder.singh@intel.com>",
        "References": "<20190528120553.2992-2-lukaszx.krakowiak@intel.com>\n\t<20190625153217.24301-1-jasvinder.singh@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2 25/28] examples/qos_sched: update qos sched\n\tsample app",
        "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": "Update qos sched sample app to allow configuration flexibility for\npipe traffic classes and queues, and subport level configuration\nof the pipe parameters.\n\nSigned-off-by: Jasvinder Singh <jasvinder.singh@intel.com>\nSigned-off-by: Abraham Tovar <abrahamx.tovar@intel.com>\nSigned-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>\n---\n examples/qos_sched/app_thread.c   |  11 +-\n examples/qos_sched/cfg_file.c     | 283 +++++++++--------\n examples/qos_sched/init.c         | 109 ++++---\n examples/qos_sched/main.h         |   7 +-\n examples/qos_sched/profile.cfg    |  59 +++-\n examples/qos_sched/profile_ov.cfg |  47 ++-\n examples/qos_sched/stats.c        | 483 +++++++++++++++++-------------\n 7 files changed, 593 insertions(+), 406 deletions(-)",
    "diff": "diff --git a/examples/qos_sched/app_thread.c b/examples/qos_sched/app_thread.c\nindex e14b275e3..25a8d42a0 100644\n--- a/examples/qos_sched/app_thread.c\n+++ b/examples/qos_sched/app_thread.c\n@@ -20,13 +20,11 @@\n  * QoS parameters are encoded as follows:\n  *\t\tOuter VLAN ID defines subport\n  *\t\tInner VLAN ID defines pipe\n- *\t\tDestination IP 0.0.XXX.0 defines traffic class\n  *\t\tDestination IP host (0.0.0.XXX) defines queue\n  * Values below define offset to each field from start of frame\n  */\n #define SUBPORT_OFFSET\t7\n #define PIPE_OFFSET\t\t9\n-#define TC_OFFSET\t\t20\n #define QUEUE_OFFSET\t20\n #define COLOR_OFFSET\t19\n \n@@ -39,11 +37,10 @@ get_pkt_sched(struct rte_mbuf *m, uint32_t *subport, uint32_t *pipe,\n \t*subport = (rte_be_to_cpu_16(pdata[SUBPORT_OFFSET]) & 0x0FFF) &\n \t\t\t(port_params.n_subports_per_port - 1); /* Outer VLAN ID*/\n \t*pipe = (rte_be_to_cpu_16(pdata[PIPE_OFFSET]) & 0x0FFF) &\n-\t\t\t(port_params.n_pipes_per_subport - 1); /* Inner VLAN ID */\n-\t*traffic_class = (pdata[QUEUE_OFFSET] & 0x0F) &\n-\t\t\t(RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE - 1); /* Destination IP */\n-\t*queue = ((pdata[QUEUE_OFFSET] >> 8) & 0x0F) &\n-\t\t\t(RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS - 1) ; /* Destination IP */\n+\t\t\t(subport_params[*subport].n_subport_pipes - 1); /* Inner VLAN ID */\n+\t*queue = active_queues[(pdata[QUEUE_OFFSET] >> 8) % n_active_queues];\n+\t*traffic_class = (*queue > (RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE - 1) ?\n+\t\t\t(RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE - 1) : *queue); /* Destination IP */\n \t*color = pdata[COLOR_OFFSET] & 0x03; \t/* Destination IP */\n \n \treturn 0;\ndiff --git a/examples/qos_sched/cfg_file.c b/examples/qos_sched/cfg_file.c\nindex 76ffffc4b..7f54bfe22 100644\n--- a/examples/qos_sched/cfg_file.c\n+++ b/examples/qos_sched/cfg_file.c\n@@ -24,7 +24,6 @@ int\n cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port_params)\n {\n \tconst char *entry;\n-\tint j;\n \n \tif (!cfg || !port_params)\n \t\treturn -1;\n@@ -37,93 +36,6 @@ cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port_params\n \tif (entry)\n \t\tport_params->n_subports_per_port = (uint32_t)atoi(entry);\n \n-\tentry = rte_cfgfile_get_entry(cfg, \"port\", \"number of pipes per subport\");\n-\tif (entry)\n-\t\tport_params->n_pipes_per_subport = (uint32_t)atoi(entry);\n-\n-\tentry = rte_cfgfile_get_entry(cfg, \"port\", \"queue sizes\");\n-\tif (entry) {\n-\t\tchar *next;\n-\n-\t\tfor(j = 0; j < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; j++) {\n-\t\t\tport_params->qsize[j] = (uint16_t)strtol(entry, &next, 10);\n-\t\t\tif (next == NULL)\n-\t\t\t\tbreak;\n-\t\t\tentry = next;\n-\t\t}\n-\t}\n-\n-#ifdef RTE_SCHED_RED\n-\tfor (j = 0; j < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; j++) {\n-\t\tchar str[32];\n-\n-\t\t/* Parse WRED min thresholds */\n-\t\tsnprintf(str, sizeof(str), \"tc %d wred min\", j);\n-\t\tentry = rte_cfgfile_get_entry(cfg, \"red\", str);\n-\t\tif (entry) {\n-\t\t\tchar *next;\n-\t\t\tint k;\n-\t\t\t/* for each packet colour (green, yellow, red) */\n-\t\t\tfor (k = 0; k < RTE_COLORS; k++) {\n-\t\t\t\tport_params->red_params[j][k].min_th\n-\t\t\t\t\t= (uint16_t)strtol(entry, &next, 10);\n-\t\t\t\tif (next == NULL)\n-\t\t\t\t\tbreak;\n-\t\t\t\tentry = next;\n-\t\t\t}\n-\t\t}\n-\n-\t\t/* Parse WRED max thresholds */\n-\t\tsnprintf(str, sizeof(str), \"tc %d wred max\", j);\n-\t\tentry = rte_cfgfile_get_entry(cfg, \"red\", str);\n-\t\tif (entry) {\n-\t\t\tchar *next;\n-\t\t\tint k;\n-\t\t\t/* for each packet colour (green, yellow, red) */\n-\t\t\tfor (k = 0; k < RTE_COLORS; k++) {\n-\t\t\t\tport_params->red_params[j][k].max_th\n-\t\t\t\t\t= (uint16_t)strtol(entry, &next, 10);\n-\t\t\t\tif (next == NULL)\n-\t\t\t\t\tbreak;\n-\t\t\t\tentry = next;\n-\t\t\t}\n-\t\t}\n-\n-\t\t/* Parse WRED inverse mark probabilities */\n-\t\tsnprintf(str, sizeof(str), \"tc %d wred inv prob\", j);\n-\t\tentry = rte_cfgfile_get_entry(cfg, \"red\", str);\n-\t\tif (entry) {\n-\t\t\tchar *next;\n-\t\t\tint k;\n-\t\t\t/* for each packet colour (green, yellow, red) */\n-\t\t\tfor (k = 0; k < RTE_COLORS; k++) {\n-\t\t\t\tport_params->red_params[j][k].maxp_inv\n-\t\t\t\t\t= (uint8_t)strtol(entry, &next, 10);\n-\n-\t\t\t\tif (next == NULL)\n-\t\t\t\t\tbreak;\n-\t\t\t\tentry = next;\n-\t\t\t}\n-\t\t}\n-\n-\t\t/* Parse WRED EWMA filter weights */\n-\t\tsnprintf(str, sizeof(str), \"tc %d wred weight\", j);\n-\t\tentry = rte_cfgfile_get_entry(cfg, \"red\", str);\n-\t\tif (entry) {\n-\t\t\tchar *next;\n-\t\t\tint k;\n-\t\t\t/* for each packet colour (green, yellow, red) */\n-\t\t\tfor (k = 0; k < RTE_COLORS; k++) {\n-\t\t\t\tport_params->red_params[j][k].wq_log2\n-\t\t\t\t\t= (uint8_t)strtol(entry, &next, 10);\n-\t\t\t\tif (next == NULL)\n-\t\t\t\t\tbreak;\n-\t\t\t\tentry = next;\n-\t\t\t}\n-\t\t}\n-\t}\n-#endif /* RTE_SCHED_RED */\n-\n \treturn 0;\n }\n \n@@ -139,7 +51,7 @@ cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe_params\n \t\treturn -1;\n \n \tprofiles = rte_cfgfile_num_sections(cfg, \"pipe profile\", sizeof(\"pipe profile\") - 1);\n-\tport_params.n_pipe_profiles = profiles;\n+\tsubport_params[0].n_pipe_profiles = profiles;\n \n \tfor (j = 0; j < profiles; j++) {\n \t\tchar pipe_name[32];\n@@ -173,46 +85,36 @@ cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe_params\n \t\tif (entry)\n \t\t\tpipe_params[j].tc_rate[3] = (uint32_t)atoi(entry);\n \n+\t\tentry = rte_cfgfile_get_entry(cfg, pipe_name, \"tc 4 rate\");\n+\t\tif (entry)\n+\t\t\tpipe_params[j].tc_rate[4] = (uint32_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, pipe_name, \"tc 5 rate\");\n+\t\tif (entry)\n+\t\t\tpipe_params[j].tc_rate[5] = (uint32_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, pipe_name, \"tc 6 rate\");\n+\t\tif (entry)\n+\t\t\tpipe_params[j].tc_rate[6] = (uint32_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, pipe_name, \"tc 7 rate\");\n+\t\tif (entry)\n+\t\t\tpipe_params[j].tc_rate[7] = (uint32_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, pipe_name, \"tc 8 rate\");\n+\t\tif (entry)\n+\t\t\tpipe_params[j].tc_rate[8] = (uint32_t)atoi(entry);\n+\n #ifdef RTE_SCHED_SUBPORT_TC_OV\n-\t\tentry = rte_cfgfile_get_entry(cfg, pipe_name, \"tc 3 oversubscription weight\");\n+\t\tentry = rte_cfgfile_get_entry(cfg, pipe_name, \"tc 8 oversubscription weight\");\n \t\tif (entry)\n \t\t\tpipe_params[j].tc_ov_weight = (uint8_t)atoi(entry);\n #endif\n \n-\t\tentry = rte_cfgfile_get_entry(cfg, pipe_name, \"tc 0 wrr weights\");\n-\t\tif (entry) {\n-\t\t\tfor(i = 0; i < RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS; i++) {\n-\t\t\t\tpipe_params[j].wrr_weights[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE*0 + i] =\n-\t\t\t\t\t(uint8_t)strtol(entry, &next, 10);\n-\t\t\t\tif (next == NULL)\n-\t\t\t\t\tbreak;\n-\t\t\t\tentry = next;\n-\t\t\t}\n-\t\t}\n-\t\tentry = rte_cfgfile_get_entry(cfg, pipe_name, \"tc 1 wrr weights\");\n-\t\tif (entry) {\n-\t\t\tfor(i = 0; i < RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS; i++) {\n-\t\t\t\tpipe_params[j].wrr_weights[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE*1 + i] =\n-\t\t\t\t\t(uint8_t)strtol(entry, &next, 10);\n-\t\t\t\tif (next == NULL)\n-\t\t\t\t\tbreak;\n-\t\t\t\tentry = next;\n-\t\t\t}\n-\t\t}\n-\t\tentry = rte_cfgfile_get_entry(cfg, pipe_name, \"tc 2 wrr weights\");\n-\t\tif (entry) {\n-\t\t\tfor(i = 0; i < RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS; i++) {\n-\t\t\t\tpipe_params[j].wrr_weights[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE*2 + i] =\n-\t\t\t\t\t(uint8_t)strtol(entry, &next, 10);\n-\t\t\t\tif (next == NULL)\n-\t\t\t\t\tbreak;\n-\t\t\t\tentry = next;\n-\t\t\t}\n-\t\t}\n-\t\tentry = rte_cfgfile_get_entry(cfg, pipe_name, \"tc 3 wrr weights\");\n+\t\tentry = rte_cfgfile_get_entry(cfg, pipe_name, \"tc 8 wrr weights\");\n \t\tif (entry) {\n-\t\t\tfor(i = 0; i < RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS; i++) {\n-\t\t\t\tpipe_params[j].wrr_weights[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE*3 + i] =\n+\t\t\tfor (i = 0; i < RTE_SCHED_BE_QUEUES_PER_PIPE; i++) {\n+\t\t\t\tpipe_params[j].wrr_weights[i] =\n \t\t\t\t\t(uint8_t)strtol(entry, &next, 10);\n \t\t\t\tif (next == NULL)\n \t\t\t\t\tbreak;\n@@ -233,12 +135,112 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo\n \t\treturn -1;\n \n \tmemset(app_pipe_to_profile, -1, sizeof(app_pipe_to_profile));\n+\tmemset(active_queues, 0, sizeof(active_queues));\n+\tn_active_queues = 0;\n+\n+#ifdef RTE_SCHED_RED\n+\tchar sec_name[CFG_NAME_LEN];\n+\tstruct rte_red_params red_params[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE][RTE_COLORS];\n+\n+\tsnprintf(sec_name, sizeof(sec_name), \"red\");\n+\n+\tif (rte_cfgfile_has_section(cfg, sec_name)) {\n+\n+\t\tfor (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) {\n+\t\t\tchar str[32];\n+\n+\t\t\t/* Parse WRED min thresholds */\n+\t\t\tsnprintf(str, sizeof(str), \"tc %d wred min\", i);\n+\t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, str);\n+\t\t\tif (entry) {\n+\t\t\t\tchar *next;\n+\t\t\t\t/* for each packet colour (green, yellow, red) */\n+\t\t\t\tfor (j = 0; j < RTE_COLORS; j++) {\n+\t\t\t\t\tred_params[i][j].min_th\n+\t\t\t\t\t\t= (uint16_t)strtol(entry, &next, 10);\n+\t\t\t\t\tif (next == NULL)\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\tentry = next;\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t\t/* Parse WRED max thresholds */\n+\t\t\tsnprintf(str, sizeof(str), \"tc %d wred max\", i);\n+\t\t\tentry = rte_cfgfile_get_entry(cfg, \"red\", str);\n+\t\t\tif (entry) {\n+\t\t\t\tchar *next;\n+\t\t\t\t/* for each packet colour (green, yellow, red) */\n+\t\t\t\tfor (j = 0; j < RTE_COLORS; j++) {\n+\t\t\t\t\tred_params[i][j].max_th\n+\t\t\t\t\t\t= (uint16_t)strtol(entry, &next, 10);\n+\t\t\t\t\tif (next == NULL)\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\tentry = next;\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t\t/* Parse WRED inverse mark probabilities */\n+\t\t\tsnprintf(str, sizeof(str), \"tc %d wred inv prob\", i);\n+\t\t\tentry = rte_cfgfile_get_entry(cfg, \"red\", str);\n+\t\t\tif (entry) {\n+\t\t\t\tchar *next;\n+\t\t\t\t/* for each packet colour (green, yellow, red) */\n+\t\t\t\tfor (j = 0; j < RTE_COLORS; j++) {\n+\t\t\t\t\tred_params[i][j].maxp_inv\n+\t\t\t\t\t\t= (uint8_t)strtol(entry, &next, 10);\n+\n+\t\t\t\t\tif (next == NULL)\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\tentry = next;\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t\t/* Parse WRED EWMA filter weights */\n+\t\t\tsnprintf(str, sizeof(str), \"tc %d wred weight\", i);\n+\t\t\tentry = rte_cfgfile_get_entry(cfg, \"red\", str);\n+\t\t\tif (entry) {\n+\t\t\t\tchar *next;\n+\t\t\t\t/* for each packet colour (green, yellow, red) */\n+\t\t\t\tfor (j = 0; j < RTE_COLORS; j++) {\n+\t\t\t\t\tred_params[i][j].wq_log2\n+\t\t\t\t\t\t= (uint8_t)strtol(entry, &next, 10);\n+\t\t\t\t\tif (next == NULL)\n+\t\t\t\t\t\tbreak;\n+\t\t\t\t\tentry = next;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t}\n+#endif /* RTE_SCHED_RED */\n \n \tfor (i = 0; i < MAX_SCHED_SUBPORTS; i++) {\n \t\tchar sec_name[CFG_NAME_LEN];\n \t\tsnprintf(sec_name, sizeof(sec_name), \"subport %d\", i);\n \n \t\tif (rte_cfgfile_has_section(cfg, sec_name)) {\n+\t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name,\n+\t\t\t\t\"number of pipes per subport\");\n+\t\t\tif (entry)\n+\t\t\t\tsubport_params[i].n_subport_pipes = (uint32_t)atoi(entry);\n+\n+\t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"queue sizes\");\n+\t\t\tif (entry) {\n+\t\t\t\tchar *next;\n+\n+\t\t\t\tfor (j = 0; j < RTE_SCHED_QUEUES_PER_PIPE; j++) {\n+\t\t\t\tsubport_params[i].qsize[j] =\n+\t\t\t\t\t(uint16_t)strtol(entry, &next, 10);\n+\t\t\t\tif (subport_params[i].qsize[j] != 0) {\n+\t\t\t\t\tactive_queues[n_active_queues] = j;\n+\t\t\t\t\tn_active_queues++;\n+\t\t\t\t}\n+\n+\t\t\t\tif (next == NULL)\n+\t\t\t\t\tbreak;\n+\t\t\t\tentry = next;\n+\t\t\t\t}\n+\t\t\t}\n+\n \t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tb rate\");\n \t\t\tif (entry)\n \t\t\t\tsubport_params[i].tb_rate = (uint32_t)atoi(entry);\n@@ -267,6 +269,26 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo\n \t\t\tif (entry)\n \t\t\t\tsubport_params[i].tc_rate[3] = (uint32_t)atoi(entry);\n \n+\t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 4 rate\");\n+\t\t\tif (entry)\n+\t\t\t\tsubport_params[i].tc_rate[4] = (uint32_t)atoi(entry);\n+\n+\t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 5 rate\");\n+\t\t\tif (entry)\n+\t\t\t\tsubport_params[i].tc_rate[5] = (uint32_t)atoi(entry);\n+\n+\t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 6 rate\");\n+\t\t\tif (entry)\n+\t\t\t\tsubport_params[i].tc_rate[6] = (uint32_t)atoi(entry);\n+\n+\t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 7 rate\");\n+\t\t\tif (entry)\n+\t\t\t\tsubport_params[i].tc_rate[7] = (uint32_t)atoi(entry);\n+\n+\t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 8 rate\");\n+\t\t\tif (entry)\n+\t\t\t\tsubport_params[i].tc_rate[8] = (uint32_t)atoi(entry);\n+\n \t\t\tint n_entries = rte_cfgfile_section_num_entries(cfg, sec_name);\n \t\t\tstruct rte_cfgfile_entry entries[n_entries];\n \n@@ -306,6 +328,21 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n+\n+#ifdef RTE_SCHED_RED\n+\t\t\tfor (j = 0; j < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; j++) {\n+\t\t\t\tfor (k = 0; k < RTE_COLORS; k++) {\n+\t\t\t\t\tsubport_params[i].red_params[j][k].min_th =\n+\t\t\t\t\t\tred_params[j][k].min_th;\n+\t\t\t\t\tsubport_params[i].red_params[j][k].max_th =\n+\t\t\t\t\t\tred_params[j][k].max_th;\n+\t\t\t\t\tsubport_params[i].red_params[j][k].maxp_inv =\n+\t\t\t\t\t\tred_params[j][k].maxp_inv;\n+\t\t\t\t\tsubport_params[i].red_params[j][k].wq_log2 =\n+\t\t\t\t\t\tred_params[j][k].wq_log2;\n+\t\t\t\t}\n+\t\t\t}\n+#endif\n \t\t}\n \t}\n \ndiff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c\nindex f6e9af16b..55000b9ae 100644\n--- a/examples/qos_sched/init.c\n+++ b/examples/qos_sched/init.c\n@@ -165,22 +165,12 @@ app_init_port(uint16_t portid, struct rte_mempool *mp)\n \treturn 0;\n }\n \n-static struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {\n-\t{\n-\t\t.tb_rate = 1250000000,\n-\t\t.tb_size = 1000000,\n-\n-\t\t.tc_rate = {1250000000, 1250000000, 1250000000, 1250000000},\n-\t\t.tc_period = 10,\n-\t},\n-};\n-\n-static struct rte_sched_pipe_params pipe_profiles[RTE_SCHED_PIPE_PROFILES_PER_PORT] = {\n+static struct rte_sched_pipe_params pipe_profiles[MAX_SCHED_PIPE_PROFILES] = {\n \t{ /* Profile #0 */\n \t\t.tb_rate = 305175,\n \t\t.tb_size = 1000000,\n \n-\t\t.tc_rate = {305175, 305175, 305175, 305175},\n+\t\t.tc_rate = {305175, 305175, 305175, 305175, 305175, 305175, 305175, 305175, 305175},\n \t\t.tc_period = 40,\n #ifdef RTE_SCHED_SUBPORT_TC_OV\n \t\t.tc_ov_weight = 1,\n@@ -190,6 +180,70 @@ static struct rte_sched_pipe_params pipe_profiles[RTE_SCHED_PIPE_PROFILES_PER_PO\n \t},\n };\n \n+struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {\n+\t{\n+\t\t.tb_rate = 1250000000,\n+\t\t.tb_size = 1000000,\n+\n+\t\t.tc_rate = {1250000000, 1250000000, 1250000000, 1250000000, 1250000000, 1250000000, 1250000000, 1250000000, 1250000000},\n+\t\t.tc_period = 10,\n+\t\t.n_subport_pipes = 4096,\n+\t\t.qsize = {64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64},\n+\t\t.pipe_profiles = pipe_profiles,\n+\t\t.n_pipe_profiles = sizeof(pipe_profiles) / sizeof(struct rte_sched_pipe_params),\n+\t\t.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,\n+\n+#ifdef RTE_SCHED_RED\n+\t\t.red_params = {\n+\t\t\t/* Traffic Class 0 Colors Green / Yellow / Red */\n+\t\t\t[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\n+\t\t\t/* Traffic Class 1 - Colors Green / Yellow / Red */\n+\t\t\t[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\n+\t\t\t/* Traffic Class 2 - Colors Green / Yellow / Red */\n+\t\t\t[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\n+\t\t\t/* Traffic Class 3 - Colors Green / Yellow / Red */\n+\t\t\t[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\n+\t\t\t/* Traffic Class 4 - Colors Green / Yellow / Red */\n+\t\t\t[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\n+\t\t\t/* Traffic Class 5 - Colors Green / Yellow / Red */\n+\t\t\t[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\n+\t\t\t/* Traffic Class 6 - Colors Green / Yellow / Red */\n+\t\t\t[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\n+\t\t\t/* Traffic Class 7 - Colors Green / Yellow / Red */\n+\t\t\t[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\n+\t\t\t/* Traffic Class 8 - Colors Green / Yellow / Red */\n+\t\t\t[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t\t[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t},\n+#endif /* RTE_SCHED_RED */\n+\t},\n+};\n+\n struct rte_sched_port_params port_params = {\n \t.name = \"port_scheduler_0\",\n \t.socket = 0, /* computed */\n@@ -197,34 +251,6 @@ struct rte_sched_port_params port_params = {\n \t.mtu = 6 + 6 + 4 + 4 + 2 + 1500,\n \t.frame_overhead = RTE_SCHED_FRAME_OVERHEAD_DEFAULT,\n \t.n_subports_per_port = 1,\n-\t.n_pipes_per_subport = 4096,\n-\t.qsize = {64, 64, 64, 64},\n-\t.pipe_profiles = pipe_profiles,\n-\t.n_pipe_profiles = sizeof(pipe_profiles) / sizeof(struct rte_sched_pipe_params),\n-\n-#ifdef RTE_SCHED_RED\n-\t.red_params = {\n-\t\t/* Traffic Class 0 Colors Green / Yellow / Red */\n-\t\t[0][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n-\t\t[0][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n-\t\t[0][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n-\n-\t\t/* Traffic Class 1 - Colors Green / Yellow / Red */\n-\t\t[1][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n-\t\t[1][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n-\t\t[1][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n-\n-\t\t/* Traffic Class 2 - Colors Green / Yellow / Red */\n-\t\t[2][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n-\t\t[2][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n-\t\t[2][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n-\n-\t\t/* Traffic Class 3 - Colors Green / Yellow / Red */\n-\t\t[3][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n-\t\t[3][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n-\t\t[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9}\n-\t}\n-#endif /* RTE_SCHED_RED */\n };\n \n static struct rte_sched_port *\n@@ -255,7 +281,8 @@ app_init_sched_port(uint32_t portid, uint32_t socketid)\n \t\t\t\t\tsubport, err);\n \t\t}\n \n-\t\tfor (pipe = 0; pipe < port_params.n_pipes_per_subport; pipe ++) {\n+\t\tuint32_t n_subport_pipes = subport_params[subport].n_subport_pipes;\n+\t\tfor (pipe = 0; pipe < n_subport_pipes; pipe++) {\n \t\t\tif (app_pipe_to_profile[subport][pipe] != -1) {\n \t\t\t\terr = rte_sched_pipe_config(port, subport, pipe,\n \t\t\t\t\t\tapp_pipe_to_profile[subport][pipe]);\ndiff --git a/examples/qos_sched/main.h b/examples/qos_sched/main.h\nindex 8a2741c58..219aa9a95 100644\n--- a/examples/qos_sched/main.h\n+++ b/examples/qos_sched/main.h\n@@ -26,7 +26,7 @@ extern \"C\" {\n \n #define MAX_PKT_RX_BURST 64\n #define PKT_ENQUEUE 64\n-#define PKT_DEQUEUE 32\n+#define PKT_DEQUEUE 60\n #define MAX_PKT_TX_BURST 64\n \n #define RX_PTHRESH 8 /**< Default values of RX prefetch threshold reg. */\n@@ -50,6 +50,7 @@ extern \"C\" {\n #define MAX_DATA_STREAMS (APP_MAX_LCORE/2)\n #define MAX_SCHED_SUBPORTS\t\t8\n #define MAX_SCHED_PIPES\t\t4096\n+#define MAX_SCHED_PIPE_PROFILES\t\t256\n \n #ifndef APP_COLLECT_STAT\n #define APP_COLLECT_STAT\t\t1\n@@ -147,7 +148,11 @@ extern struct burst_conf burst_conf;\n extern struct ring_thresh rx_thresh;\n extern struct ring_thresh tx_thresh;\n \n+uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];\n+uint32_t n_active_queues;\n+\n extern struct rte_sched_port_params port_params;\n+extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS];\n \n int app_parse_args(int argc, char **argv);\n int app_init(void);\ndiff --git a/examples/qos_sched/profile.cfg b/examples/qos_sched/profile.cfg\nindex f5b704cc6..02fd8a00e 100644\n--- a/examples/qos_sched/profile.cfg\n+++ b/examples/qos_sched/profile.cfg\n@@ -1,6 +1,6 @@\n ;   BSD LICENSE\n ;\n-;   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+;   Copyright(c) 2010-2019 Intel Corporation. All rights reserved.\n ;   All rights reserved.\n ;\n ;   Redistribution and use in source and binary forms, with or without\n@@ -33,12 +33,12 @@\n ; 10GbE output port:\n ;\t* Single subport (subport 0):\n ;\t\t- Subport rate set to 100% of port rate\n-;\t\t- Each of the 4 traffic classes has rate set to 100% of port rate\n+;\t\t- Each of the 9 traffic classes has rate set to 100% of port rate\n ;\t* 4K pipes per subport 0 (pipes 0 .. 4095) with identical configuration:\n ;\t\t- Pipe rate set to 1/4K of port rate\n-;\t\t- Each of the 4 traffic classes has rate set to 100% of pipe rate\n-;\t\t- Within each traffic class, the byte-level WRR weights for the 4 queues\n-;         are set to 1:1:1:1\n+;\t\t- Each of the 9 traffic classes has rate set to 100% of pipe rate\n+;\t\t- Within lowest priority traffic class (best-effort), the byte-level\n+;\t\t  WRR weights for the 8 queues are set to 1:1:1:1:1:1:1:1\n ;\n ; For more details, please refer to chapter \"Quality of Service (QoS) Framework\"\n ; of Data Plane Development Kit (DPDK) Programmer's Guide.\n@@ -47,11 +47,12 @@\n [port]\n frame overhead = 24\n number of subports per port = 1\n-number of pipes per subport = 4096\n-queue sizes = 64 64 64 64\n \n ; Subport configuration\n [subport 0]\n+number of pipes per subport = 4096\n+queue sizes = 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64\n+\n tb rate = 1250000000           ; Bytes per second\n tb size = 1000000              ; Bytes\n \n@@ -59,6 +60,11 @@ tc 0 rate = 1250000000         ; Bytes per second\n tc 1 rate = 1250000000         ; Bytes per second\n tc 2 rate = 1250000000         ; Bytes per second\n tc 3 rate = 1250000000         ; Bytes per second\n+tc 4 rate = 1250000000         ; Bytes per second\n+tc 5 rate = 1250000000         ; Bytes per second\n+tc 6 rate = 1250000000         ; Bytes per second\n+tc 7 rate = 1250000000         ; Bytes per second\n+tc 8 rate = 1250000000         ; Bytes per second\n tc period = 10                 ; Milliseconds\n \n pipe 0-4095 = 0                ; These pipes are configured with pipe profile 0\n@@ -72,14 +78,16 @@ tc 0 rate = 305175             ; Bytes per second\n tc 1 rate = 305175             ; Bytes per second\n tc 2 rate = 305175             ; Bytes per second\n tc 3 rate = 305175             ; Bytes per second\n-tc period = 40                 ; Milliseconds\n+tc 4 rate = 305175             ; Bytes per second\n+tc 5 rate = 305175             ; Bytes per second\n+tc 6 rate = 305175             ; Bytes per second\n+tc 7 rate = 305175             ; Bytes per second\n+tc 8 rate = 305175             ; Bytes per second\n+tc period = 160                ; Milliseconds\n \n-tc 3 oversubscription weight = 1\n+tc 8 oversubscription weight = 1\n \n-tc 0 wrr weights = 1 1 1 1\n-tc 1 wrr weights = 1 1 1 1\n-tc 2 wrr weights = 1 1 1 1\n-tc 3 wrr weights = 1 1 1 1\n+tc 8 wrr weights = 1 1 1 1 1 1 1 1\n \n ; RED params per traffic class and color (Green / Yellow / Red)\n [red]\n@@ -102,3 +110,28 @@ tc 3 wred min = 48 40 32\n tc 3 wred max = 64 64 64\n tc 3 wred inv prob = 10 10 10\n tc 3 wred weight = 9 9 9\n+\n+tc 4 wred min = 48 40 32\n+tc 4 wred max = 64 64 64\n+tc 4 wred inv prob = 10 10 10\n+tc 4 wred weight = 9 9 9\n+\n+tc 5 wred min = 48 40 32\n+tc 5 wred max = 64 64 64\n+tc 5 wred inv prob = 10 10 10\n+tc 5 wred weight = 9 9 9\n+\n+tc 6 wred min = 48 40 32\n+tc 6 wred max = 64 64 64\n+tc 6 wred inv prob = 10 10 10\n+tc 6 wred weight = 9 9 9\n+\n+tc 7 wred min = 48 40 32\n+tc 7 wred max = 64 64 64\n+tc 7 wred inv prob = 10 10 10\n+tc 7 wred weight = 9 9 9\n+\n+tc 8 wred min = 48 40 32\n+tc 8 wred max = 64 64 64\n+tc 8 wred inv prob = 10 10 10\n+tc 8 wred weight = 9 9 9\ndiff --git a/examples/qos_sched/profile_ov.cfg b/examples/qos_sched/profile_ov.cfg\nindex 33000df9e..450001d2b 100644\n--- a/examples/qos_sched/profile_ov.cfg\n+++ b/examples/qos_sched/profile_ov.cfg\n@@ -1,6 +1,6 @@\n ;   BSD LICENSE\n ;\n-;   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+;   Copyright(c) 2010-2019 Intel Corporation. All rights reserved.\n ;   All rights reserved.\n ;\n ;   Redistribution and use in source and binary forms, with or without\n@@ -33,11 +33,12 @@\n [port]\n frame overhead = 24\n number of subports per port = 1\n-number of pipes per subport = 32\n-queue sizes = 64 64 64 64\n \n ; Subport configuration\n [subport 0]\n+number of pipes per subport = 32\n+queue sizes = 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64\n+\n tb rate = 8400000           ; Bytes per second\n tb size = 100000            ; Bytes\n \n@@ -45,6 +46,11 @@ tc 0 rate = 8400000         ; Bytes per second\n tc 1 rate = 8400000         ; Bytes per second\n tc 2 rate = 8400000         ; Bytes per second\n tc 3 rate = 8400000         ; Bytes per second\n+tc 4 rate = 8400000         ; Bytes per second\n+tc 5 rate = 8400000         ; Bytes per second\n+tc 6 rate = 8400000         ; Bytes per second\n+tc 7 rate = 8400000         ; Bytes per second\n+tc 8 rate = 8400000         ; Bytes per second\n tc period = 10              ; Milliseconds\n \n pipe 0-31 = 0               ; These pipes are configured with pipe profile 0\n@@ -58,14 +64,16 @@ tc 0 rate = 16800000           ; Bytes per second\n tc 1 rate = 16800000           ; Bytes per second\n tc 2 rate = 16800000           ; Bytes per second\n tc 3 rate = 16800000           ; Bytes per second\n+tc 4 rate = 16800000           ; Bytes per second\n+tc 5 rate = 16800000           ; Bytes per second\n+tc 6 rate = 16800000           ; Bytes per second\n+tc 7 rate = 16800000           ; Bytes per second\n+tc 8 rate = 16800000           ; Bytes per second\n tc period = 28                 ; Milliseconds\n \n tc 3 oversubscription weight = 1\n \n-tc 0 wrr weights = 1 1 1 1\n-tc 1 wrr weights = 1 1 1 1\n-tc 2 wrr weights = 1 1 1 1\n-tc 3 wrr weights = 1 1 1 1\n+tc 8 wrr weights = 1 1 1 1 1 1 1 1\n \n ; RED params per traffic class and color (Green / Yellow / Red)\n [red]\n@@ -88,3 +96,28 @@ tc 3 wred min = 48 40 32\n tc 3 wred max = 64 64 64\n tc 3 wred inv prob = 10 10 10\n tc 3 wred weight = 9 9 9\n+\n+tc 4 wred min = 48 40 32\n+tc 4 wred max = 64 64 64\n+tc 4 wred inv prob = 10 10 10\n+tc 4 wred weight = 9 9 9\n+\n+tc 5 wred min = 48 40 32\n+tc 5 wred max = 64 64 64\n+tc 5 wred inv prob = 10 10 10\n+tc 5 wred weight = 9 9 9\n+\n+tc 6 wred min = 48 40 32\n+tc 6 wred max = 64 64 64\n+tc 6 wred inv prob = 10 10 10\n+tc 6 wred weight = 9 9 9\n+\n+tc 7 wred min = 48 40 32\n+tc 7 wred max = 64 64 64\n+tc 7 wred inv prob = 10 10 10\n+tc 7 wred weight = 9 9 9\n+\n+tc 8 wred min = 48 40 32\n+tc 8 wred max = 64 64 64\n+tc 8 wred inv prob = 10 10 10\n+tc 8 wred weight = 9 9 9\ndiff --git a/examples/qos_sched/stats.c b/examples/qos_sched/stats.c\nindex 8193d964c..f69c5afb0 100644\n--- a/examples/qos_sched/stats.c\n+++ b/examples/qos_sched/stats.c\n@@ -11,278 +11,333 @@ int\n qavg_q(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc,\n \t\tuint8_t q)\n {\n-        struct rte_sched_queue_stats stats;\n-        struct rte_sched_port *port;\n-        uint16_t qlen;\n-        uint32_t queue_id, count, i;\n-        uint32_t average;\n-\n-        for (i = 0; i < nb_pfc; i++) {\n-                if (qos_conf[i].tx_port == port_id)\n-                        break;\n-        }\n-        if (i == nb_pfc || subport_id >= port_params.n_subports_per_port || pipe_id >= port_params.n_pipes_per_subport\n-                        || tc >= RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE || q >= RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS)\n-                return -1;\n-\n-        port = qos_conf[i].sched_port;\n-\n-        queue_id = RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS * (subport_id * port_params.n_pipes_per_subport + pipe_id);\n-        queue_id = queue_id + (tc * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS + q);\n-\n-        average = 0;\n-\n-        for (count = 0; count < qavg_ntimes; count++) {\n-                rte_sched_queue_read_stats(port, queue_id, &stats, &qlen);\n-                average += qlen;\n-                usleep(qavg_period);\n-        }\n-\n-        average /= qavg_ntimes;\n-\n-        printf(\"\\nAverage queue size: %\" PRIu32 \" bytes.\\n\\n\", average);\n-\n-        return 0;\n+\tstruct rte_sched_queue_stats stats;\n+\tstruct rte_sched_port *port;\n+\tuint16_t qlen;\n+\tuint32_t count, i, queue_id = 0;\n+\tuint32_t average;\n+\n+\tfor (i = 0; i < nb_pfc; i++) {\n+\t\tif (qos_conf[i].tx_port == port_id)\n+\t\t\tbreak;\n+\t}\n+\n+\tif (i == nb_pfc || subport_id >= port_params.n_subports_per_port ||\n+\t\tpipe_id >= subport_params[subport_id].n_subport_pipes  ||\n+\t\ttc >= RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE ||\n+\t\tq >= RTE_SCHED_BE_QUEUES_PER_PIPE ||\n+\t\t(tc < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE - 1 && q > 0))\n+\t\t\treturn -1;\n+\n+\tport = qos_conf[i].sched_port;\n+\tfor (i = 0; i < subport_id; i++)\n+\t\tqueue_id += subport_params[i].n_subport_pipes *\n+\t\t\t\tRTE_SCHED_QUEUES_PER_PIPE;\n+\tif (tc < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE - 1)\n+\t\tqueue_id += pipe_id * RTE_SCHED_QUEUES_PER_PIPE + tc;\n+\telse\n+\t\tqueue_id += pipe_id * RTE_SCHED_QUEUES_PER_PIPE + tc + q;\n+\n+\taverage = 0;\n+\tfor (count = 0; count < qavg_ntimes; count++) {\n+\t\trte_sched_queue_read_stats(port, queue_id, &stats, &qlen);\n+\t\taverage += qlen;\n+\t\tusleep(qavg_period);\n+\t}\n+\n+\taverage /= qavg_ntimes;\n+\n+\tprintf(\"\\nAverage queue size: %\" PRIu32 \" bytes.\\n\\n\", average);\n+\n+\treturn 0;\n }\n \n int\n qavg_tcpipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id,\n-\t     uint8_t tc)\n+\t\tuint8_t tc)\n {\n-        struct rte_sched_queue_stats stats;\n-        struct rte_sched_port *port;\n-        uint16_t qlen;\n-        uint32_t queue_id, count, i;\n-        uint32_t average, part_average;\n+\tstruct rte_sched_queue_stats stats;\n+\tstruct rte_sched_port *port;\n+\tuint16_t qlen;\n+\tuint32_t count, i, queue_id = 0;\n+\tuint32_t average, part_average;\n+\n+\tfor (i = 0; i < nb_pfc; i++) {\n+\t\tif (qos_conf[i].tx_port == port_id)\n+\t\t\tbreak;\n+\t}\n+\n+\tif (i == nb_pfc || subport_id >= port_params.n_subports_per_port ||\n+\t\tpipe_id >= subport_params[subport_id].n_subport_pipes ||\n+\t\ttc >= RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE)\n+\t\treturn -1;\n+\n+\tport = qos_conf[i].sched_port;\n \n-        for (i = 0; i < nb_pfc; i++) {\n-                if (qos_conf[i].tx_port == port_id)\n-                        break;\n-        }\n-        if (i == nb_pfc || subport_id >= port_params.n_subports_per_port || pipe_id >= port_params.n_pipes_per_subport\n-                        || tc >= RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE)\n-                return -1;\n+\tfor (i = 0; i < subport_id; i++)\n+\t\tqueue_id += subport_params[i].n_subport_pipes * RTE_SCHED_QUEUES_PER_PIPE;\n \n-        port = qos_conf[i].sched_port;\n+\tqueue_id += pipe_id * RTE_SCHED_QUEUES_PER_PIPE + tc;\n \n-        queue_id = RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS * (subport_id * port_params.n_pipes_per_subport + pipe_id);\n+\taverage = 0;\n \n-        average = 0;\n+\tfor (count = 0; count < qavg_ntimes; count++) {\n+\t\tpart_average = 0;\n \n-        for (count = 0; count < qavg_ntimes; count++) {\n-                part_average = 0;\n-                for (i = 0; i < RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS; i++) {\n-                        rte_sched_queue_read_stats(port, queue_id + (tc * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS + i), &stats, &qlen);\n-                        part_average += qlen;\n-                }\n-                average += part_average / RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS;\n-                usleep(qavg_period);\n-        }\n+\t\tif (tc < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE - 1) {\n+\t\t\trte_sched_queue_read_stats(port, queue_id, &stats, &qlen);\n+\t\t\tpart_average += qlen;\n+\t\t} else {\n+\t\t\tfor (i = 0; i < RTE_SCHED_BE_QUEUES_PER_PIPE; i++) {\n+\t\t\t\trte_sched_queue_read_stats(port, queue_id + i, &stats, &qlen);\n+\t\t\t\tpart_average += qlen;\n+\t\t\t}\n+\t\t\taverage += part_average / RTE_SCHED_BE_QUEUES_PER_PIPE;\n+\t\t}\n+\t\tusleep(qavg_period);\n+\t}\n \n-        average /= qavg_ntimes;\n+\taverage /= qavg_ntimes;\n \n-        printf(\"\\nAverage queue size: %\" PRIu32 \" bytes.\\n\\n\", average);\n+\tprintf(\"\\nAverage queue size: %\" PRIu32 \" bytes.\\n\\n\", average);\n \n-        return 0;\n+\treturn 0;\n }\n \n int\n qavg_pipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id)\n {\n-        struct rte_sched_queue_stats stats;\n-        struct rte_sched_port *port;\n-        uint16_t qlen;\n-        uint32_t queue_id, count, i;\n-        uint32_t average, part_average;\n+\tstruct rte_sched_queue_stats stats;\n+\tstruct rte_sched_port *port;\n+\tuint16_t qlen;\n+\tuint32_t count, i, queue_id = 0;\n+\tuint32_t average, part_average;\n \n-        for (i = 0; i < nb_pfc; i++) {\n-                if (qos_conf[i].tx_port == port_id)\n-                        break;\n-        }\n-        if (i == nb_pfc || subport_id >= port_params.n_subports_per_port || pipe_id >= port_params.n_pipes_per_subport)\n-                return -1;\n+\tfor (i = 0; i < nb_pfc; i++) {\n+\t\tif (qos_conf[i].tx_port == port_id)\n+\t\t\tbreak;\n+\t}\n \n-        port = qos_conf[i].sched_port;\n+\tif (i == nb_pfc ||\n+\t\tsubport_id >= port_params.n_subports_per_port ||\n+\t\tpipe_id >= subport_params[subport_id].n_subport_pipes)\n+\t\treturn -1;\n \n-        queue_id = RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS * (subport_id * port_params.n_pipes_per_subport + pipe_id);\n+\tport = qos_conf[i].sched_port;\n \n-        average = 0;\n+\tfor (i = 0; i < subport_id; i++)\n+\t\tqueue_id += subport_params[i].n_subport_pipes *\n+\t\t\t\tRTE_SCHED_QUEUES_PER_PIPE;\n \n-        for (count = 0; count < qavg_ntimes; count++) {\n-                part_average = 0;\n-                for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS; i++) {\n-                        rte_sched_queue_read_stats(port, queue_id + i, &stats, &qlen);\n-                        part_average += qlen;\n-                }\n-                average += part_average / (RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS);\n-                usleep(qavg_period);\n-        }\n+\tqueue_id += pipe_id * RTE_SCHED_QUEUES_PER_PIPE;\n \n-        average /= qavg_ntimes;\n+\taverage = 0;\n \n-        printf(\"\\nAverage queue size: %\" PRIu32 \" bytes.\\n\\n\", average);\n+\tfor (count = 0; count < qavg_ntimes; count++) {\n+\t\tpart_average = 0;\n+\t\tfor (i = 0; i < RTE_SCHED_QUEUES_PER_PIPE; i++) {\n+\t\t\trte_sched_queue_read_stats(port, queue_id + i, &stats, &qlen);\n+\t\t\tpart_average += qlen;\n+\t\t}\n+\t\taverage += part_average / RTE_SCHED_QUEUES_PER_PIPE;\n+\t\tusleep(qavg_period);\n+\t}\n \n-        return 0;\n+\taverage /= qavg_ntimes;\n+\n+\tprintf(\"\\nAverage queue size: %\" PRIu32 \" bytes.\\n\\n\", average);\n+\n+\treturn 0;\n }\n \n int\n qavg_tcsubport(uint16_t port_id, uint32_t subport_id, uint8_t tc)\n {\n-        struct rte_sched_queue_stats stats;\n-        struct rte_sched_port *port;\n-        uint16_t qlen;\n-        uint32_t queue_id, count, i, j;\n-        uint32_t average, part_average;\n-\n-        for (i = 0; i < nb_pfc; i++) {\n-                if (qos_conf[i].tx_port == port_id)\n-                        break;\n-        }\n-        if (i == nb_pfc || subport_id >= port_params.n_subports_per_port || tc >= RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE)\n-                return -1;\n-\n-        port = qos_conf[i].sched_port;\n-\n-        average = 0;\n-\n-        for (count = 0; count < qavg_ntimes; count++) {\n-                part_average = 0;\n-                for (i = 0; i < port_params.n_pipes_per_subport; i++) {\n-                        queue_id = RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS * (subport_id * port_params.n_pipes_per_subport + i);\n-\n-                        for (j = 0; j < RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS; j++) {\n-                                rte_sched_queue_read_stats(port, queue_id + (tc * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS + j), &stats, &qlen);\n-                                part_average += qlen;\n-                        }\n-                }\n-\n-                average += part_average / (port_params.n_pipes_per_subport * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS);\n-                usleep(qavg_period);\n-        }\n-\n-        average /= qavg_ntimes;\n-\n-        printf(\"\\nAverage queue size: %\" PRIu32 \" bytes.\\n\\n\", average);\n-\n-        return 0;\n+\tstruct rte_sched_queue_stats stats;\n+\tstruct rte_sched_port *port;\n+\tuint16_t qlen;\n+\tuint32_t queue_id, count, i, j, subport_queue_id = 0;\n+\tuint32_t average, part_average;\n+\n+\tfor (i = 0; i < nb_pfc; i++) {\n+\t\tif (qos_conf[i].tx_port == port_id)\n+\t\t\tbreak;\n+\t}\n+\n+\tif (i == nb_pfc ||\n+\t\tsubport_id >= port_params.n_subports_per_port ||\n+\t\ttc >= RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE)\n+\t\treturn -1;\n+\n+\tport = qos_conf[i].sched_port;\n+\n+\tfor (i = 0; i < subport_id; i++)\n+\t\tsubport_queue_id += subport_params[i].n_subport_pipes * RTE_SCHED_QUEUES_PER_PIPE;\n+\n+\taverage = 0;\n+\n+\tfor (count = 0; count < qavg_ntimes; count++) {\n+\t\tpart_average = 0;\n+\t\tfor (i = 0; i < subport_params[subport_id].n_subport_pipes; i++) {\n+\t\t\tif (tc < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE - 1) {\n+\t\t\t\tqueue_id = subport_queue_id + i * RTE_SCHED_QUEUES_PER_PIPE + tc;\n+\t\t\t\trte_sched_queue_read_stats(port, queue_id, &stats, &qlen);\n+\t\t\t\tpart_average += qlen;\n+\t\t\t} else {\n+\t\t\t\tfor (j = 0; j < RTE_SCHED_BE_QUEUES_PER_PIPE; j++) {\n+\t\t\t\t\tqueue_id = subport_queue_id +\n+\t\t\t\t\t\t\ti * RTE_SCHED_QUEUES_PER_PIPE + tc + j;\n+\t\t\t\t\trte_sched_queue_read_stats(port, queue_id, &stats, &qlen);\n+\t\t\t\t\tpart_average += qlen;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\n+\t\tif (tc < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE - 1)\n+\t\t\taverage += part_average / (subport_params[subport_id].n_subport_pipes);\n+\t\telse\n+\t\t\taverage += part_average / (subport_params[subport_id].n_subport_pipes) * RTE_SCHED_BE_QUEUES_PER_PIPE;\n+\n+\t\tusleep(qavg_period);\n+\t}\n+\n+\taverage /= qavg_ntimes;\n+\n+\tprintf(\"\\nAverage queue size: %\" PRIu32 \" bytes.\\n\\n\", average);\n+\n+\treturn 0;\n }\n \n int\n qavg_subport(uint16_t port_id, uint32_t subport_id)\n {\n-        struct rte_sched_queue_stats stats;\n-        struct rte_sched_port *port;\n-        uint16_t qlen;\n-        uint32_t queue_id, count, i, j;\n-        uint32_t average, part_average;\n+\tstruct rte_sched_queue_stats stats;\n+\tstruct rte_sched_port *port;\n+\tuint16_t qlen;\n+\tuint32_t queue_id, count, i, j, subport_queue_id = 0;\n+\tuint32_t average, part_average;\n+\n+\tfor (i = 0; i < nb_pfc; i++) {\n+\t\tif (qos_conf[i].tx_port == port_id)\n+\t\t\tbreak;\n+\t}\n+\n+\tif (i == nb_pfc ||\n+\t\tsubport_id >= port_params.n_subports_per_port)\n+\t\treturn -1;\n \n-        for (i = 0; i < nb_pfc; i++) {\n-                if (qos_conf[i].tx_port == port_id)\n-                        break;\n-        }\n-        if (i == nb_pfc || subport_id >= port_params.n_subports_per_port)\n-                return -1;\n+\tport = qos_conf[i].sched_port;\n \n-        port = qos_conf[i].sched_port;\n+\tfor (i = 0; i < subport_id; i++)\n+\t\tsubport_queue_id += subport_params[i].n_subport_pipes * RTE_SCHED_QUEUES_PER_PIPE;\n \n-        average = 0;\n+\taverage = 0;\n \n-        for (count = 0; count < qavg_ntimes; count++) {\n-                part_average = 0;\n-                for (i = 0; i < port_params.n_pipes_per_subport; i++) {\n-                        queue_id = RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS * (subport_id * port_params.n_pipes_per_subport + i);\n+\tfor (count = 0; count < qavg_ntimes; count++) {\n+\t\tpart_average = 0;\n+\t\tfor (i = 0; i < subport_params[subport_id].n_subport_pipes; i++) {\n+\t\t\tqueue_id = subport_queue_id + i * RTE_SCHED_QUEUES_PER_PIPE;\n \n-                        for (j = 0; j < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS; j++) {\n-                                rte_sched_queue_read_stats(port, queue_id + j, &stats, &qlen);\n-                                part_average += qlen;\n-                        }\n-                }\n+\t\t\tfor (j = 0; j < RTE_SCHED_QUEUES_PER_PIPE; j++) {\n+\t\t\t\trte_sched_queue_read_stats(port, queue_id + j, &stats, &qlen);\n+\t\t\t\tpart_average += qlen;\n+\t\t\t}\n+\t\t}\n \n-                average += part_average / (port_params.n_pipes_per_subport * RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS);\n-                usleep(qavg_period);\n-        }\n+\t\taverage += part_average / (subport_params[subport_id].n_subport_pipes * RTE_SCHED_QUEUES_PER_PIPE);\n+\t\tusleep(qavg_period);\n+\t}\n \n-        average /= qavg_ntimes;\n+\taverage /= qavg_ntimes;\n \n-        printf(\"\\nAverage queue size: %\" PRIu32 \" bytes.\\n\\n\", average);\n+\tprintf(\"\\nAverage queue size: %\" PRIu32 \" bytes.\\n\\n\", average);\n \n-        return 0;\n+\treturn 0;\n }\n \n int\n subport_stat(uint16_t port_id, uint32_t subport_id)\n {\n-        struct rte_sched_subport_stats stats;\n-        struct rte_sched_port *port;\n-        uint32_t tc_ov[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];\n-        uint8_t i;\n-\n-        for (i = 0; i < nb_pfc; i++) {\n-                if (qos_conf[i].tx_port == port_id)\n-                        break;\n-        }\n-        if (i == nb_pfc || subport_id >= port_params.n_subports_per_port)\n-                return -1;\n-\n-        port = qos_conf[i].sched_port;\n+\tstruct rte_sched_subport_stats stats;\n+\tstruct rte_sched_port *port;\n+\tuint32_t tc_ov[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];\n+\tuint8_t i;\n+\n+\tfor (i = 0; i < nb_pfc; i++) {\n+\t\tif (qos_conf[i].tx_port == port_id)\n+\t\t\tbreak;\n+\t}\n+\n+\tif (i == nb_pfc || subport_id >= port_params.n_subports_per_port)\n+\t\treturn -1;\n+\n+\tport = qos_conf[i].sched_port;\n \tmemset (tc_ov, 0, sizeof(tc_ov));\n \n-        rte_sched_subport_read_stats(port, subport_id, &stats, tc_ov);\n+\trte_sched_subport_read_stats(port, subport_id, &stats, tc_ov);\n \n-        printf(\"\\n\");\n-        printf(\"+----+-------------+-------------+-------------+-------------+-------------+\\n\");\n-        printf(\"| TC |   Pkts OK   |Pkts Dropped |  Bytes OK   |Bytes Dropped|  OV Status  |\\n\");\n-        printf(\"+----+-------------+-------------+-------------+-------------+-------------+\\n\");\n+\tprintf(\"\\n\");\n+\tprintf(\"+----+-------------+-------------+-------------+-------------+-------------+\\n\");\n+\tprintf(\"| TC |   Pkts OK   |Pkts Dropped |  Bytes OK   |Bytes Dropped|  OV Status  |\\n\");\n+\tprintf(\"+----+-------------+-------------+-------------+-------------+-------------+\\n\");\n \n-        for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) {\n-                printf(\"|  %d | %11\" PRIu32 \" | %11\" PRIu32 \" | %11\" PRIu32 \" | %11\" PRIu32 \" | %11\" PRIu32 \" |\\n\", i,\n-                                stats.n_pkts_tc[i], stats.n_pkts_tc_dropped[i],\n-                                stats.n_bytes_tc[i], stats.n_bytes_tc_dropped[i], tc_ov[i]);\n-                printf(\"+----+-------------+-------------+-------------+-------------+-------------+\\n\");\n-        }\n-        printf(\"\\n\");\n+\tfor (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) {\n+\t\tprintf(\"|  %d | %11\" PRIu32 \" | %11\" PRIu32 \" | %11\" PRIu32 \" | %11\" PRIu32 \" | %11\" PRIu32 \" |\\n\", i,\n+\t\tstats.n_pkts_tc[i], stats.n_pkts_tc_dropped[i],\n+\t\tstats.n_bytes_tc[i], stats.n_bytes_tc_dropped[i], tc_ov[i]);\n+\t\tprintf(\"+----+-------------+-------------+-------------+-------------+-------------+\\n\");\n+\t}\n+\tprintf(\"\\n\");\n \n-        return 0;\n+\treturn 0;\n }\n \n int\n pipe_stat(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id)\n {\n-        struct rte_sched_queue_stats stats;\n-        struct rte_sched_port *port;\n-        uint16_t qlen;\n-        uint8_t i, j;\n-        uint32_t queue_id;\n-\n-        for (i = 0; i < nb_pfc; i++) {\n-                if (qos_conf[i].tx_port == port_id)\n-                        break;\n-        }\n-        if (i == nb_pfc || subport_id >= port_params.n_subports_per_port || pipe_id >= port_params.n_pipes_per_subport)\n-                return -1;\n-\n-        port = qos_conf[i].sched_port;\n-\n-        queue_id = RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS * (subport_id * port_params.n_pipes_per_subport + pipe_id);\n-\n-        printf(\"\\n\");\n-        printf(\"+----+-------+-------------+-------------+-------------+-------------+-------------+\\n\");\n-        printf(\"| TC | Queue |   Pkts OK   |Pkts Dropped |  Bytes OK   |Bytes Dropped|    Length   |\\n\");\n-        printf(\"+----+-------+-------------+-------------+-------------+-------------+-------------+\\n\");\n-\n-        for (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) {\n-                for (j = 0; j < RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS; j++) {\n-\n-                        rte_sched_queue_read_stats(port, queue_id + (i * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS + j), &stats, &qlen);\n-\n-                        printf(\"|  %d |   %d   | %11\" PRIu32 \" | %11\" PRIu32 \" | %11\" PRIu32 \" | %11\" PRIu32 \" | %11i |\\n\", i, j,\n-                                        stats.n_pkts, stats.n_pkts_dropped, stats.n_bytes, stats.n_bytes_dropped, qlen);\n-                        printf(\"+----+-------+-------------+-------------+-------------+-------------+-------------+\\n\");\n-                }\n-                if (i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE - 1)\n-                        printf(\"+----+-------+-------------+-------------+-------------+-------------+-------------+\\n\");\n-        }\n-        printf(\"\\n\");\n-\n-        return 0;\n+\tstruct rte_sched_queue_stats stats;\n+\tstruct rte_sched_port *port;\n+\tuint16_t qlen;\n+\tuint8_t i, j;\n+\tuint32_t queue_id = 0;\n+\n+\tfor (i = 0; i < nb_pfc; i++) {\n+\t\tif (qos_conf[i].tx_port == port_id)\n+\t\t\tbreak;\n+\t}\n+\n+\tif (i == nb_pfc ||\n+\t\tsubport_id >= port_params.n_subports_per_port ||\n+\t\tpipe_id >= subport_params[subport_id].n_subport_pipes)\n+\t\treturn -1;\n+\n+\tport = qos_conf[i].sched_port;\n+\tfor (i = 0; i < subport_id; i++)\n+\t\tqueue_id += subport_params[i].n_subport_pipes * RTE_SCHED_QUEUES_PER_PIPE;\n+\n+\tqueue_id += pipe_id * RTE_SCHED_QUEUES_PER_PIPE;\n+\n+\tprintf(\"\\n\");\n+\tprintf(\"+----+-------+-------------+-------------+-------------+-------------+-------------+\\n\");\n+\tprintf(\"| TC | Queue |   Pkts OK   |Pkts Dropped |  Bytes OK   |Bytes Dropped|    Length   |\\n\");\n+\tprintf(\"+----+-------+-------------+-------------+-------------+-------------+-------------+\\n\");\n+\n+\tfor (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) {\n+\t\tif (i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE - 1) {\n+\t\t\trte_sched_queue_read_stats(port, queue_id + i, &stats, &qlen);\n+\t\t\tprintf(\"|  %d |   %d   | %11\" PRIu32 \" | %11\" PRIu32 \" | %11\" PRIu32 \" | %11\" PRIu32 \" | %11i |\\n\", i, 0,\n+\t\t\t\tstats.n_pkts, stats.n_pkts_dropped, stats.n_bytes, stats.n_bytes_dropped, qlen);\n+\t\t\tprintf(\"+----+-------+-------------+-------------+-------------+-------------+-------------+\\n\");\n+\t\t} else {\n+\t\t\tfor (j = 0; j < RTE_SCHED_BE_QUEUES_PER_PIPE; j++) {\n+\t\t\t\trte_sched_queue_read_stats(port, queue_id + i + j, &stats, &qlen);\n+\t\t\t\tprintf(\"|  %d |   %d   | %11\" PRIu32 \" | %11\" PRIu32 \" | %11\" PRIu32 \" | %11\" PRIu32 \" | %11i |\\n\", i, j,\n+\t\t\t\t\tstats.n_pkts, stats.n_pkts_dropped, stats.n_bytes, stats.n_bytes_dropped, qlen);\n+\t\t\t\tprintf(\"+----+-------+-------------+-------------+-------------+-------------+-------------+\\n\");\n+\t\t\t}\n+\t\t}\n+\t}\n+\tprintf(\"\\n\");\n+\n+\treturn 0;\n }\n",
    "prefixes": [
        "v2",
        "25/28"
    ]
}