Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/77219/?format=api
http://patches.dpdk.org/api/patches/77219/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1599763717-135002-11-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-11-git-send-email-savinay.dharmappa@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1599763717-135002-11-git-send-email-savinay.dharmappa@intel.com", "date": "2020-09-10T18:48:37", "name": "[v2,10/10] sched: remove the redundant code", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "65452660f0734d0e7f0966e745c292ba12b07f2d", "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-11-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/77219/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/77219/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 148FDA04B5;\n\tThu, 10 Sep 2020 20:50:27 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 4FE651C12A;\n\tThu, 10 Sep 2020 20:49:11 +0200 (CEST)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by dpdk.org (Postfix) with ESMTP id 695BF1C122\n for <dev@dpdk.org>; Thu, 10 Sep 2020 20:49:00 +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:59 -0700", "from silpixa00400629.ir.intel.com ([10.237.214.135])\n by orsmga007.jf.intel.com with ESMTP; 10 Sep 2020 11:48:58 -0700" ], "IronPort-SDR": [ "\n PUyN8xB+1jBly59IdFfb/M69pUk+Mh/AvXpZatCMO97V5P20MAYg8mhjbJOgHRmbA7AgX1T936\n iQZFmy5V7yWQ==", "\n FGWgyTVl8XfraNaYSxYMfplHKDUy0X57Q9qZquGqWLIoznvkxEbdChvrdUuCORjASp0rp35S/d\n rbnmbDCHG2kA==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9740\"; a=\"138130694\"", "E=Sophos;i=\"5.76,413,1592895600\"; d=\"scan'208\";a=\"138130694\"", "E=Sophos;i=\"5.76,413,1592895600\"; d=\"scan'208\";a=\"344371152\"" ], "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:37 +0100", "Message-Id": "<1599763717-135002-11-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 10/10] sched: remove the redundant code", "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": "Remove redundant data structure fields references from\nfunctions and subport level data structures. It also\nupdate the release and deprecation note.\n\nSigned-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>\n---\n doc/guides/rel_notes/deprecation.rst | 6 --\n doc/guides/rel_notes/release_20_11.rst | 4 ++\n lib/librte_sched/rte_sched.c | 115 +--------------------------------\n lib/librte_sched/rte_sched.h | 12 ----\n 4 files changed, 6 insertions(+), 131 deletions(-)", "diff": "diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst\nindex 279eccb..3926c3c 100644\n--- a/doc/guides/rel_notes/deprecation.rst\n+++ b/doc/guides/rel_notes/deprecation.rst\n@@ -311,12 +311,6 @@ Deprecation Notices\n in \"rte_sched.h\". These changes are aligned to improvements suggested in the\n RFC https://mails.dpdk.org/archives/dev/2018-November/120035.html.\n \n-* sched: To allow dynamic configuration of the subport bandwidth profile,\n- changes will be made to data structures ``rte_sched_subport_params``,\n- ``rte_sched_port_params`` and new data structure, API functions will be\n- defined in ``rte_sched.h``. These changes are aligned as suggested in the\n- RFC https://mails.dpdk.org/archives/dev/2020-July/175161.html\n-\n * metrics: The function ``rte_metrics_init`` will have a non-void return\n in order to notify errors instead of calling ``rte_exit``.\n \ndiff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst\nindex df227a1..51c4568 100644\n--- a/doc/guides/rel_notes/release_20_11.rst\n+++ b/doc/guides/rel_notes/release_20_11.rst\n@@ -84,6 +84,10 @@ API Changes\n Also, make sure to start the actual text at the margin.\n =======================================================\n \n+* sched: The subport bandwidth configuration parameters such as tb_rate,\n+ tc_rate, tc_period etc., are moved from subport level data structure to\n+ new a data structure. This allows to configure a subport with different\n+ subport bandwidth configuration dynamically.\n \n ABI Changes\n -----------\ndiff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c\nindex 9ff67e0..6edc622 100644\n--- a/lib/librte_sched/rte_sched.c\n+++ b/lib/librte_sched/rte_sched.c\n@@ -153,16 +153,11 @@ struct rte_sched_grinder {\n struct rte_sched_subport {\n \t/* Token bucket (TB) */\n \tuint64_t tb_time; /* time of last update */\n-\tuint64_t tb_period;\n-\tuint64_t tb_credits_per_period;\n-\tuint64_t tb_size;\n \tuint64_t tb_credits;\n \n \t/* Traffic classes (TCs) */\n \tuint64_t tc_time; /* time of next update */\n-\tuint64_t tc_credits_per_period[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];\n \tuint64_t tc_credits[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];\n-\tuint64_t tc_period;\n \n \t/* TC oversubscription */\n \tuint64_t tc_ov_wm;\n@@ -838,18 +833,6 @@ rte_sched_subport_check_params(struct rte_sched_subport_params *params,\n \t\treturn -EINVAL;\n \t}\n \n-\tif (params->tb_rate == 0 || params->tb_rate > rate) {\n-\t\tRTE_LOG(ERR, SCHED,\n-\t\t\t\"%s: Incorrect value for tb rate\\n\", __func__);\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tif (params->tb_size == 0) {\n-\t\tRTE_LOG(ERR, SCHED,\n-\t\t\t\"%s: Incorrect value for tb size\\n\", __func__);\n-\t\treturn -EINVAL;\n-\t}\n-\n \t/* qsize: if non-zero, power of 2,\n \t * no bigger than 32K (due to 16-bit read/write pointers)\n \t */\n@@ -863,29 +846,8 @@ rte_sched_subport_check_params(struct rte_sched_subport_params *params,\n \t\t}\n \t}\n \n-\tfor (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) {\n-\t\tuint64_t tc_rate = params->tc_rate[i];\n-\t\tuint16_t qsize = params->qsize[i];\n-\n-\t\tif ((qsize == 0 && tc_rate != 0) ||\n-\t\t\t(qsize != 0 && tc_rate == 0) ||\n-\t\t\t(tc_rate > params->tb_rate)) {\n-\t\t\tRTE_LOG(ERR, SCHED,\n-\t\t\t\t\"%s: Incorrect value for tc rate\\n\", __func__);\n-\t\t\treturn -EINVAL;\n-\t\t}\n-\t}\n-\n-\tif (params->qsize[RTE_SCHED_TRAFFIC_CLASS_BE] == 0 ||\n-\t\tparams->tc_rate[RTE_SCHED_TRAFFIC_CLASS_BE] == 0) {\n-\t\tRTE_LOG(ERR, SCHED,\n-\t\t\t\"%s: Incorrect qsize or tc rate(best effort)\\n\", __func__);\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tif (params->tc_period == 0) {\n-\t\tRTE_LOG(ERR, SCHED,\n-\t\t\t\"%s: Incorrect value for tc period\\n\", __func__);\n+\tif (params->qsize[RTE_SCHED_TRAFFIC_CLASS_BE] == 0) {\n+\t\tRTE_LOG(ERR, SCHED, \"%s: Incorrect qsize\\n\", __func__);\n \t\treturn -EINVAL;\n \t}\n \n@@ -1102,48 +1064,6 @@ rte_sched_port_free(struct rte_sched_port *port)\n }\n \n static void\n-rte_sched_port_log_subport_config(struct rte_sched_port *port, uint32_t i)\n-{\n-\tstruct rte_sched_subport *s = port->subports[i];\n-\n-\tRTE_LOG(DEBUG, SCHED, \"Low level config for subport %u:\\n\"\n-\t\t\"\tToken bucket: period = %\"PRIu64\", credits per period = %\"PRIu64\n-\t\t\", size = %\"PRIu64\"\\n\"\n-\t\t\"\tTraffic classes: period = %\"PRIu64\"\\n\"\n-\t\t\"\tcredits per period = [%\"PRIu64\", %\"PRIu64\", %\"PRIu64\", %\"PRIu64\n-\t\t\", %\"PRIu64\", %\"PRIu64\", %\"PRIu64\", %\"PRIu64\", %\"PRIu64\", %\"PRIu64\n-\t\t\", %\"PRIu64\", %\"PRIu64\", %\"PRIu64\"]\\n\"\n-\t\t\"\tBest effort traffic class oversubscription: wm min = %\"PRIu64\n-\t\t\", wm max = %\"PRIu64\"\\n\",\n-\t\ti,\n-\n-\t\t/* Token bucket */\n-\t\ts->tb_period,\n-\t\ts->tb_credits_per_period,\n-\t\ts->tb_size,\n-\n-\t\t/* Traffic classes */\n-\t\ts->tc_period,\n-\t\ts->tc_credits_per_period[0],\n-\t\ts->tc_credits_per_period[1],\n-\t\ts->tc_credits_per_period[2],\n-\t\ts->tc_credits_per_period[3],\n-\t\ts->tc_credits_per_period[4],\n-\t\ts->tc_credits_per_period[5],\n-\t\ts->tc_credits_per_period[6],\n-\t\ts->tc_credits_per_period[7],\n-\t\ts->tc_credits_per_period[8],\n-\t\ts->tc_credits_per_period[9],\n-\t\ts->tc_credits_per_period[10],\n-\t\ts->tc_credits_per_period[11],\n-\t\ts->tc_credits_per_period[12],\n-\n-\t\t/* Best effort traffic class oversubscription */\n-\t\ts->tc_ov_wm_min,\n-\t\ts->tc_ov_wm_max);\n-}\n-\n-static void\n rte_sched_free_memory(struct rte_sched_port *port, uint32_t n_subports)\n {\n \tuint32_t i;\n@@ -1216,33 +1136,7 @@ rte_sched_subport_config(struct rte_sched_port *port,\n \t/* Port */\n \tport->subports[subport_id] = s;\n \n-\t/* Token Bucket (TB) */\n-\tif (params->tb_rate == port->rate) {\n-\t\ts->tb_credits_per_period = 1;\n-\t\ts->tb_period = 1;\n-\t} else {\n-\t\tdouble tb_rate = ((double) params->tb_rate) / ((double) port->rate);\n-\t\tdouble d = RTE_SCHED_TB_RATE_CONFIG_ERR;\n-\n-\t\trte_approx_64(tb_rate, d, &s->tb_credits_per_period, &s->tb_period);\n-\t}\n-\n-\ts->tb_size = params->tb_size;\n \ts->tb_time = port->time;\n-\ts->tb_credits = s->tb_size / 2;\n-\n-\t/* Traffic Classes (TCs) */\n-\ts->tc_period = rte_sched_time_ms_to_bytes(params->tc_period, port->rate);\n-\tfor (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++) {\n-\t\tif (params->qsize[i])\n-\t\t\ts->tc_credits_per_period[i]\n-\t\t\t\t= rte_sched_time_ms_to_bytes(params->tc_period,\n-\t\t\t\t\tparams->tc_rate[i]);\n-\t}\n-\ts->tc_time = port->time + s->tc_period;\n-\tfor (i = 0; i < RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE; i++)\n-\t\tif (params->qsize[i])\n-\t\t\ts->tc_credits[i] = s->tc_credits_per_period[i];\n \n \t/* compile time checks */\n \tRTE_BUILD_BUG_ON(RTE_SCHED_PORT_N_GRINDERS == 0);\n@@ -1332,17 +1226,12 @@ rte_sched_subport_config(struct rte_sched_port *port,\n #ifdef RTE_SCHED_SUBPORT_TC_OV\n \t/* TC oversubscription */\n \ts->tc_ov_wm_min = port->mtu;\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 \ts->tc_ov_wm = s->tc_ov_wm_max;\n \ts->tc_ov_period_id = 0;\n \ts->tc_ov = 0;\n \ts->tc_ov_n = 0;\n \ts->tc_ov_rate = 0;\n #endif\n-\n-\trte_sched_port_log_subport_config(port, subport_id);\n-\n \treturn 0;\n }\n \ndiff --git a/lib/librte_sched/rte_sched.h b/lib/librte_sched/rte_sched.h\nindex a7c2638..7623919 100644\n--- a/lib/librte_sched/rte_sched.h\n+++ b/lib/librte_sched/rte_sched.h\n@@ -149,18 +149,6 @@ struct rte_sched_pipe_params {\n * byte.\n */\n struct rte_sched_subport_params {\n-\t/** Token bucket rate (measured in bytes per second) */\n-\tuint64_t tb_rate;\n-\n-\t/** Token bucket size (measured in credits) */\n-\tuint64_t tb_size;\n-\n-\t/** Traffic class rates (measured in bytes per second) */\n-\tuint64_t tc_rate[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];\n-\n-\t/** Enforcement period for rates (measured in milliseconds) */\n-\tuint64_t tc_period;\n-\n \t/** Number of subport pipes.\n \t * The subport can enable/allocate fewer pipes than the maximum\n \t * number set through struct port_params::n_max_pipes_per_subport,\n", "prefixes": [ "v2", "10/10" ] }{ "id": 77219, "url": "