get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77215,
    "url": "http://patches.dpdk.org/api/patches/77215/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1599763717-135002-7-git-send-email-savinay.dharmappa@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": "<1599763717-135002-7-git-send-email-savinay.dharmappa@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1599763717-135002-7-git-send-email-savinay.dharmappa@intel.com",
    "date": "2020-09-10T18:48:33",
    "name": "[v2,06/10] example/qos_sched: add dynamic config of subport",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "44078a0f3671ab4d7cb96809bafe7063c9e777df",
    "submitter": {
        "id": 1535,
        "url": "http://patches.dpdk.org/api/people/1535/?format=api",
        "name": "Savinay Dharmappa",
        "email": "savinay.dharmappa@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/1599763717-135002-7-git-send-email-savinay.dharmappa@intel.com/mbox/",
    "series": [
        {
            "id": 12110,
            "url": "http://patches.dpdk.org/api/series/12110/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12110",
            "date": "2020-09-10T18:48:27",
            "name": "Enable dynamic config of subport bandwidth",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/12110/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77215/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/77215/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 4838BA04B5;\n\tThu, 10 Sep 2020 20:49:48 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3EB7D1C11E;\n\tThu, 10 Sep 2020 20:49:00 +0200 (CEST)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by dpdk.org (Postfix) with ESMTP id AE83E1C0D4\n for <dev@dpdk.org>; Thu, 10 Sep 2020 20:48:54 +0200 (CEST)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Sep 2020 11:48:53 -0700",
            "from silpixa00400629.ir.intel.com ([10.237.214.135])\n by orsmga007.jf.intel.com with ESMTP; 10 Sep 2020 11:48:52 -0700"
        ],
        "IronPort-SDR": [
            "\n YZEnIKDG7KO8LcD6sPbd4nzbYQAu9oG/ZVDALxsnP/8H5v6N1SIvN8kkJnThyDq+TTj75LlOqT\n NrZtwJAUbu1A==",
            "\n 3yu9/G6FwP6SAq4A1gv1wv4G+O7PNqF/m+/UtUBxwp0Qbm1lL0PFg3q38KChZ8xWbz7OXLKBtE\n CJ2Tq9V3JKxg=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9740\"; a=\"138130668\"",
            "E=Sophos;i=\"5.76,413,1592895600\"; d=\"scan'208\";a=\"138130668\"",
            "E=Sophos;i=\"5.76,413,1592895600\"; d=\"scan'208\";a=\"344371113\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Savinay Dharmappa <savinay.dharmappa@intel.com>",
        "To": "jasvinder.singh@intel.com,\n\tcristian.dumitrescu@intel.com,\n\tdev@dpdk.org",
        "Cc": "savinay.dharmappa@intel.com",
        "Date": "Thu, 10 Sep 2020 19:48:33 +0100",
        "Message-Id": "<1599763717-135002-7-git-send-email-savinay.dharmappa@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1599763717-135002-1-git-send-email-savinay.dharmappa@intel.com>",
        "References": "<1599037006-3931-1-git-send-email-savinay.dharmappa@intel.com>\n <1599763717-135002-1-git-send-email-savinay.dharmappa@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 06/10] example/qos_sched: add dynamic config\n\tof subport",
        "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Modify the qos_sched application to build the hierarchical scheduler\nwith default subport bandwidth profile. It also allows to configure\na subport with different subport bandwidth profile dynamically.\n\nSigned-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>\n---\n examples/qos_sched/cfg_file.c  | 158 ++++++++++++++++++++++++-----------------\n examples/qos_sched/cfg_file.h  |   4 ++\n examples/qos_sched/init.c      |  24 +++++--\n examples/qos_sched/main.h      |   1 +\n examples/qos_sched/profile.cfg |   3 +\n 5 files changed, 120 insertions(+), 70 deletions(-)",
    "diff": "diff --git a/examples/qos_sched/cfg_file.c b/examples/qos_sched/cfg_file.c\nindex f078e4f..9e1341c 100644\n--- a/examples/qos_sched/cfg_file.c\n+++ b/examples/qos_sched/cfg_file.c\n@@ -53,8 +53,11 @@ cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe_params\n \tif (!cfg || !pipe_params)\n \t\treturn -1;\n \n-\tprofiles = rte_cfgfile_num_sections(cfg, \"pipe profile\", sizeof(\"pipe profile\") - 1);\n-\tsubport_params[0].n_pipe_profiles = profiles;\n+\tprofiles = rte_cfgfile_num_sections(cfg, \"pipe profile\",\n+\t\t\t\t\tsizeof(\"pipe profile\") - 1);\n+\tport_params.n_subport_profiles = profiles;\n+\n+\tprintf(\" profiles = %d\", profiles);\n \n \tfor (j = 0; j < profiles; j++) {\n \t\tchar pipe_name[32];\n@@ -143,6 +146,93 @@ cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe_params\n }\n \n int\n+cfg_load_subport_profile(struct rte_cfgfile *cfg,\n+\tstruct rte_sched_subport_profile_params *subport_profile)\n+{\n+\tint i;\n+\tconst char *entry;\n+\tint profiles;\n+\n+\tif (!cfg || !subport_profile)\n+\t\treturn -1;\n+\n+\tprofiles = rte_cfgfile_num_sections(cfg, \"subport profile\",\n+\t\t\t\t\t   sizeof(\"subport profile\") - 1);\n+\tsubport_params[0].n_pipe_profiles = profiles;\n+\n+\tfor (i = 0; i < profiles; i++) {\n+\t\tchar sec_name[32];\n+\t\tsnprintf(sec_name, sizeof(sec_name), \"subport profile %d\", i);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tb rate\");\n+\t\tif (entry)\n+\t\t\tsubport_profile[i].tb_rate = (uint64_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tb size\");\n+\t\tif (entry)\n+\t\t\tsubport_profile[i].tb_size = (uint64_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc period\");\n+\t\tif (entry)\n+\t\t\tsubport_profile[i].tc_period = (uint64_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 0 rate\");\n+\t\tif (entry)\n+\t\t\tsubport_profile[i].tc_rate[0] = (uint64_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 1 rate\");\n+\t\tif (entry)\n+\t\t\tsubport_profile[i].tc_rate[1] = (uint64_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 2 rate\");\n+\t\tif (entry)\n+\t\t\tsubport_profile[i].tc_rate[2] = (uint64_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 3 rate\");\n+\t\tif (entry)\n+\t\t\tsubport_profile[i].tc_rate[3] = (uint64_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 4 rate\");\n+\t\tif (entry)\n+\t\t\tsubport_profile[i].tc_rate[4] = (uint64_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 5 rate\");\n+\t\tif (entry)\n+\t\t\tsubport_profile[i].tc_rate[5] = (uint64_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 6 rate\");\n+\t\tif (entry)\n+\t\t\tsubport_profile[i].tc_rate[6] = (uint64_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 7 rate\");\n+\t\tif (entry)\n+\t\t\tsubport_profile[i].tc_rate[7] = (uint64_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 8 rate\");\n+\t\tif (entry)\n+\t\t\tsubport_profile[i].tc_rate[8] = (uint64_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 9 rate\");\n+\t\tif (entry)\n+\t\t\tsubport_profile[i].tc_rate[9] = (uint64_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 10 rate\");\n+\t\tif (entry)\n+\t\t\tsubport_profile[i].tc_rate[10] = (uint64_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 11 rate\");\n+\t\tif (entry)\n+\t\t\tsubport_profile[i].tc_rate[11] = (uint64_t)atoi(entry);\n+\n+\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 12 rate\");\n+\t\tif (entry)\n+\t\t\tsubport_profile[i].tc_rate[12] = (uint64_t)atoi(entry);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int\n cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport_params)\n {\n \tconst char *entry;\n@@ -267,70 +357,6 @@ cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subpo\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 = (uint64_t)atoi(entry);\n-\n-\t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tb size\");\n-\t\t\tif (entry)\n-\t\t\t\tsubport_params[i].tb_size = (uint64_t)atoi(entry);\n-\n-\t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc period\");\n-\t\t\tif (entry)\n-\t\t\t\tsubport_params[i].tc_period = (uint64_t)atoi(entry);\n-\n-\t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 0 rate\");\n-\t\t\tif (entry)\n-\t\t\t\tsubport_params[i].tc_rate[0] = (uint64_t)atoi(entry);\n-\n-\t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 1 rate\");\n-\t\t\tif (entry)\n-\t\t\t\tsubport_params[i].tc_rate[1] = (uint64_t)atoi(entry);\n-\n-\t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 2 rate\");\n-\t\t\tif (entry)\n-\t\t\t\tsubport_params[i].tc_rate[2] = (uint64_t)atoi(entry);\n-\n-\t\t\tentry = rte_cfgfile_get_entry(cfg, sec_name, \"tc 3 rate\");\n-\t\t\tif (entry)\n-\t\t\t\tsubport_params[i].tc_rate[3] = (uint64_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] = (uint64_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] = (uint64_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] = (uint64_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] = (uint64_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] = (uint64_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] = (uint64_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] = (uint64_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] = (uint64_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] = (uint64_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/cfg_file.h b/examples/qos_sched/cfg_file.h\nindex 2eccf1c..0dc458a 100644\n--- a/examples/qos_sched/cfg_file.h\n+++ b/examples/qos_sched/cfg_file.h\n@@ -14,4 +14,8 @@ int cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe);\n \n int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport);\n \n+int cfg_load_subport_profile(struct rte_cfgfile *cfg,\n+\t\t\t     struct rte_sched_subport_profile_params\n+\t\t\t     *subport_profile);\n+\n #endif\ndiff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c\nindex 9626c15..541adb7 100644\n--- a/examples/qos_sched/init.c\n+++ b/examples/qos_sched/init.c\n@@ -196,15 +196,20 @@ static struct rte_sched_pipe_params pipe_profiles[MAX_SCHED_PIPE_PROFILES] = {\n \t},\n };\n \n-struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {\n+static struct rte_sched_subport_profile_params\n+\t\tsubport_profile[MAX_SCHED_SUBPORT_PROFILES] = {\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+struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {\n+\t{\n \t\t.n_pipes_per_subport_enabled = 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@@ -289,6 +294,9 @@ 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_subport_profiles = 1,\n+\t.subport_profiles = subport_profile,\n+\t.n_max_subport_profiles = MAX_SCHED_SUBPORT_PROFILES,\n \t.n_pipes_per_subport = MAX_SCHED_PIPES,\n };\n \n@@ -320,8 +328,15 @@ app_init_sched_port(uint32_t portid, uint32_t socketid)\n \tfor (subport = 0; subport < port_params.n_subports_per_port; subport ++) {\n \t\terr = rte_sched_subport_config(port, subport, &subport_params[subport]);\n \t\tif (err) {\n-\t\t\trte_exit(EXIT_FAILURE, \"Unable to config sched subport %u, err=%d\\n\",\n-\t\t\t\t\tsubport, err);\n+\t\t\trte_exit(EXIT_FAILURE, \"Unable to config schedi \"\n+\t\t\t\t\"subport %u, err=%d\\n\", subport, err);\n+\t\t}\n+\n+\t\terr = rte_sched_subport_profile_config(port, subport, 0);\n+\t\tif (err) {\n+\t\t\trte_exit(EXIT_FAILURE, \"failed to configure \"\n+\t\t\t\t\"profile err=%d\\n\", err);\n+\n \t\t}\n \n \t\tuint32_t n_pipes_per_subport =\n@@ -354,6 +369,7 @@ app_load_cfg_profile(const char *profile)\n \n \tcfg_load_port(file, &port_params);\n \tcfg_load_subport(file, subport_params);\n+\tcfg_load_subport_profile(file, subport_profile);\n \tcfg_load_pipe(file, pipe_profiles);\n \n \trte_cfgfile_close(file);\ndiff --git a/examples/qos_sched/main.h b/examples/qos_sched/main.h\nindex 23bc418..0d6815a 100644\n--- a/examples/qos_sched/main.h\n+++ b/examples/qos_sched/main.h\n@@ -51,6 +51,7 @@ extern \"C\" {\n #define MAX_SCHED_SUBPORTS\t\t8\n #define MAX_SCHED_PIPES\t\t4096\n #define MAX_SCHED_PIPE_PROFILES\t\t256\n+#define MAX_SCHED_SUBPORT_PROFILES\t8\n \n #ifndef APP_COLLECT_STAT\n #define APP_COLLECT_STAT\t\t1\ndiff --git a/examples/qos_sched/profile.cfg b/examples/qos_sched/profile.cfg\nindex 61b8b70..4486d27 100644\n--- a/examples/qos_sched/profile.cfg\n+++ b/examples/qos_sched/profile.cfg\n@@ -26,6 +26,9 @@ 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 0-8 = 0                ; These subports are configured with subport profile 0\n+\n+[subport profile 0]\n tb rate = 1250000000           ; Bytes per second\n tb size = 1000000              ; Bytes\n \n",
    "prefixes": [
        "v2",
        "06/10"
    ]
}