get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 74040,
    "url": "http://patches.dpdk.org/api/patches/74040/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1594785603-152773-7-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-7-git-send-email-suanmingm@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1594785603-152773-7-git-send-email-suanmingm@mellanox.com",
    "date": "2020-07-15T04:00:02",
    "name": "[6/7] net/mlx5: convert configuration objects to unified malloc",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d7713a6c400d5591c686fcccaed276bca74e1346",
    "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-7-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/74040/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/74040/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 89869A0540;\n\tWed, 15 Jul 2020 06:01:12 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BC8221C2DE;\n\tWed, 15 Jul 2020 06:00:23 +0200 (CEST)",
            "from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130])\n by dpdk.org (Postfix) with ESMTP id B26CE1C1F2\n for <dev@dpdk.org>; Wed, 15 Jul 2020 06:00:19 +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 12:00:02 +0800",
        "Message-Id": "<1594785603-152773-7-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 6/7] net/mlx5: convert configuration objects to\n\tunified malloc",
        "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": "This commit allocates the miscellaneous configuration objects from the\nunified malloc function.\n\nSigned-off-by: Suanming Mou <suanmingm@mellanox.com>\nAcked-by: Matan Azrad <matan@mellanox.com>\n---\n drivers/net/mlx5/linux/mlx5_ethdev_os.c |  8 +++++---\n drivers/net/mlx5/linux/mlx5_os.c        | 26 +++++++++++++-------------\n drivers/net/mlx5/mlx5.c                 | 14 +++++++-------\n 3 files changed, 25 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c\nindex 701614a..6b8a151 100644\n--- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c\n+++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c\n@@ -38,6 +38,7 @@\n #include <mlx5_glue.h>\n #include <mlx5_devx_cmds.h>\n #include <mlx5_common.h>\n+#include <mlx5_malloc.h>\n \n #include \"mlx5.h\"\n #include \"mlx5_rxtx.h\"\n@@ -1162,8 +1163,9 @@ int mlx5_get_module_eeprom(struct rte_eth_dev *dev,\n \t\trte_errno = EINVAL;\n \t\treturn -rte_errno;\n \t}\n-\teeprom = rte_calloc(__func__, 1,\n-\t\t\t    (sizeof(struct ethtool_eeprom) + info->length), 0);\n+\teeprom = mlx5_malloc(MLX5_MEM_ZERO,\n+\t\t\t     (sizeof(struct ethtool_eeprom) + info->length), 0,\n+\t\t\t     SOCKET_ID_ANY);\n \tif (!eeprom) {\n \t\tDRV_LOG(WARNING, \"port %u cannot allocate memory for \"\n \t\t\t\"eeprom data\", dev->data->port_id);\n@@ -1182,6 +1184,6 @@ int mlx5_get_module_eeprom(struct rte_eth_dev *dev,\n \t\t\tdev->data->port_id, strerror(rte_errno));\n \telse\n \t\trte_memcpy(info->data, eeprom->data, info->length);\n-\trte_free(eeprom);\n+\tmlx5_free(eeprom);\n \treturn ret;\n }\ndiff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c\nindex d5acef0..1698f2c 100644\n--- a/drivers/net/mlx5/linux/mlx5_os.c\n+++ b/drivers/net/mlx5/linux/mlx5_os.c\n@@ -163,7 +163,7 @@\n \t\tsocket = ctrl->socket;\n \t}\n \tMLX5_ASSERT(data != NULL);\n-\tret = rte_malloc_socket(__func__, size, alignment, socket);\n+\tret = mlx5_malloc(0, size, alignment, socket);\n \tif (!ret && size)\n \t\trte_errno = ENOMEM;\n \treturn ret;\n@@ -181,7 +181,7 @@\n mlx5_free_verbs_buf(void *ptr, void *data __rte_unused)\n {\n \tMLX5_ASSERT(data != NULL);\n-\trte_free(ptr);\n+\tmlx5_free(ptr);\n }\n \n /**\n@@ -618,9 +618,9 @@\n \t\t\tmlx5_glue->port_state_str(port_attr.state),\n \t\t\tport_attr.state);\n \t/* Allocate private eth device data. */\n-\tpriv = rte_zmalloc(\"ethdev private structure\",\n+\tpriv = mlx5_malloc(MLX5_MEM_ZERO | MLX5_MEM_RTE,\n \t\t\t   sizeof(*priv),\n-\t\t\t   RTE_CACHE_LINE_SIZE);\n+\t\t\t   RTE_CACHE_LINE_SIZE, SOCKET_ID_ANY);\n \tif (priv == NULL) {\n \t\tDRV_LOG(ERR, \"priv allocation failure\");\n \t\terr = ENOMEM;\n@@ -1109,7 +1109,7 @@\n \t\t\tmlx5_flow_id_pool_release(priv->qrss_id_pool);\n \t\tif (own_domain_id)\n \t\t\tclaim_zero(rte_eth_switch_domain_free(priv->domain_id));\n-\t\trte_free(priv);\n+\t\tmlx5_free(priv);\n \t\tif (eth_dev != NULL)\n \t\t\teth_dev->data->dev_private = NULL;\n \t}\n@@ -1428,10 +1428,10 @@\n \t * Now we can determine the maximal\n \t * amount of devices to be spawned.\n \t */\n-\tlist = rte_zmalloc(\"device spawn data\",\n-\t\t\t sizeof(struct mlx5_dev_spawn_data) *\n-\t\t\t (np ? np : nd),\n-\t\t\t RTE_CACHE_LINE_SIZE);\n+\tlist = mlx5_malloc(MLX5_MEM_ZERO,\n+\t\t\t   sizeof(struct mlx5_dev_spawn_data) *\n+\t\t\t   (np ? np : nd),\n+\t\t\t   RTE_CACHE_LINE_SIZE, SOCKET_ID_ANY);\n \tif (!list) {\n \t\tDRV_LOG(ERR, \"spawn data array allocation failure\");\n \t\trte_errno = ENOMEM;\n@@ -1722,7 +1722,7 @@\n \tif (nl_route >= 0)\n \t\tclose(nl_route);\n \tif (list)\n-\t\trte_free(list);\n+\t\tmlx5_free(list);\n \tMLX5_ASSERT(ibv_list);\n \tmlx5_glue->free_device_list(ibv_list);\n \treturn ret;\n@@ -2200,8 +2200,8 @@\n \t/* Allocate memory to grab stat names and values. */\n \tstr_sz = dev_stats_n * ETH_GSTRING_LEN;\n \tstrings = (struct ethtool_gstrings *)\n-\t\t  rte_malloc(\"xstats_strings\",\n-\t\t\t     str_sz + sizeof(struct ethtool_gstrings), 0);\n+\t\t  mlx5_malloc(0, str_sz + sizeof(struct ethtool_gstrings), 0,\n+\t\t\t      SOCKET_ID_ANY);\n \tif (!strings) {\n \t\tDRV_LOG(WARNING, \"port %u unable to allocate memory for xstats\",\n \t\t     dev->data->port_id);\n@@ -2251,7 +2251,7 @@\n \tmlx5_os_read_dev_stat(priv, \"out_of_buffer\", &stats_ctrl->imissed_base);\n \tstats_ctrl->imissed = 0;\n free:\n-\trte_free(strings);\n+\tmlx5_free(strings);\n }\n \n /**\ndiff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex ba86c68..daf65f3 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -644,11 +644,11 @@ struct mlx5_dev_ctx_shared *\n \t}\n \t/* No device found, we have to create new shared context. */\n \tMLX5_ASSERT(spawn->max_port);\n-\tsh = rte_zmalloc(\"ethdev shared ib context\",\n+\tsh = mlx5_malloc(MLX5_MEM_ZERO | MLX5_MEM_RTE,\n \t\t\t sizeof(struct mlx5_dev_ctx_shared) +\n \t\t\t spawn->max_port *\n \t\t\t sizeof(struct mlx5_dev_shared_port),\n-\t\t\t RTE_CACHE_LINE_SIZE);\n+\t\t\t RTE_CACHE_LINE_SIZE, SOCKET_ID_ANY);\n \tif (!sh) {\n \t\tDRV_LOG(ERR, \"shared context allocation failure\");\n \t\trte_errno  = ENOMEM;\n@@ -764,7 +764,7 @@ struct mlx5_dev_ctx_shared *\n \t\tclaim_zero(mlx5_glue->close_device(sh->ctx));\n \tif (sh->flow_id_pool)\n \t\tmlx5_flow_id_pool_release(sh->flow_id_pool);\n-\trte_free(sh);\n+\tmlx5_free(sh);\n \tMLX5_ASSERT(err > 0);\n \trte_errno = err;\n \treturn NULL;\n@@ -829,7 +829,7 @@ struct mlx5_dev_ctx_shared *\n \t\tclaim_zero(mlx5_glue->close_device(sh->ctx));\n \tif (sh->flow_id_pool)\n \t\tmlx5_flow_id_pool_release(sh->flow_id_pool);\n-\trte_free(sh);\n+\tmlx5_free(sh);\n exit:\n \tpthread_mutex_unlock(&mlx5_dev_ctx_list_mutex);\n }\n@@ -1089,8 +1089,8 @@ struct mlx5_dev_ctx_shared *\n \t */\n \tppriv_size =\n \t\tsizeof(struct mlx5_proc_priv) + priv->txqs_n * sizeof(void *);\n-\tppriv = rte_malloc_socket(\"mlx5_proc_priv\", ppriv_size,\n-\t\t\t\t  RTE_CACHE_LINE_SIZE, dev->device->numa_node);\n+\tppriv = mlx5_malloc(MLX5_MEM_RTE, ppriv_size, RTE_CACHE_LINE_SIZE,\n+\t\t\t    dev->device->numa_node);\n \tif (!ppriv) {\n \t\trte_errno = ENOMEM;\n \t\treturn -rte_errno;\n@@ -1111,7 +1111,7 @@ struct mlx5_dev_ctx_shared *\n {\n \tif (!dev->process_private)\n \t\treturn;\n-\trte_free(dev->process_private);\n+\tmlx5_free(dev->process_private);\n \tdev->process_private = NULL;\n }\n \n",
    "prefixes": [
        "6/7"
    ]
}