Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/125447/?format=api
http://patches.dpdk.org/api/patches/125447/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230323104040.484708-5-juraj.linkes@pantheon.tech/", "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": "<20230323104040.484708-5-juraj.linkes@pantheon.tech>", "list_archive_url": "https://inbox.dpdk.org/dev/20230323104040.484708-5-juraj.linkes@pantheon.tech", "date": "2023-03-23T10:40:40", "name": "[RFC,v1,4/4] dts: format docstrigs to google format", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "70b91891ff107df4d4448534590e8934bc8ee45a", "submitter": { "id": 1626, "url": "http://patches.dpdk.org/api/people/1626/?format=api", "name": "Juraj Linkeš", "email": "juraj.linkes@pantheon.tech" }, "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/20230323104040.484708-5-juraj.linkes@pantheon.tech/mbox/", "series": [ { "id": 27515, "url": "http://patches.dpdk.org/api/series/27515/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27515", "date": "2023-03-23T10:40:36", "name": "dts: add dts api docs", "version": 1, "mbox": "http://patches.dpdk.org/series/27515/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/125447/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/125447/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id EA19342813;\n\tThu, 23 Mar 2023 11:41:17 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2DC2742D20;\n\tThu, 23 Mar 2023 11:40:52 +0100 (CET)", "from mail-ed1-f49.google.com (mail-ed1-f49.google.com\n [209.85.208.49]) by mails.dpdk.org (Postfix) with ESMTP id 0A26F42B7E\n for <dev@dpdk.org>; Thu, 23 Mar 2023 11:40:49 +0100 (CET)", "by mail-ed1-f49.google.com with SMTP id ek18so84430623edb.6\n for <dev@dpdk.org>; Thu, 23 Mar 2023 03:40:49 -0700 (PDT)", "from localhost.localdomain (ip-46.34.245.107.o2inet.sk.\n [46.34.245.107]) by smtp.gmail.com with ESMTPSA id\n k10-20020a1709067aca00b009294524ac21sm8472773ejo.60.2023.03.23.03.40.47\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 23 Mar 2023 03:40:48 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=pantheon-tech.20210112.gappssmtp.com; s=20210112; t=1679568048;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=ItoRxVanKy6D7IaGIQZ4Ryqm65ysDjeB2kD3cnEkZQk=;\n b=DxcbdH8hiLocvxSltsLCeVdQPXVUdv/uXSDVKVTmhqEwO/ZwN9rHVGZ0mT2bIkvJqm\n 8NGSRwB5u35gREiC3dyeqiC/KCVIqT+NLkJxaGQm6DBUHXYh1YHuvgAsG6bzgaNlEqt/\n oJYAq757g7iX1YVoIzc+VrpXJH30/Hran94HslJTFX78Lgy/fOgSzu1EWq5cAFLaBsp3\n CX2A52bDvBG9FbuV92b/El3BvXMnzJuDLd6EZegTZg55EHTNk0a6k4vhGyLoNv9wCHnM\n TM/oUGwdZBhfBinwuXJRj0/Qe1o5ET5xz/mcoLJuqSX0Z5lOfRugI91su13LkbdGSqQy\n g1Ow==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112; t=1679568048;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=ItoRxVanKy6D7IaGIQZ4Ryqm65ysDjeB2kD3cnEkZQk=;\n b=Uzv/QsrosDvcO0Q7S7Mxl4EperEVZ3t37IYpIU7PX1iQUHFh6+3isSYVvBzl4uFaKC\n tLmX6Ql+qIgP3ejCnXi8wSNFxng8QVtPwcCdG1ok2B0iBHNSSFS4p7pPp19fI0vTHgd/\n ni3ux5hIXY36zKQt1alEsS1CPxG6gRG7nYfW7crPTP2fIirWbX+HE6gGvmR+6OM6Ob8Z\n N09r81AppFac75NStpIgvwF1sIYDqazkhbDa0ZaxN0v9gJJagzoXkauvMGLaLfqgIAeE\n 7b/rqD3fuZJl9QUZjQ48LuTqjGF7a0G2vDcwPdzoSOrnjVqYDIIcqvR7D55IAifdSb8w\n M2oA==", "X-Gm-Message-State": "AO0yUKVdDDxM6xStVKeMPKgItkDeOogWb8m++wolp/jgsepI+lmkjnNf\n Pyi0Si9bk4IrQgJ2jvUQTzHqbw==", "X-Google-Smtp-Source": "\n AK7set+cEC8HDJlgie2Egf5MNuZy/85lITW1mbXWnUtbi419KoqHCtxhCntulvMwui24vVvqtkHMAw==", "X-Received": "by 2002:a17:906:548:b0:932:20a5:5b with SMTP id\n k8-20020a170906054800b0093220a5005bmr5002897eja.23.1679568048719;\n Thu, 23 Mar 2023 03:40:48 -0700 (PDT)", "From": "=?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>", "To": "thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, lijuan.tu@intel.com,\n bruce.richardson@intel.com, wathsala.vithanage@arm.com,\n jspewock@iol.unh.edu", "Cc": "dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>", "Subject": "[RFC PATCH v1 4/4] dts: format docstrigs to google format", "Date": "Thu, 23 Mar 2023 11:40:40 +0100", "Message-Id": "<20230323104040.484708-5-juraj.linkes@pantheon.tech>", "X-Mailer": "git-send-email 2.30.2", "In-Reply-To": "<20230323104040.484708-1-juraj.linkes@pantheon.tech>", "References": "<20230323104040.484708-1-juraj.linkes@pantheon.tech>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "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" }, "content": "WIP: only one module is reformatted to serve as a demonstration.\n\nThe google format is documented here [0].\n\n[0]: https://google.github.io/styleguide/pyguide.html\n\nSigned-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>\n---\n dts/framework/testbed_model/node.py | 152 +++++++++++++++++++---------\n 1 file changed, 103 insertions(+), 49 deletions(-)", "diff": "diff --git a/dts/framework/testbed_model/node.py b/dts/framework/testbed_model/node.py\nindex 90467981c3..ad8ef442af 100644\n--- a/dts/framework/testbed_model/node.py\n+++ b/dts/framework/testbed_model/node.py\n@@ -3,8 +3,13 @@\n # Copyright(c) 2022-2023 PANTHEON.tech s.r.o.\n # Copyright(c) 2022-2023 University of New Hampshire\n \n-\"\"\"\n-A node is a generic host that DTS connects to and manages.\n+\"\"\"Common functionality for node management.\n+\n+There's a base class, Node, that's supposed to be extended by other classes\n+with functionality specific to that node type.\n+The only part that can be used standalone is the Node.skip_setup static method,\n+which is a decorator used to skip method execution\n+if skip_setup is passed by the user on the cmdline or in an env variable.\n \"\"\"\n \n from typing import Any, Callable\n@@ -26,10 +31,25 @@\n \n \n class Node(object):\n- \"\"\"\n- Basic class for node management. This class implements methods that\n- manage a node, such as information gathering (of CPU/PCI/NIC) and\n- environment setup.\n+ \"\"\"The base class for node management.\n+\n+ It shouldn't be instantiated, but rather extended.\n+ It implements common methods to manage any node:\n+\n+ * connection to the node\n+ * information gathering of CPU\n+ * hugepages setup\n+\n+ Arguments:\n+ node_config: The config from the input configuration file.\n+\n+ Attributes:\n+ main_session: The primary OS-agnostic remote session used\n+ to communicate with the node.\n+ config: The configuration used to create the node.\n+ name: The name of the node.\n+ lcores: The list of logical cores that DTS can use on the node.\n+ It's derived from logical cores present on the node and user configuration.\n \"\"\"\n \n main_session: OSSession\n@@ -56,65 +76,89 @@ def __init__(self, node_config: NodeConfiguration):\n self._logger.info(f\"Created node: {self.name}\")\n \n def set_up_execution(self, execution_config: ExecutionConfiguration) -> None:\n- \"\"\"\n- Perform the execution setup that will be done for each execution\n- this node is part of.\n+ \"\"\"Execution setup steps.\n+\n+ Configure hugepages and call self._set_up_execution where\n+ the rest of the configuration steps (if any) are implemented.\n+\n+ Args:\n+ execution_config: The execution configuration according to which\n+ the setup steps will be taken.\n \"\"\"\n self._setup_hugepages()\n self._set_up_execution(execution_config)\n \n def _set_up_execution(self, execution_config: ExecutionConfiguration) -> None:\n- \"\"\"\n- This method exists to be optionally overwritten by derived classes and\n- is not decorated so that the derived class doesn't have to use the decorator.\n+ \"\"\"Optional additional execution setup steps for derived classes.\n+\n+ Derived classes should overwrite this\n+ if they want to add additional execution setup steps.\n \"\"\"\n \n def tear_down_execution(self) -> None:\n- \"\"\"\n- Perform the execution teardown that will be done after each execution\n- this node is part of concludes.\n+ \"\"\"Execution teardown steps.\n+\n+ There are currently no common execution teardown steps\n+ common to all DTS node types.\n \"\"\"\n self._tear_down_execution()\n \n def _tear_down_execution(self) -> None:\n- \"\"\"\n- This method exists to be optionally overwritten by derived classes and\n- is not decorated so that the derived class doesn't have to use the decorator.\n+ \"\"\"Optional additional execution teardown steps for derived classes.\n+\n+ Derived classes should overwrite this\n+ if they want to add additional execution teardown steps.\n \"\"\"\n \n def set_up_build_target(\n self, build_target_config: BuildTargetConfiguration\n ) -> None:\n- \"\"\"\n- Perform the build target setup that will be done for each build target\n- tested on this node.\n+ \"\"\"Build target setup steps.\n+\n+ There are currently no common build target setup steps\n+ common to all DTS node types.\n+\n+ Args:\n+ build_target_config: The build target configuration according to which\n+ the setup steps will be taken.\n \"\"\"\n self._set_up_build_target(build_target_config)\n \n def _set_up_build_target(\n self, build_target_config: BuildTargetConfiguration\n ) -> None:\n- \"\"\"\n- This method exists to be optionally overwritten by derived classes and\n- is not decorated so that the derived class doesn't have to use the decorator.\n+ \"\"\"Optional additional build target setup steps for derived classes.\n+\n+ Derived classes should optionally overwrite this\n+ if they want to add additional build target setup steps.\n \"\"\"\n \n def tear_down_build_target(self) -> None:\n- \"\"\"\n- Perform the build target teardown that will be done after each build target\n- tested on this node.\n+ \"\"\"Build target teardown steps.\n+\n+ There are currently no common build target teardown steps\n+ common to all DTS node types.\n \"\"\"\n self._tear_down_build_target()\n \n def _tear_down_build_target(self) -> None:\n- \"\"\"\n- This method exists to be optionally overwritten by derived classes and\n- is not decorated so that the derived class doesn't have to use the decorator.\n+ \"\"\"Optional additional build target teardown steps for derived classes.\n+\n+ Derived classes should overwrite this\n+ if they want to add additional build target teardown steps.\n \"\"\"\n \n def create_session(self, name: str) -> OSSession:\n- \"\"\"\n- Create and return a new OSSession tailored to the remote OS.\n+ \"\"\"Create and return a new OS-agnostic remote session.\n+\n+ The returned session won't be used by the object creating it.\n+ Will be cleaned up automatically.\n+\n+ Args:\n+ name: The name of the session.\n+\n+ Returns:\n+ A new OS-agnostic remote session.\n \"\"\"\n session_name = f\"{self.name} {name}\"\n connection = create_session(\n@@ -130,14 +174,24 @@ def filter_lcores(\n filter_specifier: LogicalCoreCount | LogicalCoreList,\n ascending: bool = True,\n ) -> list[LogicalCore]:\n- \"\"\"\n- Filter the LogicalCores found on the Node according to\n- a LogicalCoreCount or a LogicalCoreList.\n+ \"\"\"Filter the node's logical cores that DTS can use.\n \n- If ascending is True, use cores with the lowest numerical id first\n- and continue in ascending order. If False, start with the highest\n- id and continue in descending order. This ordering affects which\n- sockets to consider first as well.\n+ Logical cores that DTS can use are ones that are present on the node,\n+ but filtered according to user config.\n+ The filter_specifier will filter cores from those logical cores.\n+\n+ Args:\n+ filter_specifier: Two different filters can be used, one that specifies\n+ the number of logical cores per core, cores per socket and\n+ the number of sockets,\n+ the other that specifies a logical core list.\n+ ascending: If True, use cores with the lowest numerical id first\n+ and continue in ascending order. If False, start with the highest\n+ id and continue in descending order. This ordering affects which\n+ sockets to consider first as well.\n+\n+ Returns:\n+ A list of logical cores.\n \"\"\"\n self._logger.debug(f\"Filtering {filter_specifier} from {self.lcores}.\")\n return lcore_filter(\n@@ -147,17 +201,14 @@ def filter_lcores(\n ).filter()\n \n def _get_remote_cpus(self) -> None:\n- \"\"\"\n- Scan CPUs in the remote OS and store a list of LogicalCores.\n- \"\"\"\n+ \"\"\"Scan CPUs in the remote OS and store a list of LogicalCores.\"\"\"\n self._logger.info(\"Getting CPU information.\")\n self.lcores = self.main_session.get_remote_cpus(self.config.use_first_core)\n \n def _setup_hugepages(self):\n- \"\"\"\n- Setup hugepages on the Node. Different architectures can supply different\n- amounts of memory for hugepages and numa-based hugepage allocation may need\n- to be considered.\n+ \"\"\"Setup hugepages on the Node.\n+\n+ Configure the hugepages only if they're specified in user configuration.\n \"\"\"\n if self.config.hugepages:\n self.main_session.setup_hugepages(\n@@ -165,9 +216,7 @@ def _setup_hugepages(self):\n )\n \n def close(self) -> None:\n- \"\"\"\n- Close all connections and free other resources.\n- \"\"\"\n+ \"\"\"Close all connections and free other resources.\"\"\"\n if self.main_session:\n self.main_session.close()\n for session in self._other_sessions:\n@@ -176,6 +225,11 @@ def close(self) -> None:\n \n @staticmethod\n def skip_setup(func: Callable[..., Any]) -> Callable[..., Any]:\n+ \"\"\"A decorator that skips the decorated function.\n+\n+ When used, the decorator executes an empty lambda function\n+ instead of the decorated function.\n+ \"\"\"\n if SETTINGS.skip_setup:\n return lambda *args: None\n else:\n", "prefixes": [ "RFC", "v1", "4/4" ] }{ "id": 125447, "url": "