get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 74036,
    "url": "http://patches.dpdk.org/api/patches/74036/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1594785603-152773-3-git-send-email-suanmingm@mellanox.com/",
    "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": "<1594785603-152773-3-git-send-email-suanmingm@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1594785603-152773-3-git-send-email-suanmingm@mellanox.com",
    "date": "2020-07-15T03:59:58",
    "name": "[2/7] net/mlx5: add allocate memory from system devarg",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "dd7730b46316385819055c4bba76e78b3bd7907d",
    "submitter": {
        "id": 1358,
        "url": "http://patches.dpdk.org/api/people/1358/?format=api",
        "name": "Suanming Mou",
        "email": "suanmingm@mellanox.com"
    },
    "delegate": {
        "id": 3268,
        "url": "http://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1594785603-152773-3-git-send-email-suanmingm@mellanox.com/mbox/",
    "series": [
        {
            "id": 11031,
            "url": "http://patches.dpdk.org/api/series/11031/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11031",
            "date": "2020-07-15T03:59:56",
            "name": "net/mlx5: add sys_mem_en devarg",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/11031/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/74036/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/74036/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 5ED73A0540;\n\tWed, 15 Jul 2020 06:00:33 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0E6C11C1D0;\n\tWed, 15 Jul 2020 06:00:17 +0200 (CEST)",
            "from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130])\n by dpdk.org (Postfix) with ESMTP id 54DB41C1AB\n for <dev@dpdk.org>; Wed, 15 Jul 2020 06:00:13 +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": "Wed, 15 Jul 2020 11:59:58 +0800",
        "Message-Id": "<1594785603-152773-3-git-send-email-suanmingm@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1594785603-152773-1-git-send-email-suanmingm@mellanox.com>",
        "References": "<1594785603-152773-1-git-send-email-suanmingm@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH 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 4b6d8fb..d86b5c7 100644\n--- a/doc/guides/nics/mlx5.rst\n+++ b/doc/guides/nics/mlx5.rst\n@@ -879,6 +879,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 2dc57b2..d5acef0 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 0c654ed..9b17266 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -167,6 +167,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@@ -1374,6 +1377,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@@ -1430,6 +1435,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 46e66eb..967f5d8 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -216,6 +216,7 @@ struct mlx5_dev_config {\n \tunsigned int devx:1; /* Whether devx interface is available or not. */\n \tunsigned int dest_tir:1; /* Whether advanced DR API is available. */\n \tunsigned int reclaim_mode:2; /* Memory reclaim mode. */\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": [
        "2/7"
    ]
}