get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 57879,
    "url": "https://patches.dpdk.org/api/patches/57879/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190823144602.58213-15-jasvinder.singh@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20190823144602.58213-15-jasvinder.singh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190823144602.58213-15-jasvinder.singh@intel.com",
    "date": "2019-08-23T14:46:01",
    "name": "[14/15] examples/qos_sched: add subport configuration flexibility",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "79dbeb10d01b5f7130ffb761eef6474ea6ee36f6",
    "submitter": {
        "id": 285,
        "url": "https://patches.dpdk.org/api/people/285/?format=api",
        "name": "Jasvinder Singh",
        "email": "jasvinder.singh@intel.com"
    },
    "delegate": {
        "id": 10018,
        "url": "https://patches.dpdk.org/api/users/10018/?format=api",
        "username": "cristian_dumitrescu",
        "first_name": "Cristian",
        "last_name": "Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190823144602.58213-15-jasvinder.singh@intel.com/mbox/",
    "series": [
        {
            "id": 6115,
            "url": "https://patches.dpdk.org/api/series/6115/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6115",
            "date": "2019-08-23T14:45:47",
            "name": "sched: subport level configuration of pipe nodes",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/6115/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/57879/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/57879/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 29CCE1C10D;\n\tFri, 23 Aug 2019 16:46:39 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 01F4E1C035\n\tfor <dev@dpdk.org>; Fri, 23 Aug 2019 16:46:22 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t23 Aug 2019 07:46:22 -0700",
            "from silpixa00381635.ir.intel.com (HELO\n\tsilpixa00381635.ger.corp.intel.com) ([10.237.223.4])\n\tby orsmga001.jf.intel.com with ESMTP; 23 Aug 2019 07:46:20 -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,421,1559545200\"; d=\"scan'208\";a=\"263211324\"",
        "From": "Jasvinder Singh <jasvinder.singh@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "cristian.dumitrescu@intel.com,\n\tLukasz Krakowiak <lukaszx.krakowiak@intel.com>",
        "Date": "Fri, 23 Aug 2019 15:46:01 +0100",
        "Message-Id": "<20190823144602.58213-15-jasvinder.singh@intel.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190823144602.58213-1-jasvinder.singh@intel.com>",
        "References": "<20190823144602.58213-1-jasvinder.singh@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 14/15] examples/qos_sched: add subport\n\tconfiguration 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": "Modify qos sample app to allow different subports of the same port\nto have different configuration in terms of number of pipes, pipe\nqueue sizes, etc.\n\nSigned-off-by: Jasvinder Singh <jasvinder.singh@intel.com>\nSigned-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>\n---\n examples/qos_sched/app_thread.c   |   4 +-\n examples/qos_sched/cfg_file.c     | 226 ++++++++++++++++--------------\n examples/qos_sched/init.c         |  54 +++----\n examples/qos_sched/main.h         |   1 +\n examples/qos_sched/profile.cfg    |   5 +-\n examples/qos_sched/profile_ov.cfg |   5 +-\n examples/qos_sched/stats.c        |  36 ++---\n 7 files changed, 179 insertions(+), 152 deletions(-)",
    "diff": "diff --git a/examples/qos_sched/app_thread.c b/examples/qos_sched/app_thread.c\nindex 18b734a14..e07cc7452 100644\n--- a/examples/qos_sched/app_thread.c\n+++ b/examples/qos_sched/app_thread.c\n@@ -36,9 +36,9 @@ get_pkt_sched(struct rte_mbuf *m, uint32_t *subport, uint32_t *pipe,\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\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\t(subport_params[*subport].n_pipes_per_subport - 1); /* Inner VLAN ID */\n \tpipe_queue = active_queues[(pdata[QUEUE_OFFSET] >> 8) % n_active_queues];\n \t*traffic_class = pipe_queue > RTE_SCHED_TRAFFIC_CLASS_BE ?\n \t\t\tRTE_SCHED_TRAFFIC_CLASS_BE : pipe_queue; /* Destination IP */\ndiff --git a/examples/qos_sched/cfg_file.c b/examples/qos_sched/cfg_file.c\nindex 45bf599e4..aaf7ca8f4 100644\n--- a/examples/qos_sched/cfg_file.c\n+++ b/examples/qos_sched/cfg_file.c\n@@ -24,14 +24,10 @@ 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 \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@@ -40,106 +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-\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-\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@@ -155,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@@ -253,12 +149,118 @@ 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_pipes_per_subport =\n+\t\t\t\t\t(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_TRAFFIC_CLASS_BE; j++) {\n+\t\t\t\t\tsubport_params[i].qsize[j] =\n+\t\t\t\t\t\t(uint16_t)strtol(entry, &next, 10);\n+\t\t\t\t\tif (subport_params[i].qsize[j] != 0) {\n+\t\t\t\t\t\tactive_queues[n_active_queues] = j;\n+\t\t\t\t\t\tn_active_queues++;\n+\t\t\t\t\t}\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+\n+\t\t\t\tfor (j = 0; j < RTE_SCHED_BE_QUEUES_PER_PIPE; j++) {\n+\t\t\t\t\tactive_queues[n_active_queues] =\n+\t\t\t\t\t\tRTE_SCHED_TRAFFIC_CLASS_BE + j;\n+\t\t\t\t\tn_active_queues++;\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@@ -362,6 +364,20 @@ 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+#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 b05206d5a..c18eea98c 100644\n--- a/examples/qos_sched/init.c\n+++ b/examples/qos_sched/init.c\n@@ -165,18 +165,6 @@ 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\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[MAX_SCHED_PIPE_PROFILES] = {\n \t{ /* Profile #0 */\n \t\t.tb_rate = 305175,\n@@ -193,19 +181,20 @@ static struct rte_sched_pipe_params pipe_profiles[MAX_SCHED_PIPE_PROFILES] = {\n \t},\n };\n \n-struct rte_sched_port_params port_params = {\n-\t.name = \"port_scheduler_0\",\n-\t.socket = 0, /* computed */\n-\t.rate = 0, /* computed */\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, 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+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\t1250000000, 1250000000, 1250000000, 1250000000, 1250000000,\n+\t\t\t1250000000, 1250000000, 1250000000, 1250000000},\n+\t\t.tc_period = 10,\n+\t\t.n_pipes_per_subport = 4096,\n+\t\t.qsize = {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) /\n+\t\t\tsizeof(struct rte_sched_pipe_params),\n #ifdef RTE_SCHED_RED\n \t.red_params = {\n \t\t/* Traffic Class 0 Colors Green / Yellow / Red */\n@@ -274,6 +263,18 @@ struct rte_sched_port_params port_params = {\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+\t},\n+};\n+\n+struct rte_sched_port_params port_params = {\n+\t.name = \"port_scheduler_0\",\n+\t.socket = 0, /* computed */\n+\t.rate = 0, /* computed */\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_max_pipes_per_subport = MAX_SCHED_PIPES,\n+\t.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,\n };\n \n static struct rte_sched_port *\n@@ -304,7 +305,10 @@ 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_pipes_per_subport =\n+\t\t\tsubport_params[subport].n_pipes_per_subport;\n+\n+\t\tfor (pipe = 0; pipe < 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 d8f890b64..baa2b3ead 100644\n--- a/examples/qos_sched/main.h\n+++ b/examples/qos_sched/main.h\n@@ -152,6 +152,7 @@ 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 335561370..61b8b7071 100644\n--- a/examples/qos_sched/profile.cfg\n+++ b/examples/qos_sched/profile.cfg\n@@ -20,11 +20,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 64 64 64 64 64 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\n+\n tb rate = 1250000000           ; Bytes per second\n tb size = 1000000              ; Bytes\n \ndiff --git a/examples/qos_sched/profile_ov.cfg b/examples/qos_sched/profile_ov.cfg\nindex 394987399..ab509d28d 100644\n--- a/examples/qos_sched/profile_ov.cfg\n+++ b/examples/qos_sched/profile_ov.cfg\n@@ -5,11 +5,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 64 64 64 64 64 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\n+\n tb rate = 8400000           ; Bytes per second\n tb size = 100000            ; Bytes\n \ndiff --git a/examples/qos_sched/stats.c b/examples/qos_sched/stats.c\nindex e62e4a2f6..0626cf6e6 100644\n--- a/examples/qos_sched/stats.c\n+++ b/examples/qos_sched/stats.c\n@@ -24,7 +24,7 @@ qavg_q(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc,\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\tpipe_id >= subport_params[subport_id].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@@ -32,7 +32,7 @@ qavg_q(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id, uint8_t tc,\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\tqueue_id += subport_params[i].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@@ -69,14 +69,15 @@ qavg_tcpipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id,\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\tpipe_id >= subport_params[subport_id].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+\t\tqueue_id +=\n+\t\t\tsubport_params[i].n_pipes_per_subport * RTE_SCHED_QUEUES_PER_PIPE;\n \n \tqueue_id += pipe_id * RTE_SCHED_QUEUES_PER_PIPE + tc;\n \n@@ -123,13 +124,13 @@ qavg_pipe(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id)\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\tpipe_id >= subport_params[subport_id].n_pipes_per_subport)\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 *\n+\t\tqueue_id += subport_params[i].n_pipes_per_subport *\n \t\t\t\tRTE_SCHED_QUEUES_PER_PIPE;\n \n \tqueue_id += pipe_id * RTE_SCHED_QUEUES_PER_PIPE;\n@@ -177,13 +178,13 @@ qavg_tcsubport(uint16_t port_id, uint32_t subport_id, uint8_t tc)\n \n \tfor (i = 0; i < subport_id; i++)\n \t\tsubport_queue_id +=\n-\t\t\tport_params.n_pipes_per_subport * RTE_SCHED_QUEUES_PER_PIPE;\n+\t\t\tsubport_params[i].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\tfor (i = 0; i < subport_params[subport_id].n_pipes_per_subport; i++) {\n \t\t\tif (tc < RTE_SCHED_TRAFFIC_CLASS_BE) {\n \t\t\t\tqueue_id = subport_queue_id +\n \t\t\t\t\ti * RTE_SCHED_QUEUES_PER_PIPE + tc;\n@@ -203,10 +204,11 @@ qavg_tcsubport(uint16_t port_id, uint32_t subport_id, uint8_t tc)\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\t\taverage += part_average /\n+\t\t\t\t(subport_params[subport_id].n_pipes_per_subport);\n \t\telse\n-\t\t\taverage +=\n-\t\t\t\tpart_average / (port_params.n_pipes_per_subport) *\n+\t\t\taverage += part_average /\n+\t\t\t\t(subport_params[subport_id].n_pipes_per_subport) *\n \t\t\t\tRTE_SCHED_BE_QUEUES_PER_PIPE;\n \n \t\tusleep(qavg_period);\n@@ -240,14 +242,14 @@ qavg_subport(uint16_t port_id, uint32_t subport_id)\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 *\n+\t\tsubport_queue_id += subport_params[i].n_pipes_per_subport *\n \t\t\tRTE_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\tfor (i = 0; i < subport_params[subport_id].n_pipes_per_subport; i++) {\n \t\t\tqueue_id = subport_queue_id + i * RTE_SCHED_QUEUES_PER_PIPE;\n \n \t\t\tfor (j = 0; j < RTE_SCHED_QUEUES_PER_PIPE; j++) {\n@@ -258,7 +260,8 @@ qavg_subport(uint16_t port_id, uint32_t subport_id)\n \t\t}\n \n \t\taverage += part_average /\n-\t\t\t(port_params.n_pipes_per_subport * RTE_SCHED_QUEUES_PER_PIPE);\n+\t\t\t(subport_params[subport_id].n_pipes_per_subport *\n+\t\t\tRTE_SCHED_QUEUES_PER_PIPE);\n \t\tusleep(qavg_period);\n \t}\n \n@@ -322,12 +325,13 @@ pipe_stat(uint16_t port_id, uint32_t subport_id, uint32_t pipe_id)\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\tpipe_id >= subport_params[subport_id].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+\t\tqueue_id += subport_params[i].n_pipes_per_subport *\n+\t\t\tRTE_SCHED_QUEUES_PER_PIPE;\n \n \tqueue_id += pipe_id * RTE_SCHED_QUEUES_PER_PIPE;\n \n",
    "prefixes": [
        "14/15"
    ]
}