get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 56795,
    "url": "http://patches.dpdk.org/api/patches/56795/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190719141825.101844-11-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": "<20190719141825.101844-11-jasvinder.singh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190719141825.101844-11-jasvinder.singh@intel.com",
    "date": "2019-07-19T14:18:24",
    "name": "[v6,10/11] examples/qos_sched: add tc and queue config flexibility",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a53fa4e9a71e94d22535aade9db156585a6dd5f1",
    "submitter": {
        "id": 285,
        "url": "http://patches.dpdk.org/api/people/285/?format=api",
        "name": "Jasvinder Singh",
        "email": "jasvinder.singh@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190719141825.101844-11-jasvinder.singh@intel.com/mbox/",
    "series": [
        {
            "id": 5625,
            "url": "http://patches.dpdk.org/api/series/5625/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5625",
            "date": "2019-07-19T14:18:14",
            "name": "sched: feature enhancements",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/5625/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/56795/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/56795/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 AC0BC1B9D9;\n\tFri, 19 Jul 2019 16:18:48 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 9777D1B964\n\tfor <dev@dpdk.org>; Fri, 19 Jul 2019 16:18:33 +0200 (CEST)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Jul 2019 07:18:31 -0700",
            "from silpixa00381635.ir.intel.com (HELO\n\tsilpixa00381635.ger.corp.intel.com) ([10.237.223.4])\n\tby orsmga008.jf.intel.com with ESMTP; 19 Jul 2019 07:18:31 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.64,282,1559545200\"; d=\"scan'208\";a=\"162417228\"",
        "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": "Fri, 19 Jul 2019 15:18:24 +0100",
        "Message-Id": "<20190719141825.101844-11-jasvinder.singh@intel.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190719141825.101844-1-jasvinder.singh@intel.com>",
        "References": "<20190717144245.138876-2-jasvinder.singh@intel.com>\n\t<20190719141825.101844-1-jasvinder.singh@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v6 10/11] examples/qos_sched: add tc and queue\n\tconfig flexibility",
        "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 for configuration flexibility of\npipe traffic classes and queues.\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     | 130 +++++---\n examples/qos_sched/init.c         |  63 +++-\n examples/qos_sched/main.h         |   4 +\n examples/qos_sched/profile.cfg    |  67 +++-\n examples/qos_sched/profile_ov.cfg |  54 +++-\n examples/qos_sched/stats.c        | 517 +++++++++++++++++-------------\n 7 files changed, 550 insertions(+), 296 deletions(-)",
    "diff": "diff --git a/examples/qos_sched/app_thread.c b/examples/qos_sched/app_thread.c\nindex e14b275e3..62a5cac31 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@@ -35,15 +33,16 @@ get_pkt_sched(struct rte_mbuf *m, uint32_t *subport, uint32_t *pipe,\n \t\t\tuint32_t *traffic_class, uint32_t *queue, uint32_t *color)\n {\n \tuint16_t *pdata = rte_pktmbuf_mtod(m, uint16_t *);\n+\tuint16_t pipe_queue;\n \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+\tpipe_queue = active_queues[(pdata[QUEUE_OFFSET] >> 8) % n_active_queues]; /* Destination IP */\n+\t*traffic_class = pipe_queue > RTE_SCHED_TRAFFIC_CLASS_BE ?\n+\t\t\tRTE_SCHED_TRAFFIC_CLASS_BE : pipe_queue;\n+\t*queue = pipe_queue - *traffic_class;\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..45bf599e4 100644\n--- a/examples/qos_sched/cfg_file.c\n+++ b/examples/qos_sched/cfg_file.c\n@@ -29,6 +29,9 @@ cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port_params\n \tif (!cfg || !port_params)\n \t\treturn -1;\n \n+\tmemset(active_queues, 0, sizeof(active_queues));\n+\tn_active_queues = 0;\n+\n \tentry = rte_cfgfile_get_entry(cfg, \"port\", \"frame overhead\");\n \tif (entry)\n \t\tport_params->frame_overhead = (uint32_t)atoi(entry);\n@@ -45,12 +48,25 @@ cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port_params\n \tif (entry) {\n \t\tchar *next;\n \n-\t\tfor(j = 0; j < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; j++) {\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+\n+\t\tfor (j = 0; j < RTE_SCHED_TRAFFIC_CLASS_BE; j++)\n+\t\t\tif (port_params->qsize[j]) {\n+\t\t\t\tactive_queues[n_active_queues] = j;\n+\t\t\t\tn_active_queues++;\n+\t\t\t}\n+\n+\t\tif (port_params->qsize[RTE_SCHED_TRAFFIC_CLASS_BE])\n+\t\t\tfor (j = 0; j < RTE_SCHED_BE_QUEUES_PER_PIPE; j++) {\n+\t\t\t\tactive_queues[n_active_queues] =\n+\t\t\t\t\tRTE_SCHED_TRAFFIC_CLASS_BE + j;\n+\t\t\t\tn_active_queues++;\n+\t\t\t}\n \t}\n \n #ifdef RTE_SCHED_RED\n@@ -173,46 +189,50 @@ 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-#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 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+\t\tentry = rte_cfgfile_get_entry(cfg, pipe_name, \"tc 9 rate\");\n+\t\tif (entry)\n+\t\t\tpipe_params[j].tc_rate[9] = (uint32_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, pipe_name, \"tc 10 rate\");\n+\t\tif (entry)\n+\t\t\tpipe_params[j].tc_rate[10] = (uint32_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, pipe_name, \"tc 11 rate\");\n+\t\tif (entry)\n+\t\t\tpipe_params[j].tc_rate[11] = (uint32_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, pipe_name, \"tc 12 rate\");\n+\t\tif (entry)\n+\t\t\tpipe_params[j].tc_rate[12] = (uint32_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, pipe_name, \"tc 12 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 12 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@@ -267,6 +287,42 @@ 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\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 9 rate\");\n+\t\t\tif (entry)\n+\t\t\t\tsubport_params[i].tc_rate[9] = (uint32_t)atoi(entry);\n+\n+\t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 10 rate\");\n+\t\t\tif (entry)\n+\t\t\t\tsubport_params[i].tc_rate[10] = (uint32_t)atoi(entry);\n+\n+\t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 11 rate\");\n+\t\t\tif (entry)\n+\t\t\t\tsubport_params[i].tc_rate[11] = (uint32_t)atoi(entry);\n+\n+\t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 12 rate\");\n+\t\t\tif (entry)\n+\t\t\t\tsubport_params[i].tc_rate[12] = (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 \ndiff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c\nindex 6b63d4e0e..b05206d5a 100644\n--- a/examples/qos_sched/init.c\n+++ b/examples/qos_sched/init.c\n@@ -170,17 +170,20 @@ static struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {\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_rate = {1250000000, 1250000000, 1250000000, 1250000000,\n+\t\t\t1250000000, 1250000000, 1250000000, 1250000000, 1250000000,\n+\t\t\t1250000000, 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,\n+\t\t\t305175, 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@@ -198,9 +201,10 @@ struct rte_sched_port_params port_params = {\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.qsize = {64, 64, 64, 64, 64, 64, 64, 64, 64, 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+\t.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,\n \n #ifdef RTE_SCHED_RED\n \t.red_params = {\n@@ -222,8 +226,53 @@ struct rte_sched_port_params port_params = {\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+\t\t[3][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\n+\t\t/* Traffic Class 4 - Colors Green / Yellow / Red */\n+\t\t[4][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[4][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[4][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\n+\t\t/* Traffic Class 5 - Colors Green / Yellow / Red */\n+\t\t[5][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[5][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[5][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\n+\t\t/* Traffic Class 6 - Colors Green / Yellow / Red */\n+\t\t[6][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[6][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[6][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\n+\t\t/* Traffic Class 7 - Colors Green / Yellow / Red */\n+\t\t[7][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[7][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[7][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\n+\t\t/* Traffic Class 8 - Colors Green / Yellow / Red */\n+\t\t[8][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[8][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[8][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\n+\t\t/* Traffic Class 9 - Colors Green / Yellow / Red */\n+\t\t[9][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[9][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[9][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\n+\t\t/* Traffic Class 10 - Colors Green / Yellow / Red */\n+\t\t[10][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[10][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[10][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\n+\t\t/* Traffic Class 11 - Colors Green / Yellow / Red */\n+\t\t[11][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[11][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[11][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\n+\t\t/* Traffic Class 12 - Colors Green / Yellow / Red */\n+\t\t[12][0] = {.min_th = 48, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[12][1] = {.min_th = 40, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t\t[12][2] = {.min_th = 32, .max_th = 64, .maxp_inv = 10, .wq_log2 = 9},\n+\t},\n #endif /* RTE_SCHED_RED */\n };\n \n@@ -255,7 +304,7 @@ 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\tfor (pipe = 0; pipe < port_params.n_pipes_per_subport; 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..d8f890b64 100644\n--- a/examples/qos_sched/main.h\n+++ b/examples/qos_sched/main.h\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,6 +148,9 @@ 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 \n int app_parse_args(int argc, char **argv);\ndiff --git a/examples/qos_sched/profile.cfg b/examples/qos_sched/profile.cfg\nindex f5b704cc6..df7c6d1d8 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,13 @@\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 13 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 13 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 4 queues of best effort traffic class are set\n+;\t\t  to 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@@ -48,7 +49,7 @@\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+queue sizes = 64 64 64 64 64 64 64 64 64 64 64 64 64\n \n ; Subport configuration\n [subport 0]\n@@ -59,6 +60,16 @@ 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 9 rate = 1250000000         ; Bytes per second\n+tc 10 rate = 1250000000        ; Bytes per second\n+tc 11 rate = 1250000000        ; Bytes per second\n+tc 12 rate = 1250000000        ; Bytes per second\n+\n tc period = 10                 ; Milliseconds\n \n pipe 0-4095 = 0                ; These pipes are configured with pipe profile 0\n@@ -72,14 +83,21 @@ 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 9 rate = 305175             ; Bytes per second\n+tc 10 rate = 305175            ; Bytes per second\n+tc 11 rate = 305175            ; Bytes per second\n+tc 12 rate = 305175            ; Bytes per second\n+\n+tc period = 40                ; Milliseconds\n \n-tc 3 oversubscription weight = 1\n+tc 12 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 12 wrr weights = 1 1 1 1\n \n ; RED params per traffic class and color (Green / Yellow / Red)\n [red]\n@@ -102,3 +120,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..c0b7b3c3d 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@@ -34,7 +34,7 @@\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+queue sizes = 64 64 64 64 64 64 64 64 64 64 64 64 64\n \n ; Subport configuration\n [subport 0]\n@@ -45,6 +45,15 @@ 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 9 rate = 8400000         ; Bytes per second\n+tc 10 rate = 8400000         ; Bytes per second\n+tc 11 rate = 8400000         ; Bytes per second\n+tc 12 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 +67,20 @@ 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 9 rate = 16800000           ; Bytes per second\n+tc 10 rate = 16800000           ; Bytes per second\n+tc 11 rate = 16800000           ; Bytes per second\n+tc 12 rate = 16800000           ; Bytes per second\n tc period = 28                 ; Milliseconds\n \n-tc 3 oversubscription weight = 1\n+tc 12 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 12 wrr weights = 1 1 1 1\n \n ; RED params per traffic class and color (Green / Yellow / Red)\n [red]\n@@ -88,3 +103,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..6f69dcfbe 100644\n--- a/examples/qos_sched/stats.c\n+++ b/examples/qos_sched/stats.c\n@@ -11,278 +11,341 @@ 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 ||\n+\t\tsubport_id >= port_params.n_subports_per_port ||\n+\t\tpipe_id >= port_params.n_pipes_per_subport  ||\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_CLASS_BE && q > 0))\n+\t\treturn -1;\n+\n+\tport = qos_conf[i].sched_port;\n+\tfor (i = 0; i < subport_id; i++)\n+\t\tqueue_id += port_params.n_pipes_per_subport *\n+\t\t\t\tRTE_SCHED_QUEUES_PER_PIPE;\n+\tif (tc < RTE_SCHED_TRAFFIC_CLASS_BE)\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-\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-\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-        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-\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, 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 >= port_params.n_pipes_per_subport ||\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\tqueue_id += port_params.n_pipes_per_subport * RTE_SCHED_QUEUES_PER_PIPE;\n+\n+\tqueue_id += pipe_id * RTE_SCHED_QUEUES_PER_PIPE + tc;\n+\n+\taverage = 0;\n+\n+\tfor (count = 0; count < qavg_ntimes; count++) {\n+\t\tpart_average = 0;\n+\n+\t\tif (tc < RTE_SCHED_TRAFFIC_CLASS_BE) {\n+\t\t\trte_sched_queue_read_stats(port, queue_id,\n+\t\t\t\t&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,\n+\t\t\t\t\t&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+\taverage /= qavg_ntimes;\n+\n+\tprintf(\"\\nAverage queue size: %\" PRIu32 \" bytes.\\n\\n\", average);\n+\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+\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-        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+\tif (i == nb_pfc ||\n+\t\tsubport_id >= port_params.n_subports_per_port ||\n+\t\tpipe_id >= port_params.n_pipes_per_subport)\n+\t\treturn -1;\n \n-        port = qos_conf[i].sched_port;\n+\tport = 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+\tfor (i = 0; i < subport_id; i++)\n+\t\tqueue_id += port_params.n_pipes_per_subport *\n+\t\t\t\tRTE_SCHED_QUEUES_PER_PIPE;\n \n-        average = 0;\n+\tqueue_id += pipe_id * RTE_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+\taverage = 0;\n \n-        average /= qavg_ntimes;\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,\n+\t\t\t\t&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-        printf(\"\\nAverage queue size: %\" PRIu32 \" bytes.\\n\\n\", average);\n+\taverage /= qavg_ntimes;\n \n-        return 0;\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 += port_params.n_pipes_per_subport * 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 < port_params.n_pipes_per_subport; i++) {\n+\t\t\tif (tc < RTE_SCHED_TRAFFIC_CLASS_BE) {\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,\n+\t\t\t\t\t&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,\n+\t\t\t\t\t\t&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_CLASS_BE)\n+\t\t\taverage += part_average / (port_params.n_pipes_per_subport);\n+\t\telse\n+\t\t\taverage +=\n+\t\t\t\tpart_average / (port_params.n_pipes_per_subport) * 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 += port_params.n_pipes_per_subport * 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 < port_params.n_pipes_per_subport; 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,\n+\t\t\t\t\t&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 / (port_params.n_pipes_per_subport * 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-\tmemset (tc_ov, 0, sizeof(tc_ov));\n-\n-        rte_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-\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-\n-        return 0;\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+\trte_sched_subport_read_stats(port, subport_id, &stats, tc_ov);\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+\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+\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 >= port_params.n_pipes_per_subport)\n+\t\treturn -1;\n+\n+\tport = qos_conf[i].sched_port;\n+\tfor (i = 0; i < subport_id; i++)\n+\t\tqueue_id += port_params.n_pipes_per_subport * 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_CLASS_BE) {\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": [
        "v6",
        "10/11"
    ]
}