get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/139100/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 139100,
    "url": "https://patches.dpdk.org/api/patches/139100/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20240404153106.19047-1-npratte@iol.unh.edu/",
    "project": {
        "id": 1,
        "url": "https://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": "<20240404153106.19047-1-npratte@iol.unh.edu>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240404153106.19047-1-npratte@iol.unh.edu",
    "date": "2024-04-04T15:31:06",
    "name": "dts: Change hugepage runtime config to 2MB Exclusively",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "00fc211633eef06af768598ad7044f45399e9e8d",
    "submitter": {
        "id": 3281,
        "url": "https://patches.dpdk.org/api/people/3281/?format=api",
        "name": "Nicholas Pratte",
        "email": "npratte@iol.unh.edu"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20240404153106.19047-1-npratte@iol.unh.edu/mbox/",
    "series": [
        {
            "id": 31678,
            "url": "https://patches.dpdk.org/api/series/31678/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=31678",
            "date": "2024-04-04T15:31:06",
            "name": "dts: Change hugepage runtime config to 2MB Exclusively",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/31678/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/139100/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/139100/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 13F0643DFA;\n\tThu,  4 Apr 2024 17:31:17 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 000CA40696;\n\tThu,  4 Apr 2024 17:31:16 +0200 (CEST)",
            "from mail-ot1-f41.google.com (mail-ot1-f41.google.com\n [209.85.210.41]) by mails.dpdk.org (Postfix) with ESMTP id 7881140685\n for <dev@dpdk.org>; Thu,  4 Apr 2024 17:31:15 +0200 (CEST)",
            "by mail-ot1-f41.google.com with SMTP id\n 46e09a7af769-6e2b466d213so167466a34.0\n for <dev@dpdk.org>; Thu, 04 Apr 2024 08:31:15 -0700 (PDT)",
            "from d121028.iol.unh.edu ([2606:4100:3880:1271:e2f8:4ec3:8bf3:864c])\n by smtp.gmail.com with ESMTPSA id\n mn2-20020a0562145ec200b006990bcf5b8asm152809qvb.56.2024.04.04.08.31.13\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 04 Apr 2024 08:31:14 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=iol.unh.edu; s=unh-iol; t=1712244674; x=1712849474; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=s8z6i2ENV0FdYzz4H106R2oQr8jC87cFA8ShoL9L6ug=;\n b=Cw+MJRIDX8Im6NyRZOzp9punocpn7EGyERoDlgX+h6I+NsBZMU7ImrqlUwV/rMXtDd\n k9JQd2okwbSmoePvW1HqZqk6//idVIyq6EQjySPCOPo6vu7AtpfqY8lVnCEErgAG4bXA\n qshwkiadehEVsqUICpZZ2ISbShKfW3Xql/06w=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1712244674; x=1712849474;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=s8z6i2ENV0FdYzz4H106R2oQr8jC87cFA8ShoL9L6ug=;\n b=nbCjdxdvmiKbMIfOZB/nnRt6l1MAOYsqVhmiDcLubTiw0t48OVjPe3PEHtVmLe+uWH\n HEpyF0rQPbuDMBY0jYC4f9IMZuuQ0f0XGbiAwApz6Erq8HCoruHknmoIGRnvtCYlhEVe\n FT+B3HQvNDiUdXkyOHCwbEatcZ9JyslMLu3hrC3GQnjXnFzYVSj+wPcge2we7E1V748O\n jHpQF9TBR4do2EhjumMTrLkdh72mmuUDRT1j/rk+Zx9y9T/g/LHO6h6C/PM3e3ZS0iVT\n uzs9n9qH8rItlD6reZSxIqUXYxwR9DxTaEe+k16XNAl8oEuPGs6PE1YMdjSQE8BgyK3B\n vPZQ==",
        "X-Gm-Message-State": "AOJu0Yxuz/qtQufz66pqAVLszzzbA7PbFJF++2wHynKpaIZtW8iEqyjZ\n 83cpqqBWqy8hOfYk2aRyBBA/2ZqC/FZc8TE26/JH6XPCrxd186YlT0VSO50+B3k=",
        "X-Google-Smtp-Source": "\n AGHT+IFOuCatyYT0MJksvqhyrNI1KAIIx7LpY0lcrMbwA1Ecs1W2Rs5YlEz4oCCbMjziauuBPJBTow==",
        "X-Received": "by 2002:a05:6830:1150:b0:6e9:e6b4:1e43 with SMTP id\n x16-20020a056830115000b006e9e6b41e43mr2879334otq.3.1712244674677;\n Thu, 04 Apr 2024 08:31:14 -0700 (PDT)",
        "From": "Nicholas Pratte <npratte@iol.unh.edu>",
        "To": "paul.szczepanek@arm.com, juraj.linkes@pantheon.tech,\n yoan.picchi@foss.arm.com, probb@iol.unh.edu, thomas@monjalon.net,\n npratte@iol.unh.edu, wathsala.vithanage@arm.com,\n Honnappa.Nagarahalli@arm.com",
        "Cc": "dev@dpdk.org,\n\tJeremy Spewock <jspewock@iol.unh.edu>",
        "Subject": "[PATCH] dts: Change hugepage runtime config to 2MB Exclusively",
        "Date": "Thu,  4 Apr 2024 11:31:06 -0400",
        "Message-ID": "<20240404153106.19047-1-npratte@iol.unh.edu>",
        "X-Mailer": "git-send-email 2.44.0",
        "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": "The previous implementation configures and allocates hugepage sizes\nbased on a system default. This can lead to two problems: overallocation of\nhugepages (which may crash the remote host), and configuration of hugepage\nsizes that are not recommended during runtime. This new implementation\nallows only 2MB hugepage allocation during runtime; any other unique\nhugepage size must be configured by the end-user for initializing DTS.\n\nIf the amount of 2MB hugepages requested exceeds the amount of 2MB\nhugepages already configured on the system, then the system will remount\nhugepages to cover the difference. If the amount of hugepages requested is\neither less than or equal to the amount already configured on the system,\nthen nothing is done.\n\nBugzilla ID: 1370\nSigned-off-by: Nicholas Pratte <npratte@iol.unh.edu>\nReviewed-by: Jeremy Spewock <jspewock@iol.unh.edu>\n---\n dts/conf.yaml                                |  8 ++++----\n dts/framework/config/__init__.py             |  4 ++--\n dts/framework/config/conf_yaml_schema.json   |  6 +++---\n dts/framework/config/types.py                |  2 +-\n dts/framework/testbed_model/linux_session.py | 21 +++++++++-----------\n 5 files changed, 19 insertions(+), 22 deletions(-)",
    "diff": "diff --git a/dts/conf.yaml b/dts/conf.yaml\nindex 8068345dd5..3690e77ee5 100644\n--- a/dts/conf.yaml\n+++ b/dts/conf.yaml\n@@ -35,8 +35,8 @@ nodes:\n     lcores: \"\" # use all the available logical cores\n     use_first_core: false # tells DPDK to use any physical core\n     memory_channels: 4 # tells DPDK to use 4 memory channels\n-    hugepages:  # optional; if removed, will use system hugepage configuration\n-        amount: 256\n+    hugepages_2mb: # optional; if removed, will use system hugepage configuration\n+        amount: 2560\n         force_first_numa: false\n     ports:\n       # sets up the physical link between \"SUT 1\"@000:00:08.0 and \"TG 1\"@0000:00:08.0\n@@ -71,8 +71,8 @@ nodes:\n         os_driver: rdma\n         peer_node: \"SUT 1\"\n         peer_pci: \"0000:00:08.1\"\n-    hugepages:  # optional; if removed, will use system hugepage configuration\n-        amount: 256\n+    hugepages_2mb: # optional; if removed, will use system hugepage configuration\n+        amount: 2560\n         force_first_numa: false\n     traffic_generator:\n         type: SCAPY\ndiff --git a/dts/framework/config/__init__.py b/dts/framework/config/__init__.py\nindex 4cb5c74059..b6f820e39e 100644\n--- a/dts/framework/config/__init__.py\n+++ b/dts/framework/config/__init__.py\n@@ -255,8 +255,8 @@ def from_dict(\n             Either an SUT or TG configuration instance.\n         \"\"\"\n         hugepage_config = None\n-        if \"hugepages\" in d:\n-            hugepage_config_dict = d[\"hugepages\"]\n+        if \"hugepages_2mb\" in d:\n+            hugepage_config_dict = d[\"hugepages_2mb\"]\n             if \"force_first_numa\" not in hugepage_config_dict:\n                 hugepage_config_dict[\"force_first_numa\"] = False\n             hugepage_config = HugepageConfiguration(**hugepage_config_dict)\ndiff --git a/dts/framework/config/conf_yaml_schema.json b/dts/framework/config/conf_yaml_schema.json\nindex 4731f4511d..f4d7199523 100644\n--- a/dts/framework/config/conf_yaml_schema.json\n+++ b/dts/framework/config/conf_yaml_schema.json\n@@ -146,7 +146,7 @@\n         \"compiler\"\n       ]\n     },\n-    \"hugepages\": {\n+    \"hugepages_2mb\": {\n       \"type\": \"object\",\n       \"description\": \"Optional hugepage configuration. If not specified, hugepages won't be configured and DTS will use system configuration.\",\n       \"properties\": {\n@@ -253,8 +253,8 @@\n             \"type\": \"integer\",\n             \"description\": \"How many memory channels to use. Optional, defaults to 1.\"\n           },\n-          \"hugepages\": {\n-            \"$ref\": \"#/definitions/hugepages\"\n+          \"hugepages_2mb\": {\n+            \"$ref\": \"#/definitions/hugepages_2mb\"\n           },\n           \"ports\": {\n             \"type\": \"array\",\ndiff --git a/dts/framework/config/types.py b/dts/framework/config/types.py\nindex 1927910d88..016e0c3dbd 100644\n--- a/dts/framework/config/types.py\n+++ b/dts/framework/config/types.py\n@@ -46,7 +46,7 @@ class NodeConfigDict(TypedDict):\n     \"\"\"Allowed keys and values.\"\"\"\n \n     #:\n-    hugepages: HugepageConfigurationDict\n+    hugepages_2mb: HugepageConfigurationDict\n     #:\n     name: str\n     #:\ndiff --git a/dts/framework/testbed_model/linux_session.py b/dts/framework/testbed_model/linux_session.py\nindex 5d24030c3d..ad3c811301 100644\n--- a/dts/framework/testbed_model/linux_session.py\n+++ b/dts/framework/testbed_model/linux_session.py\n@@ -15,7 +15,7 @@\n \n from typing_extensions import NotRequired\n \n-from framework.exception import RemoteCommandExecutionError\n+from framework.exception import ConfigurationError, RemoteCommandExecutionError\n from framework.utils import expand_range\n \n from .cpu import LogicalCore\n@@ -87,25 +87,22 @@ def get_dpdk_file_prefix(self, dpdk_prefix: str) -> str:\n     def setup_hugepages(self, hugepage_count: int, force_first_numa: bool) -> None:\n         \"\"\"Overrides :meth:`~.os_session.OSSession.setup_hugepages`.\"\"\"\n         self._logger.info(\"Getting Hugepage information.\")\n-        hugepage_size = self._get_hugepage_size()\n+        if \"hugepages-2048kB\" not in self.send_command(\"ls /sys/kernel/mm/hugepages\").stdout:\n+            raise ConfigurationError(\"2MB hugepages not supported by operating system\")\n         hugepages_total = self._get_hugepages_total()\n         self._numa_nodes = self._get_numa_nodes()\n \n-        if force_first_numa or hugepages_total != hugepage_count:\n+        if force_first_numa or hugepages_total < hugepage_count:\n             # when forcing numa, we need to clear existing hugepages regardless\n             # of size, so they can be moved to the first numa node\n-            self._configure_huge_pages(hugepage_count, hugepage_size, force_first_numa)\n+            self._configure_huge_pages(hugepage_count, force_first_numa)\n         else:\n             self._logger.info(\"Hugepages already configured.\")\n         self._mount_huge_pages()\n \n-    def _get_hugepage_size(self) -> int:\n-        hugepage_size = self.send_command(\"awk '/Hugepagesize/ {print $2}' /proc/meminfo\").stdout\n-        return int(hugepage_size)\n-\n     def _get_hugepages_total(self) -> int:\n         hugepages_total = self.send_command(\n-            \"awk '/HugePages_Total/ { print $2 }' /proc/meminfo\"\n+            \"cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages\"\n         ).stdout\n         return int(hugepages_total)\n \n@@ -136,15 +133,15 @@ def _supports_numa(self) -> bool:\n         # there's no reason to do any numa specific configuration)\n         return len(self._numa_nodes) > 1\n \n-    def _configure_huge_pages(self, amount: int, size: int, force_first_numa: bool) -> None:\n+    def _configure_huge_pages(self, amount: int, force_first_numa: bool) -> None:\n         self._logger.info(\"Configuring Hugepages.\")\n-        hugepage_config_path = f\"/sys/kernel/mm/hugepages/hugepages-{size}kB/nr_hugepages\"\n+        hugepage_config_path = \"/sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages\"\n         if force_first_numa and self._supports_numa():\n             # clear non-numa hugepages\n             self.send_command(f\"echo 0 | tee {hugepage_config_path}\", privileged=True)\n             hugepage_config_path = (\n                 f\"/sys/devices/system/node/node{self._numa_nodes[0]}/hugepages\"\n-                f\"/hugepages-{size}kB/nr_hugepages\"\n+                f\"/hugepages-2048kB/nr_hugepages\"\n             )\n \n         self.send_command(f\"echo {amount} | tee {hugepage_config_path}\", privileged=True)\n",
    "prefixes": []
}