get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 74370,
    "url": "https://patches.dpdk.org/api/patches/74370/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1594993865-396296-3-git-send-email-suanmingm@mellanox.com/",
    "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": "<1594993865-396296-3-git-send-email-suanmingm@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1594993865-396296-3-git-send-email-suanmingm@mellanox.com",
    "date": "2020-07-17T13:51:00",
    "name": "[v3,2/7] net/mlx5: add allocate memory from system devarg",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "2ad41322a5428fa4bec1e74bd09c3f6931543ed2",
    "submitter": {
        "id": 1358,
        "url": "https://patches.dpdk.org/api/people/1358/?format=api",
        "name": "Suanming Mou",
        "email": "suanmingm@mellanox.com"
    },
    "delegate": {
        "id": 3268,
        "url": "https://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1594993865-396296-3-git-send-email-suanmingm@mellanox.com/mbox/",
    "series": [
        {
            "id": 11134,
            "url": "https://patches.dpdk.org/api/series/11134/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11134",
            "date": "2020-07-17T13:50:58",
            "name": "net/mlx5: add sys_mem_en devarg",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/11134/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74370/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/74370/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 76E69A053B;\n\tFri, 17 Jul 2020 15:52:09 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3780E1C1C0;\n\tFri, 17 Jul 2020 15:51:16 +0200 (CEST)",
            "from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130])\n by dpdk.org (Postfix) with ESMTP id C953D1C191\n for <dev@dpdk.org>; Fri, 17 Jul 2020 15:51:12 +0200 (CEST)"
        ],
        "From": "Suanming Mou <suanmingm@mellanox.com>",
        "To": "viacheslavo@mellanox.com,\n\tmatan@mellanox.com",
        "Cc": "orika@mellanox.com,\n\trasland@mellanox.com,\n\tdev@dpdk.org",
        "Date": "Fri, 17 Jul 2020 21:51:00 +0800",
        "Message-Id": "<1594993865-396296-3-git-send-email-suanmingm@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1594993865-396296-1-git-send-email-suanmingm@mellanox.com>",
        "References": "<1594785603-152773-1-git-send-email-suanmingm@mellanox.com>\n <1594993865-396296-1-git-send-email-suanmingm@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH v3 2/7] net/mlx5: add allocate memory from system\n\tdevarg",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Currently, for MLX5 PMD, once millions of flows created, the memory\nconsumption of the flows are also very huge. For the system with limited\nmemory, it means the system need to reserve most of the memory as huge\npage memory to serve the flows in advance. And other normal applications\nwill have no chance to use this reserved memory any more. While most of\nthe time, the system will not have lots of flows, the  reserved huge page\nmemory becomes a bit waste of memory at most of the time.\n\nBy the new sys_mem_en devarg, once set it to be true, it allows the PMD\nallocate the memory from system by default with the new add mlx5 memory\nmanagement functions. Only once the MLX5_MEM_RTE flag is set, the memory\nwill be allocate from rte, otherwise, it allocates memory from system.\n\nSo in this case, the system with limited memory no need to reserve most\nof the memory for hugepage. Only some needed memory for datapath objects\nwill be enough to allocated with explicitly flag. Other memory will be\nallocated from system. For system with enough memory, no need to care\nabout the devarg, the memory will always be from rte hugepage.\n\nOne restriction is that for DPDK application with multiple PCI devices,\nif the sys_mem_en devargs are different between the devices, the\nsys_mem_en only gets the value from the first device devargs, and print\nout a message to warn that.\n\nSigned-off-by: Suanming Mou <suanmingm@mellanox.com>\nAcked-by: Matan Azrad <matan@mellanox.com>\n---\n doc/guides/nics/mlx5.rst         | 7 +++++++\n drivers/net/mlx5/linux/mlx5_os.c | 2 ++\n drivers/net/mlx5/mlx5.c          | 6 ++++++\n drivers/net/mlx5/mlx5.h          | 1 +\n 4 files changed, 16 insertions(+)",
    "diff": "diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst\nindex c185129..a697d30 100644\n--- a/doc/guides/nics/mlx5.rst\n+++ b/doc/guides/nics/mlx5.rst\n@@ -916,6 +916,13 @@ Driver options\n \n   By default, the PMD will set this value to 0.\n \n+- ``sys_mem_en`` parameter [int]\n+\n+  A nonzero value enables the PMD memory management function allocate memory\n+  from system by default without explicitly rte memory flag.\n+\n+  By default, the PMD will set this value to 0.\n+\n .. _mlx5_firmware_config:\n \n Firmware configuration\ndiff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c\nindex f228bab..df0fae9 100644\n--- a/drivers/net/mlx5/linux/mlx5_os.c\n+++ b/drivers/net/mlx5/linux/mlx5_os.c\n@@ -43,6 +43,7 @@\n #include <mlx5_common.h>\n #include <mlx5_common_mp.h>\n #include <mlx5_common_mr.h>\n+#include <mlx5_malloc.h>\n \n #include \"mlx5_defs.h\"\n #include \"mlx5.h\"\n@@ -495,6 +496,7 @@\n \t\t\tstrerror(rte_errno));\n \t\tgoto error;\n \t}\n+\tmlx5_malloc_mem_select(config.sys_mem_en);\n \tsh = mlx5_alloc_shared_dev_ctx(spawn, &config);\n \tif (!sh)\n \t\treturn NULL;\ndiff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 723c1dd..f39acd7 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -180,6 +180,9 @@\n /* Flow memory reclaim mode. */\n #define MLX5_RECLAIM_MEM \"reclaim_mem_mode\"\n \n+/* The default memory alloctor used in PMD. */\n+#define MLX5_SYS_MEM_EN \"sys_mem_en\"\n+\n static const char *MZ_MLX5_PMD_SHARED_DATA = \"mlx5_pmd_shared_data\";\n \n /* Shared memory between primary and secondary processes. */\n@@ -1533,6 +1536,8 @@ struct mlx5_dev_ctx_shared *\n \t\t\treturn -rte_errno;\n \t\t}\n \t\tconfig->reclaim_mode = tmp;\n+\t} else if (strcmp(MLX5_SYS_MEM_EN, key) == 0) {\n+\t\tconfig->sys_mem_en = !!tmp;\n \t} else {\n \t\tDRV_LOG(WARNING, \"%s: unknown parameter\", key);\n \t\trte_errno = EINVAL;\n@@ -1591,6 +1596,7 @@ struct mlx5_dev_ctx_shared *\n \t\tMLX5_CLASS_ARG_NAME,\n \t\tMLX5_HP_BUF_SIZE,\n \t\tMLX5_RECLAIM_MEM,\n+\t\tMLX5_SYS_MEM_EN,\n \t\tNULL,\n \t};\n \tstruct rte_kvargs *kvlist;\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 2e61d0c..4d90a19 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -217,6 +217,7 @@ struct mlx5_dev_config {\n \tunsigned int dest_tir:1; /* Whether advanced DR API is available. */\n \tunsigned int reclaim_mode:2; /* Memory reclaim mode. */\n \tunsigned int rt_timestamp:1; /* realtime timestamp format. */\n+\tunsigned int sys_mem_en:1; /* The default memory allocator. */\n \tstruct {\n \t\tunsigned int enabled:1; /* Whether MPRQ is enabled. */\n \t\tunsigned int stride_num_n; /* Number of strides. */\n",
    "prefixes": [
        "v3",
        "2/7"
    ]
}