Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/133441/?format=api
http://patches.dpdk.org/api/patches/133441/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231026220059.10685-3-jspewock@iol.unh.edu/", "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": "<20231026220059.10685-3-jspewock@iol.unh.edu>", "list_archive_url": "https://inbox.dpdk.org/dev/20231026220059.10685-3-jspewock@iol.unh.edu", "date": "2023-10-26T21:58:58", "name": "[v1,1/1] dts: bind to DPDK driver before running test suites", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "8441ce2189caac2709328c1905affe6590b3a461", "submitter": { "id": 2772, "url": "http://patches.dpdk.org/api/people/2772/?format=api", "name": "Jeremy Spewock", "email": "jspewock@iol.unh.edu" }, "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/20231026220059.10685-3-jspewock@iol.unh.edu/mbox/", "series": [ { "id": 30013, "url": "http://patches.dpdk.org/api/series/30013/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30013", "date": "2023-10-26T21:58:57", "name": "dts: Add the ability to bind ports to drivers", "version": 1, "mbox": "http://patches.dpdk.org/series/30013/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/133441/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/133441/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 4F8DB4320D;\n\tFri, 27 Oct 2023 00:03:33 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id F326A40A8A;\n\tFri, 27 Oct 2023 00:03:32 +0200 (CEST)", "from mail-yb1-f226.google.com (mail-yb1-f226.google.com\n [209.85.219.226])\n by mails.dpdk.org (Postfix) with ESMTP id 8741140A76\n for <dev@dpdk.org>; Fri, 27 Oct 2023 00:03:31 +0200 (CEST)", "by mail-yb1-f226.google.com with SMTP id\n 3f1490d57ef6-d9beb865a40so1055296276.1\n for <dev@dpdk.org>; Thu, 26 Oct 2023 15:03:31 -0700 (PDT)", "from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84])\n by smtp-relay.gmail.com with ESMTPS id\n r141-20020a257693000000b00da14ad2f5a2sm20681ybc.31.2023.10.26.15.03.30\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Thu, 26 Oct 2023 15:03:30 -0700 (PDT)", "from iol.unh.edu (unknown\n [IPv6:2606:4100:3880:1271:90f9:1b64:f6e6:867f])\n by postal.iol.unh.edu (Postfix) with ESMTP id 749C3602A042;\n Thu, 26 Oct 2023 18:03:30 -0400 (EDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=iol.unh.edu; s=unh-iol; t=1698357811; x=1698962611; 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=ESYGbricLvHiIxgZDr+CtzbqZFV22+xMaPFF+6YOJso=;\n b=iK5l0oqoTawplZQqx0lhFZA6Ua55y7HWzHhq6pCFojFTWYhZ+cv1HtL5CwnwkKzxRh\n hwYcbPxA65fZxAaJP+zsYJuzYuevQouIPr/z3JIuuav0vvfsMhRvrXtdIMUyd8ncNnMe\n K0IYH31Db+goLnI94LrdymrWwx+PW+SNrAiCs=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1698357811; x=1698962611;\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=ESYGbricLvHiIxgZDr+CtzbqZFV22+xMaPFF+6YOJso=;\n b=PPzZwt0o5VWu8q6IMFVCsaFOAnmwnRGBbincnyJspm0hmsLx7H94DNOwtVXl1Gu/0U\n UC1uazSnEXQjxtuf/b0qwWO5RtisIlu+Lx2YrPZxnpiFSfrfYAlRsLwt5Lgz81l4a0VG\n gSxsdyRf14MYZG6IRJozmPd/jFHG7L/r7l0g34aIyO8oFYjljdFvtqnmw0tKAoqlWgbs\n jcQ/74NOiQzLv5F1JwiOaO10tg2wQh5Z3aPJMgGLqw2zUNNpuZmsOi68zwGry32hIEae\n LwJSry5PCtZvBbHBSjKiZ1os7PwwdBG7T7AFqtwibcE3SMHNMcrUh1F8YkiGhVc7Uyb/\n BYoA==", "X-Gm-Message-State": "AOJu0YwZASszqAncrVUeAX7Qr2hXwoNMsgNEe4QjYgADpa3mJUXaL/jq\n 4cSQ1mc+1G0MJnRZECgbSQxCjbv8qQ2itZY2ZttRops8OJ3ybQ==", "X-Google-Smtp-Source": "\n AGHT+IHXOuUsdtEC2f43KTw4OKFlUgxBCJrqcG5iQvOvs38seHkKJXD2Os5ZT5honnrL7X9ckmICD9nJOFYN", "X-Received": "by 2002:a25:2d4:0:b0:da0:4d0:3e2a with SMTP id\n 203-20020a2502d4000000b00da004d03e2amr766237ybc.0.1698357810909;\n Thu, 26 Oct 2023 15:03:30 -0700 (PDT)", "X-Relaying-Domain": "iol.unh.edu", "From": "jspewock@iol.unh.edu", "To": "Honnappa.Nagarahalli@arm.com, juraj.linkes@pantheon.tech,\n thomas@monjalon.net, wathsala.vithanage@arm.com, probb@iol.unh.edu,\n paul.szczepanek@arm.com", "Cc": "dev@dpdk.org,\n\tJeremy Spewock <jspewock@iol.unh.edu>", "Subject": "[PATCH v1 1/1] dts: bind to DPDK driver before running test suites", "Date": "Thu, 26 Oct 2023 17:58:58 -0400", "Message-ID": "<20231026220059.10685-3-jspewock@iol.unh.edu>", "X-Mailer": "git-send-email 2.42.0", "In-Reply-To": "<20231026220059.10685-2-jspewock@iol.unh.edu>", "References": "<20231026220059.10685-2-jspewock@iol.unh.edu>", "MIME-Version": "1.0", "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": "From: Jeremy Spewock <jspewock@iol.unh.edu>\n\nModifies the current process so that we bind to os_driver_for_dpdk from\nthe configuration file before running test suites and bind back to the\nos_driver afterwards. This allows test suites to assume that the ports\nare bound to a DPDK supported driver or bind to either driver as needed.\n\nSigned-off-by: Jeremy Spewock <jspewock@iol.unh.edu>\n---\n dts/framework/remote_session/linux_session.py | 3 ++\n dts/framework/remote_session/os_session.py | 6 ++++\n dts/framework/testbed_model/sut_node.py | 34 +++++++++++++++++++\n dts/tests/TestSuite_os_udp.py | 4 +++\n dts/tests/TestSuite_smoke_tests.py | 6 ++--\n 5 files changed, 49 insertions(+), 4 deletions(-)", "diff": "diff --git a/dts/framework/remote_session/linux_session.py b/dts/framework/remote_session/linux_session.py\nindex a3f1a6bf3b..7f2453c44c 100644\n--- a/dts/framework/remote_session/linux_session.py\n+++ b/dts/framework/remote_session/linux_session.py\n@@ -199,3 +199,6 @@ def configure_port_ip_address(\n def configure_ipv4_forwarding(self, enable: bool) -> None:\n state = 1 if enable else 0\n self.send_command(f\"sysctl -w net.ipv4.ip_forward={state}\", privileged=True)\n+\n+ def probe_driver(self, driver_name: str) -> None:\n+ self.send_command(f\"modprobe {driver_name}\", verify=True)\ndiff --git a/dts/framework/remote_session/os_session.py b/dts/framework/remote_session/os_session.py\nindex 8a709eac1c..719e815ac8 100644\n--- a/dts/framework/remote_session/os_session.py\n+++ b/dts/framework/remote_session/os_session.py\n@@ -282,3 +282,9 @@ def configure_ipv4_forwarding(self, enable: bool) -> None:\n \"\"\"\n Enable IPv4 forwarding in the underlying OS.\n \"\"\"\n+\n+ @abstractmethod\n+ def probe_driver(self, driver_name: str) -> None:\n+ \"\"\"\n+ Load the module for the driver.\n+ \"\"\"\ndiff --git a/dts/framework/testbed_model/sut_node.py b/dts/framework/testbed_model/sut_node.py\nindex 202aebfd06..5a7dd91cac 100644\n--- a/dts/framework/testbed_model/sut_node.py\n+++ b/dts/framework/testbed_model/sut_node.py\n@@ -89,6 +89,7 @@ class SutNode(Node):\n _dpdk_version: str | None\n _node_info: NodeInfo | None\n _compiler_version: str | None\n+ _path_to_devbind: PurePath | None\n \n def __init__(self, node_config: SutNodeConfiguration):\n super(SutNode, self).__init__(node_config)\n@@ -105,6 +106,7 @@ def __init__(self, node_config: SutNodeConfiguration):\n self._dpdk_version = None\n self._node_info = None\n self._compiler_version = None\n+ self._path_to_devbind = None\n self._logger.info(f\"Created node: {self.name}\")\n \n @property\n@@ -155,6 +157,14 @@ def compiler_version(self) -> str:\n return \"\"\n return self._compiler_version\n \n+ @property\n+ def path_to_devbind(self) -> PurePath:\n+ if self._path_to_devbind is None:\n+ self._path_to_devbind = self.main_session.join_remote_path(\n+ self._remote_dpdk_dir, \"usertools\", \"dpdk-devbind.py\"\n+ )\n+ return self._path_to_devbind\n+\n def get_build_target_info(self) -> BuildTargetInfo:\n return BuildTargetInfo(\n dpdk_version=self.dpdk_version, compiler_version=self.compiler_version\n@@ -176,6 +186,14 @@ def _set_up_build_target(\n self._configure_build_target(build_target_config)\n self._copy_dpdk_tarball()\n self._build_dpdk()\n+ self.bind_ports_to_driver()\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+ \"\"\"\n+ self.bind_ports_to_driver(for_dpdk=False)\n \n def _configure_build_target(\n self, build_target_config: BuildTargetConfiguration\n@@ -389,3 +407,19 @@ def create_interactive_shell(\n return super().create_interactive_shell(\n shell_cls, timeout, privileged, str(eal_parameters)\n )\n+\n+ def bind_ports_to_driver(self, for_dpdk: bool = True) -> None:\n+ \"\"\"Bind all ports on the SUT to a driver.\n+\n+ Args:\n+ for_dpdk: Boolean that, when True, binds ports to os_driver_for_dpdk\n+ or, when False, binds to os_driver. Defaults to True.\n+ \"\"\"\n+ for port in self.ports:\n+ driver = port.os_driver_for_dpdk if for_dpdk else port.os_driver\n+ self.main_session.probe_driver(driver)\n+ self.main_session.send_command(\n+ f\"{self.path_to_devbind} -b {driver} --force {port.pci}\",\n+ privileged=True,\n+ verify=True,\n+ )\ndiff --git a/dts/tests/TestSuite_os_udp.py b/dts/tests/TestSuite_os_udp.py\nindex 9b5f39711d..bf6b93deb5 100644\n--- a/dts/tests/TestSuite_os_udp.py\n+++ b/dts/tests/TestSuite_os_udp.py\n@@ -19,6 +19,8 @@ def set_up_suite(self) -> None:\n Configure SUT ports and SUT to route traffic from if1 to if2.\n \"\"\"\n \n+ # This test uses kernel drivers\n+ self.sut_node.bind_ports_to_driver(for_dpdk=False)\n self.configure_testbed_ipv4()\n \n def test_os_udp(self) -> None:\n@@ -43,3 +45,5 @@ def tear_down_suite(self) -> None:\n Remove the SUT port configuration configured in setup.\n \"\"\"\n self.configure_testbed_ipv4(restore=True)\n+ # Assume other suites will likely need dpdk driver\n+ self.sut_node.bind_ports_to_driver(for_dpdk=True)\ndiff --git a/dts/tests/TestSuite_smoke_tests.py b/dts/tests/TestSuite_smoke_tests.py\nindex 4a269df75b..0b839cba4e 100644\n--- a/dts/tests/TestSuite_smoke_tests.py\n+++ b/dts/tests/TestSuite_smoke_tests.py\n@@ -84,9 +84,7 @@ def test_device_bound_to_driver(self) -> None:\n Ensure that all drivers listed in the config are bound to the correct\n driver.\n \"\"\"\n- path_to_devbind = self.sut_node.main_session.join_remote_path(\n- self.sut_node._remote_dpdk_dir, \"usertools\", \"dpdk-devbind.py\"\n- )\n+ path_to_devbind = self.sut_node.path_to_devbind\n \n all_nics_in_dpdk_devbind = self.sut_node.main_session.send_command(\n f\"{path_to_devbind} --status | awk '{REGEX_FOR_PCI_ADDRESS}'\",\n@@ -108,7 +106,7 @@ def test_device_bound_to_driver(self) -> None:\n # We know this isn't None, but mypy doesn't\n assert devbind_info_for_nic is not None\n self.verify(\n- devbind_info_for_nic.group(1) == nic.os_driver,\n+ devbind_info_for_nic.group(1) == nic.os_driver_for_dpdk,\n f\"Driver for device {nic.pci} does not match driver listed in \"\n f\"configuration (bound to {devbind_info_for_nic.group(1)})\",\n )\n", "prefixes": [ "v1", "1/1" ] }{ "id": 133441, "url": "