Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/84962/?format=api
http://patches.dpdk.org/api/patches/84962/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201210150648.8784-15-talshn@nvidia.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": "<20201210150648.8784-15-talshn@nvidia.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20201210150648.8784-15-talshn@nvidia.com", "date": "2020-12-10T15:06:29", "name": "[v2,14/33] common/mlx5/windows: handle memory allocations with alignment", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "4e5a90a257c8908e2022716698d04d138ebd82c0", "submitter": { "id": 1893, "url": "http://patches.dpdk.org/api/people/1893/?format=api", "name": "Tal Shnaiderman", "email": "talshn@nvidia.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/20201210150648.8784-15-talshn@nvidia.com/mbox/", "series": [ { "id": 14240, "url": "http://patches.dpdk.org/api/series/14240/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=14240", "date": "2020-12-10T15:06:17", "name": "mlx5 Windows support - part #5", "version": 2, "mbox": "http://patches.dpdk.org/series/14240/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/84962/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/84962/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 9993DA04DB;\n\tThu, 10 Dec 2020 16:11:48 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 46E2FC9FC;\n\tThu, 10 Dec 2020 16:08:08 +0100 (CET)", "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 0E176C982\n for <dev@dpdk.org>; Thu, 10 Dec 2020 16:07:47 +0100 (CET)", "from Internal Mail-Server by MTLPINE1 (envelope-from\n talshn@nvidia.com) with SMTP; 10 Dec 2020 17:07:45 +0200", "from nvidia.com (l-wincomp04-vm.mtl.labs.mlnx [10.237.1.5])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0BAF7h96007994;\n Thu, 10 Dec 2020 17:07:45 +0200" ], "From": "Tal Shnaiderman <talshn@nvidia.com>", "To": "dev@dpdk.org", "Cc": "thomas@monjalon.net, matan@nvidia.com, rasland@nvidia.com,\n ophirmu@nvidia.com", "Date": "Thu, 10 Dec 2020 17:06:29 +0200", "Message-Id": "<20201210150648.8784-15-talshn@nvidia.com>", "X-Mailer": "git-send-email 2.16.1.windows.4", "In-Reply-To": "<20201210150648.8784-1-talshn@nvidia.com>", "References": "<20201027232335.31427-2-ophirmu@nvidia.com>\n <20201210150648.8784-1-talshn@nvidia.com>", "Subject": "[dpdk-dev] [PATCH v2 14/33] common/mlx5/windows: handle memory\n\tallocations with alignment", "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": "From: Ophir Munk <ophirmu@nvidia.com>\n\nThis commit is the Windows equivalent of the Linux implementation. The\nAPIs included in this commit: mlx5_os_malloc(), mlx5_os_free(). For\nmemory allocations (with or without alignment) we always call\n_aligned_malloc(). Even if zero alignment was requested in the first\nplace - we always select a minimal alignment value. In this way when the\nmemory is free - it is always safe to call _aligned_free().\n\nSigned-off-by: Ophir Munk <ophirmu@nvidia.com>\nAcked-by: Matan Azrad <matan@nvidia.com>\n---\n drivers/common/mlx5/windows/mlx5_common_os.h | 51 ++++++++++++++++++++++++++++\n 1 file changed, 51 insertions(+)\n create mode 100644 drivers/common/mlx5/windows/mlx5_common_os.h", "diff": "diff --git a/drivers/common/mlx5/windows/mlx5_common_os.h b/drivers/common/mlx5/windows/mlx5_common_os.h\nnew file mode 100644\nindex 0000000000..cce7c88c6a\n--- /dev/null\n+++ b/drivers/common/mlx5/windows/mlx5_common_os.h\n@@ -0,0 +1,51 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2020 Mellanox Technologies, Ltd\n+ */\n+\n+#ifndef RTE_PMD_MLX5_COMMON_OS_H_\n+#define RTE_PMD_MLX5_COMMON_OS_H_\n+\n+#include <stdio.h>\n+\n+#include \"mlx5_autoconf.h\"\n+#include \"mlx5_glue.h\"\n+#include \"mlx5_malloc.h\"\n+\n+/**\n+ * This API allocates aligned or non-aligned memory. The free can be on either\n+ * aligned or nonaligned memory. To be protected - even though there may be no\n+ * alignment - in Windows this API will unconditioanlly call _aligned_malloc()\n+ * with at least a minimal alignment size.\n+ *\n+ * @param[in] align\n+ * The alignment value, which must be an integer power of 2 (or 0 for\n+ * non-alignment)\n+ * @param[in] size\n+ * Size in bytes to allocate\n+ *\n+ * @return\n+ * Valid pointer to allocated memory, NULL in case of failure\n+ */\n+static inline void *\n+mlx5_os_malloc(size_t align, size_t size)\n+{\n+\tif (align < MLX5_MALLOC_ALIGNMENT)\n+\t\talign = MLX5_MALLOC_ALIGNMENT;\n+\treturn _aligned_malloc(size, align);\n+}\n+\n+/**\n+ * This API de-allocates a memory that originally could have been allocated\n+ * aligned or non-aligned. In Windows since the allocation was with\n+ * _aligned_malloc() - it is safe to always call _aligned_free().\n+ *\n+ * @param[in] addr\n+ * Pointer to address to free\n+ *\n+ */\n+static inline void\n+mlx5_os_free(void *addr)\n+{\n+\t_aligned_free(addr);\n+}\n+#endif /* RTE_PMD_MLX5_COMMON_OS_H_ */\n", "prefixes": [ "v2", "14/33" ] }{ "id": 84962, "url": "