Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/126822/?format=api
http://patches.dpdk.org/api/patches/126822/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230511091408.236638-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": "<20230511091408.236638-5-juraj.linkes@pantheon.tech>", "list_archive_url": "https://inbox.dpdk.org/dev/20230511091408.236638-5-juraj.linkes@pantheon.tech", "date": "2023-05-11T09:14:08", "name": "[RFC,v3,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/20230511091408.236638-5-juraj.linkes@pantheon.tech/mbox/", "series": [ { "id": 27977, "url": "http://patches.dpdk.org/api/series/27977/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27977", "date": "2023-05-11T09:14:04", "name": "dts: add dts api docs", "version": 3, "mbox": "http://patches.dpdk.org/series/27977/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/126822/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/126822/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 4221342A1B;\n\tThu, 11 May 2023 11:14:45 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 81F7142F86;\n\tThu, 11 May 2023 11:14:21 +0200 (CEST)", "from mail-ed1-f41.google.com (mail-ed1-f41.google.com\n [209.85.208.41]) by mails.dpdk.org (Postfix) with ESMTP id 4A56A42DA4\n for <dev@dpdk.org>; Thu, 11 May 2023 11:14:18 +0200 (CEST)", "by mail-ed1-f41.google.com with SMTP id\n 4fb4d7f45d1cf-50bc2feb320so12952748a12.3\n for <dev@dpdk.org>; Thu, 11 May 2023 02:14:18 -0700 (PDT)", "from localhost.localdomain (ip-46.34.233.151.o2inet.sk.\n [46.34.233.151]) by smtp.gmail.com with ESMTPSA id\n qa8-20020a170907868800b0096a2eaa508asm1710090ejc.168.2023.05.11.02.14.16\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 11 May 2023 02:14:17 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=pantheon-tech.20221208.gappssmtp.com; s=20221208; t=1683796458;\n x=1686388458;\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=dCqx0V2GODQbVyqVFBeu80xrOzcTwVWaaKOCLlOc5RWrNFshnN5wTUFV50PwR4TJs2\n Bk3QGSN9gsxFFoaw080L5fFhPW1rHMskShUMSEXRAvdYaM3qrW16uJmdoxT4Mie60WLR\n 2aRpQmkUEYVpJ0kr4/FOcK2rpCgdPtw9E8kd3Koz3+erA2ToABUzibLNobeWfIdVMLOL\n oNmns4idsYcLuMGq7Nw8C7z4WXE72e7xdEcCU20oyTuPWDfo8/aJECBaOKbr54yFyonv\n Rzwvfu0uBmlD7nOpqM+i80shTkD4kmf8TsQrB1kOgdv71gP2eBip5xNpgJ06LrsUF5V6\n fs9w==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20221208; t=1683796458; x=1686388458;\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=JSMvdKZZbpkWDD5wknOYnbJWxW2URABdO40vBs/AXEaV7hpy9nZ1WtincgTbuzpQra\n IllrKx/szm6o8+jMIGZ+qBrDgyvc/NsSS8h3Yee1Qwz6tj5u4fGij0cn4Rdk4aPS67sD\n PVsdSXZenvYg+1Z7Syfg90nGZkFxvUjhhINz2BnI4aiEE8fK/FCqN5g7qtNFocaFZHnv\n +HnVC1GHddw7NULBUYmOznY9BUxYoI3dulZDr5ROqrlWCq3W6t8n2EWb1tzVYlCeYV+s\n Y68fjKICr8za+dCxsZ6A3bxgmt3yX2Ln780GzrY1yKaVh39ahGUCMJ6NvUn0qi0qkqAO\n INsw==", "X-Gm-Message-State": "AC+VfDy0Yl79yohm8Q5IjOR2MeHII8cAp+L1NAkPBVSW7vogZzv1xwcg\n qPXQjb5XtOTMvr/LoM6KsBHT5Q==", "X-Google-Smtp-Source": "\n ACHHUZ7gt6Kqe5MXm3vKHvoKiLFdWIYJjfmy1ehN4XUqv8iqUuVfDuBH/6IxyUtctRVMdUUF2Nz8mw==", "X-Received": "by 2002:a17:907:6ea1:b0:958:4c75:705e with SMTP id\n sh33-20020a1709076ea100b009584c75705emr23588412ejc.17.1683796457840;\n Thu, 11 May 2023 02:14:17 -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, probb@iol.unh.edu", "Cc": "dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>", "Subject": "[RFC PATCH v3 4/4] dts: format docstrigs to google format", "Date": "Thu, 11 May 2023 11:14:08 +0200", "Message-Id": "<20230511091408.236638-5-juraj.linkes@pantheon.tech>", "X-Mailer": "git-send-email 2.30.2", "In-Reply-To": "<20230511091408.236638-1-juraj.linkes@pantheon.tech>", "References": "<20230504123749.1417259-1-juraj.linkes@pantheon.tech>\n <20230511091408.236638-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", "v3", "4/4" ] }{ "id": 126822, "url": "