Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/77211/?format=api
http://patches.dpdk.org/api/patches/77211/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1599763717-135002-4-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-4-git-send-email-savinay.dharmappa@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1599763717-135002-4-git-send-email-savinay.dharmappa@intel.com", "date": "2020-09-10T18:48:30", "name": "[v2,03/10] sched: add subport profile add and config api", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "daa1560a6564e980744bfad35f2c3474ad3c1dee", "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-4-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/77211/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/77211/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 1268EA04B5;\n\tThu, 10 Sep 2020 20:49:08 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 432121C0D0;\n\tThu, 10 Sep 2020 20:48:54 +0200 (CEST)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by dpdk.org (Postfix) with ESMTP id 34F5E160\n for <dev@dpdk.org>; Thu, 10 Sep 2020 20:48:50 +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:49 -0700", "from silpixa00400629.ir.intel.com ([10.237.214.135])\n by orsmga007.jf.intel.com with ESMTP; 10 Sep 2020 11:48:47 -0700" ], "IronPort-SDR": [ "\n bOtu9CbqFS0Z13h8MiWBUfpeIJgNMgmkEag1K7SmKdjK/yfT9d+XPbCrOiF63K08A/KvZJsR5p\n ALWcTKnJB3Rw==", "\n suq7B1vyQ3jCI9u/Y71Yiql4IMjLKHoTiraB/L09EtFgLqf5UvVZHyBbeepCjN8eYU8BktoiN7\n xPHdjlhMh4Hg==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9740\"; a=\"138130654\"", "E=Sophos;i=\"5.76,413,1592895600\"; d=\"scan'208\";a=\"138130654\"", "E=Sophos;i=\"5.76,413,1592895600\"; d=\"scan'208\";a=\"344371084\"" ], "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:30 +0100", "Message-Id": "<1599763717-135002-4-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 03/10] sched: add subport profile add and\n\tconfig api", "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": "Add apis to add new subport profile and configure it.\n\nSigned-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>\nSigned-off-by: Jasvinder Singh <jasvinder.singh@intel.com>\n---\n lib/librte_sched/rte_sched.c | 118 +++++++++++++++++++++++++++++++++\n lib/librte_sched/rte_sched.h | 45 +++++++++++++\n lib/librte_sched/rte_sched_version.map | 2 +\n 3 files changed, 165 insertions(+)", "diff": "diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c\nindex ec6e6bf..ba5700a 100644\n--- a/lib/librte_sched/rte_sched.c\n+++ b/lib/librte_sched/rte_sched.c\n@@ -175,6 +175,8 @@ struct rte_sched_subport {\n \t/* Statistics */\n \tstruct rte_sched_subport_stats stats __rte_cache_aligned;\n \n+\t/* subport profile flag */\n+\tuint32_t profile;\n \t/* Subport pipes */\n \tuint32_t n_pipes_per_subport_enabled;\n \tuint32_t n_pipe_profiles;\n@@ -1344,6 +1346,56 @@ rte_sched_subport_config(struct rte_sched_port *port,\n }\n \n int\n+rte_sched_subport_profile_config(struct rte_sched_port *port,\n+\tuint32_t subport_id,\n+\tuint32_t profile_id)\n+{\n+\tint i;\n+\tstruct rte_sched_subport_profile *params;\n+\tuint32_t n_subports = subport_id + 1;\n+\tstruct rte_sched_subport *s;\n+\n+\tif (port == NULL) {\n+\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\"%s: Incorrect value for parameter port\\n\", __func__);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (subport_id >= port->n_subports_per_port) {\n+\t\tRTE_LOG(ERR, SCHED, \"%s: \"\n+\t\t\"Incorrect value for parameter subport id\\n\", __func__);\n+\n+\t\trte_sched_free_memory(port, n_subports);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tparams = port->subport_profiles + profile_id;\n+\n+\ts = port->subports[subport_id];\n+\n+\ts->tb_credits = params->tb_size / 2;\n+\n+\ts->tc_time = port->time + params->tc_period;\n+\n+\tfor (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++)\n+\t\tif (s->qsize[i])\n+\t\t\ts->tc_credits[i] =\n+\t\t\t\tparams->tc_credits_per_period[i];\n+\t\telse\n+\t\t\tparams->tc_credits_per_period[i] = 0;\n+\n+#ifdef RTE_SCHED_SUBPORT_TC_OV\n+\ts->tc_ov_wm_max = rte_sched_time_ms_to_bytes(params->tc_period,\n+\t\t\t\t\t\t s->pipe_tc_be_rate_max);\n+#endif\n+\ts->profile = profile_id;\n+\n+\trte_sched_port_log_subport_profile(port, profile_id);\n+\n+\treturn 0;\n+}\n+\n+int\n rte_sched_pipe_config(struct rte_sched_port *port,\n \tuint32_t subport_id,\n \tuint32_t pipe_id,\n@@ -1527,6 +1579,72 @@ rte_sched_subport_pipe_profile_add(struct rte_sched_port *port,\n \treturn 0;\n }\n \n+int\n+rte_sched_port_subport_profile_add(struct rte_sched_port *port,\n+\tstruct rte_sched_subport_profile_params *params,\n+\tuint32_t *subport_profile_id)\n+{\n+\tint status;\n+\tuint32_t i;\n+\tstruct rte_sched_subport_profile *dst;\n+\n+\t/* Port */\n+\tif (port == NULL) {\n+\t\tRTE_LOG(ERR, SCHED, \"%s: \"\n+\t\t\"Incorrect value for parameter port\\n\", __func__);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (params == NULL) {\n+\t\tRTE_LOG(ERR, SCHED, \"%s: \"\n+\t\t\"Incorrect value for parameter profile\\n\", __func__);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (subport_profile_id == NULL) {\n+\t\tRTE_LOG(ERR, SCHED, \"%s: \"\n+\t\t\"Incorrect value for parameter subport_profile_id\\n\",\n+\t\t__func__);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tdst = port->subport_profiles + port->n_subport_profiles;\n+\n+\t/* Subport profiles exceeds the max limit */\n+\tif (port->n_subport_profiles >= port->n_max_subport_profiles) {\n+\t\tRTE_LOG(ERR, SCHED, \"%s: \"\n+\t\t\"Number of subport profiles exceeds the max limit\\n\",\n+\t\t __func__);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tstatus = subport_profile_check(params, port->rate);\n+\tif (status != 0) {\n+\t\tRTE_LOG(ERR, SCHED,\n+\t\t\"%s: subport profile check failed(%d)\\n\", __func__, status);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\trte_sched_subport_profile_convert(params, dst, port->rate);\n+\n+\t/* Subport profile should not exists */\n+\tfor (i = 0; i < port->n_subport_profiles; i++)\n+\t\tif (memcmp(port->subport_profiles + i,\n+\t\t params, sizeof(*params)) == 0) {\n+\t\t\tRTE_LOG(ERR, SCHED,\n+\t\t\t\"%s: subport profile exists\\n\", __func__);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t/* Subport profile commit */\n+\t*subport_profile_id = port->n_subport_profiles;\n+\tport->n_subport_profiles++;\n+\n+\trte_sched_port_log_subport_profile(port, *subport_profile_id);\n+\n+\treturn 0;\n+}\n+\n static inline uint32_t\n rte_sched_port_qindex(struct rte_sched_port *port,\n \tuint32_t subport,\ndiff --git a/lib/librte_sched/rte_sched.h b/lib/librte_sched/rte_sched.h\nindex 39339b7..a7c2638 100644\n--- a/lib/librte_sched/rte_sched.h\n+++ b/lib/librte_sched/rte_sched.h\n@@ -337,6 +337,29 @@ rte_sched_subport_pipe_profile_add(struct rte_sched_port *port,\n \tuint32_t *pipe_profile_id);\n \n /**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Hierarchical scheduler subport bandwidth profile add\n+ * Note that this function is safe to use in runtime for adding new\n+ * subport bandwidth profile as it doesn't have any impact on hiearchical\n+ * structure of the scheduler.\n+ * @param port\n+ * Handle to port scheduler instance\n+ * @param struct rte_sched_subport_profile\n+ * Subport bandwidth profile\n+ * @param subport_profile_d\n+ * Subport profile id\n+ * @return\n+ * 0 upon success, error code otherwise\n+ */\n+__rte_experimental\n+int\n+rte_sched_port_subport_profile_add(struct rte_sched_port *port,\n+\tstruct rte_sched_subport_profile_params *profile,\n+\tuint32_t *subport_profile_id);\n+\n+/**\n * Hierarchical scheduler subport configuration\n *\n * @param port\n@@ -354,6 +377,28 @@ rte_sched_subport_config(struct rte_sched_port *port,\n \tstruct rte_sched_subport_params *params);\n \n /**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Hierarchical scheduler subport profile configuration\n+ * Note that this function is safe to use in runtime for applying any specific\n+ * subport bandwidth profile as it doesn't have any impact on hiearchical\n+ * structure of the scheduler.\n+ * @param port\n+ * Handle to port scheduler instance\n+ * @param subport_id\n+ * Subport ID\n+ * @param profile_d\n+ * Subport profile id\n+ * @return\n+ * 0 upon success, error code otherwise\n+ */\n+__rte_experimental\n+int\n+rte_sched_subport_profile_config(struct rte_sched_port *port,\n+\tuint32_t subport_id,\n+\tuint32_t profile_id);\n+/**\n * Hierarchical scheduler pipe configuration\n *\n * @param port\ndiff --git a/lib/librte_sched/rte_sched_version.map b/lib/librte_sched/rte_sched_version.map\nindex 3faef6f..e64335f 100644\n--- a/lib/librte_sched/rte_sched_version.map\n+++ b/lib/librte_sched/rte_sched_version.map\n@@ -28,4 +28,6 @@ EXPERIMENTAL {\n \tglobal:\n \n \trte_sched_subport_pipe_profile_add;\n+\trte_sched_port_subport_profile_add;\n+\trte_sched_subport_profile_config;\n };\n", "prefixes": [ "v2", "03/10" ] }{ "id": 77211, "url": "