Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/130969/?format=api
http://patchwork.dpdk.org/api/patches/130969/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230831100407.59865-5-juraj.linkes@pantheon.tech/", "project": { "id": 1, "url": "http://patchwork.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": "<20230831100407.59865-5-juraj.linkes@pantheon.tech>", "list_archive_url": "https://inbox.dpdk.org/dev/20230831100407.59865-5-juraj.linkes@pantheon.tech", "date": "2023-08-31T10:04:07", "name": "[RFC,v4,4/4] dts: format docstrigs to google format", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "4c8f8cb6a9db297518383527cfe96476d8a7c268", "submitter": { "id": 1626, "url": "http://patchwork.dpdk.org/api/people/1626/?format=api", "name": "Juraj Linkeš", "email": "juraj.linkes@pantheon.tech" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230831100407.59865-5-juraj.linkes@pantheon.tech/mbox/", "series": [ { "id": 29384, "url": "http://patchwork.dpdk.org/api/series/29384/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29384", "date": "2023-08-31T10:04:03", "name": "dts: add dts api docs", "version": 4, "mbox": "http://patchwork.dpdk.org/series/29384/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/130969/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/130969/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 8770D41FDB;\n\tThu, 31 Aug 2023 12:04:48 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D6AA0402B3;\n\tThu, 31 Aug 2023 12:04:18 +0200 (CEST)", "from mail-ed1-f49.google.com (mail-ed1-f49.google.com\n [209.85.208.49]) by mails.dpdk.org (Postfix) with ESMTP id 97B9E402AD\n for <dev@dpdk.org>; Thu, 31 Aug 2023 12:04:15 +0200 (CEST)", "by mail-ed1-f49.google.com with SMTP id\n 4fb4d7f45d1cf-52bcb8b199aso777114a12.3\n for <dev@dpdk.org>; Thu, 31 Aug 2023 03:04:15 -0700 (PDT)", "from jlinkes-PT-Latitude-5530.. (ip-46.34.238.3.o2inet.sk.\n [46.34.238.3]) by smtp.gmail.com with ESMTPSA id\n l18-20020a1709066b9200b0099bc08862b6sm587513ejr.171.2023.08.31.03.04.14\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 31 Aug 2023 03:04:15 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=pantheon.tech; s=google; t=1693476255; x=1694081055; darn=dpdk.org;\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=Om1CGkuj7K9t5bJb8S2YiTcUFEUz3htI2M5f30th+Xk=;\n b=jS/wkd/4BW2SfJr8Z+G4PO2Cz+CdX7d3dLy2DbZkErYD2+ppYZA6HIrtRZryfwC6ni\n hgsnswrOPm5Yo8OyPciVlgKIOLw11kib/mH5S/21pVt/hVtPr2zG5ZOXXpaxETfjvfK+\n Lkh3Cav1JiEggIegvB3CsEEbia+8+FaE0ckBXZTNIEmVoGjiY3R5wD8ZYrwFgPZk5TfF\n cBwK9A5KEM6x5tUt9zjnZj7KC4lz1pHPMimpnQe5sPkl41EuZARYXAzC70Y40sgYTsve\n q/KW71Wk9tSznGk7PyaWOt1riWkUPdi19hziNVDTSm73CgtSrl6Xp9ThYc6JxOVIkTeU\n 1IVQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20221208; t=1693476255; x=1694081055;\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=Om1CGkuj7K9t5bJb8S2YiTcUFEUz3htI2M5f30th+Xk=;\n b=lwfpZdPRwOtNTuUdO9MYxSoPZhc78ubTQYUjr9Fov64muyPPz1aFMMu0CmVCb32W80\n ZnEnQ2LuZYCAVQ9bmwYP3W3Q4wsApuEdRn0QY8fUbNogTwUAjNEL5pIT99x1/iqjYZVj\n 0+wHXHAg+BHJNab896VHgKgO19RdcU3od6/GTAepkmF1s9w7MnnGdcKHSYJs1J3iln97\n KDZHcSi4FrZfQfd52RCNYyM2S1iTG8LSQQCmmR2UPcFacx8H/2bwNFNR0z3JQcnKZT9d\n 91YlzCfZ4+lC3l9rrQNEXpYDrc+jHjTA7VQ0miWBfaFg7BCE2qzk6OCHd6vkuDOSnTaW\n PiIQ==", "X-Gm-Message-State": "AOJu0YxWk9iNDncusQcdOO4VTfChuA/mzrM4s/OOJ9/eXsTRAAST900K\n N4tAYdjON5sc3GDiXcOiawr9kw==", "X-Google-Smtp-Source": "\n AGHT+IFEOWifFFut4TQrrPktZNUAjksvKxHDyZhGbURUZpvh163tjt4xqfeKl1FHiB0Y9ESo/uzQyQ==", "X-Received": "by 2002:a17:907:7612:b0:99b:6e54:bd6e with SMTP id\n jx18-20020a170907761200b0099b6e54bd6emr3324417ejc.56.1693476255251;\n Thu, 31 Aug 2023 03:04:15 -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, 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 v4 4/4] dts: format docstrigs to google format", "Date": "Thu, 31 Aug 2023 12:04:07 +0200", "Message-Id": "<20230831100407.59865-5-juraj.linkes@pantheon.tech>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20230831100407.59865-1-juraj.linkes@pantheon.tech>", "References": "<20230511091408.236638-1-juraj.linkes@pantheon.tech>\n <20230831100407.59865-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 | 171 +++++++++++++++++++---------\n 1 file changed, 118 insertions(+), 53 deletions(-)", "diff": "diff --git a/dts/framework/testbed_model/node.py b/dts/framework/testbed_model/node.py\nindex 23efa79c50..619743ebe7 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 if skip_setup is passed\n+by the user on the cmdline or in an env variable.\n \"\"\"\n \n from abc import ABC\n@@ -35,10 +40,26 @@\n \n \n class Node(ABC):\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+ ports: The ports of this node specified in user configuration.\n \"\"\"\n \n main_session: OSSession\n@@ -77,9 +98,14 @@ def _init_ports(self) -> None:\n self.configure_port_state(port)\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@@ -88,58 +114,78 @@ def set_up_execution(self, execution_config: ExecutionConfiguration) -> None:\n self.virtual_devices.append(VirtualDevice(vdev))\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.virtual_devices = []\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 node creating it.\n+ The session must be used by the caller.\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@@ -186,14 +232,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@@ -203,17 +259,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@@ -221,8 +274,11 @@ def _setup_hugepages(self):\n )\n \n def configure_port_state(self, port: Port, enable: bool = True) -> None:\n- \"\"\"\n- Enable/disable port.\n+ \"\"\"Enable/disable port.\n+\n+ Args:\n+ port: The port to enable/disable.\n+ enable: True to enable, false to disable.\n \"\"\"\n self.main_session.configure_port_state(port, enable)\n \n@@ -232,15 +288,19 @@ def configure_port_ip_address(\n port: Port,\n delete: bool = False,\n ) -> None:\n- \"\"\"\n- Configure the IP address of a port on this node.\n+ \"\"\"Add an IP address to a port on this node.\n+\n+ Args:\n+ address: The IP address with mask in CIDR format.\n+ Can be either IPv4 or IPv6.\n+ port: The port to which to add the address.\n+ delete: If True, will delete the address from the port\n+ instead of adding it.\n \"\"\"\n self.main_session.configure_port_ip_address(address, port, delete)\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@@ -249,6 +309,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", "v4", "4/4" ] }{ "id": 130969, "url": "