get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 32471,
    "url": "https://patches.dpdk.org/api/patches/32471/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/6b44fff0a623ad3343ae51b5aef3da9fb6e102fa.1513681966.git.anatoly.burakov@intel.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": "<6b44fff0a623ad3343ae51b5aef3da9fb6e102fa.1513681966.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/6b44fff0a623ad3343ae51b5aef3da9fb6e102fa.1513681966.git.anatoly.burakov@intel.com",
    "date": "2017-12-19T11:14:46",
    "name": "[dpdk-dev,RFC,v2,19/23] eal: enable reserving physically contiguous memzones",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0f58eb95f0aeebced3c1d6bb9d62631d9afede5b",
    "submitter": {
        "id": 4,
        "url": "https://patches.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/6b44fff0a623ad3343ae51b5aef3da9fb6e102fa.1513681966.git.anatoly.burakov@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/32471/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/32471/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 154031B21C;\n\tTue, 19 Dec 2017 12:15:30 +0100 (CET)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id D677E1B017\n\tfor <dev@dpdk.org>; Tue, 19 Dec 2017 12:14:56 +0100 (CET)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Dec 2017 03:14:55 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga005.jf.intel.com with ESMTP; 19 Dec 2017 03:14:53 -0800",
            "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tvBJBErFd003144; Tue, 19 Dec 2017 11:14:53 GMT",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id vBJBErjP010316;\n\tTue, 19 Dec 2017 11:14:53 GMT",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id vBJBEr7G010312;\n\tTue, 19 Dec 2017 11:14:53 GMT"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.45,426,1508828400\"; d=\"scan'208\";a=\"185440372\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "andras.kovacs@ericsson.com, laszlo.vadkeri@ericsson.com,\n\tkeith.wiles@intel.com, benjamin.walker@intel.com,\n\tbruce.richardson@intel.com, thomas@monjalon.net",
        "Date": "Tue, 19 Dec 2017 11:14:46 +0000",
        "Message-Id": "<6b44fff0a623ad3343ae51b5aef3da9fb6e102fa.1513681966.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": [
            "<cover.1513681966.git.anatoly.burakov@intel.com>",
            "<cover.1513681966.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<cover.1513681966.git.anatoly.burakov@intel.com>",
            "<cover.1513681966.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [RFC v2 19/23] eal: enable reserving physically\n\tcontiguous memzones",
        "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://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This adds a new set of _contig API's to rte_memzone.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/common/eal_common_memzone.c  |  44 ++++++++\n lib/librte_eal/common/include/rte_memzone.h | 158 ++++++++++++++++++++++++++++\n 2 files changed, 202 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c\nindex 542ae90..a9a4bef 100644\n--- a/lib/librte_eal/common/eal_common_memzone.c\n+++ b/lib/librte_eal/common/eal_common_memzone.c\n@@ -200,6 +200,12 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,\n \t\tsocket_id = SOCKET_ID_ANY;\n \n \tif (len == 0) {\n+\t\t/* len == 0 is only allowed for non-contiguous zones */\n+\t\t// TODO: technically, we can make it work, is it worth it?\n+\t\tif (contig) {\n+\t\t\trte_errno = EINVAL;\n+\t\t\treturn NULL;\n+\t\t}\n \t\tif (bound != 0)\n \t\t\trequested_len = bound;\n \t\telse {\n@@ -285,6 +291,19 @@ rte_memzone_reserve_bounded(const char *name, size_t len, int socket_id,\n \n /*\n  * Return a pointer to a correctly filled memzone descriptor (with a\n+ * specified alignment and boundary). If the allocation cannot be done,\n+ * return NULL.\n+ */\n+const struct rte_memzone *\n+rte_memzone_reserve_bounded_contig(const char *name, size_t len, int socket_id,\n+\t\t\t    unsigned flags, unsigned align, unsigned bound)\n+{\n+\treturn rte_memzone_reserve_thread_safe(name, len, socket_id, flags,\n+\t\t\t\t\t       align, bound, true);\n+}\n+\n+/*\n+ * Return a pointer to a correctly filled memzone descriptor (with a\n  * specified alignment). If the allocation cannot be done, return NULL.\n  */\n const struct rte_memzone *\n@@ -296,6 +315,18 @@ rte_memzone_reserve_aligned(const char *name, size_t len, int socket_id,\n }\n \n /*\n+ * Return a pointer to a correctly filled memzone descriptor (with a\n+ * specified alignment). If the allocation cannot be done, return NULL.\n+ */\n+const struct rte_memzone *\n+rte_memzone_reserve_aligned_contig(const char *name, size_t len, int socket_id,\n+\t\t\t    unsigned flags, unsigned align)\n+{\n+\treturn rte_memzone_reserve_thread_safe(name, len, socket_id, flags,\n+\t\t\t\t\t       align, 0, true);\n+}\n+\n+/*\n  * Return a pointer to a correctly filled memzone descriptor. If the\n  * allocation cannot be done, return NULL.\n  */\n@@ -308,6 +339,19 @@ rte_memzone_reserve(const char *name, size_t len, int socket_id,\n \t\t\t\t\t       false);\n }\n \n+/*\n+ * Return a pointer to a correctly filled memzone descriptor. If the\n+ * allocation cannot be done, return NULL.\n+ */\n+const struct rte_memzone *\n+rte_memzone_reserve_contig(const char *name, size_t len, int socket_id,\n+\t\t    unsigned flags)\n+{\n+\treturn rte_memzone_reserve_thread_safe(name, len, socket_id,\n+\t\t\t\t\t       flags, RTE_CACHE_LINE_SIZE, 0,\n+\t\t\t\t\t       true);\n+}\n+\n int\n rte_memzone_free(const struct rte_memzone *mz)\n {\ndiff --git a/lib/librte_eal/common/include/rte_memzone.h b/lib/librte_eal/common/include/rte_memzone.h\nindex 6f0ba18..237fd31 100644\n--- a/lib/librte_eal/common/include/rte_memzone.h\n+++ b/lib/librte_eal/common/include/rte_memzone.h\n@@ -257,6 +257,164 @@ const struct rte_memzone *rte_memzone_reserve_bounded(const char *name,\n \t\t\tunsigned flags, unsigned align, unsigned bound);\n \n /**\n+ * Reserve a portion of physical memory.\n+ *\n+ * This function reserves some memory and returns a pointer to a\n+ * correctly filled memzone descriptor. If the allocation cannot be\n+ * done, return NULL.\n+ *\n+ * @param name\n+ *   The name of the memzone. If it already exists, the function will\n+ *   fail and return NULL.\n+ * @param len\n+ *   The size of the memory to be reserved. If it\n+ *   is 0, the biggest contiguous zone will be reserved.\n+ * @param socket_id\n+ *   The socket identifier in the case of\n+ *   NUMA. The value can be SOCKET_ID_ANY if there is no NUMA\n+ *   constraint for the reserved zone.\n+ * @param flags\n+ *   The flags parameter is used to request memzones to be\n+ *   taken from specifically sized hugepages.\n+ *   - RTE_MEMZONE_2MB - Reserved from 2MB pages\n+ *   - RTE_MEMZONE_1GB - Reserved from 1GB pages\n+ *   - RTE_MEMZONE_16MB - Reserved from 16MB pages\n+ *   - RTE_MEMZONE_16GB - Reserved from 16GB pages\n+ *   - RTE_MEMZONE_256KB - Reserved from 256KB pages\n+ *   - RTE_MEMZONE_256MB - Reserved from 256MB pages\n+ *   - RTE_MEMZONE_512MB - Reserved from 512MB pages\n+ *   - RTE_MEMZONE_4GB - Reserved from 4GB pages\n+ *   - RTE_MEMZONE_SIZE_HINT_ONLY - Allow alternative page size to be used if\n+ *                                  the requested page size is unavailable.\n+ *                                  If this flag is not set, the function\n+ *                                  will return error on an unavailable size\n+ *                                  request.\n+ * @return\n+ *   A pointer to a correctly-filled read-only memzone descriptor, or NULL\n+ *   on error.\n+ *   On error case, rte_errno will be set appropriately:\n+ *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config structure\n+ *    - E_RTE_SECONDARY - function was called from a secondary process instance\n+ *    - ENOSPC - the maximum number of memzones has already been allocated\n+ *    - EEXIST - a memzone with the same name already exists\n+ *    - ENOMEM - no appropriate memory area found in which to create memzone\n+ *    - EINVAL - invalid parameters\n+ */\n+const struct rte_memzone *rte_memzone_reserve_contig(const char *name,\n+\t\t\t\t\t      size_t len, int socket_id,\n+\t\t\t\t\t      unsigned flags);\n+\n+/**\n+ * Reserve a portion of physical memory with alignment on a specified\n+ * boundary.\n+ *\n+ * This function reserves some memory with alignment on a specified\n+ * boundary, and returns a pointer to a correctly filled memzone\n+ * descriptor. If the allocation cannot be done or if the alignment\n+ * is not a power of 2, returns NULL.\n+ *\n+ * @param name\n+ *   The name of the memzone. If it already exists, the function will\n+ *   fail and return NULL.\n+ * @param len\n+ *   The size of the memory to be reserved. If it\n+ *   is 0, the biggest contiguous zone will be reserved.\n+ * @param socket_id\n+ *   The socket identifier in the case of\n+ *   NUMA. The value can be SOCKET_ID_ANY if there is no NUMA\n+ *   constraint for the reserved zone.\n+ * @param flags\n+ *   The flags parameter is used to request memzones to be\n+ *   taken from specifically sized hugepages.\n+ *   - RTE_MEMZONE_2MB - Reserved from 2MB pages\n+ *   - RTE_MEMZONE_1GB - Reserved from 1GB pages\n+ *   - RTE_MEMZONE_16MB - Reserved from 16MB pages\n+ *   - RTE_MEMZONE_16GB - Reserved from 16GB pages\n+ *   - RTE_MEMZONE_256KB - Reserved from 256KB pages\n+ *   - RTE_MEMZONE_256MB - Reserved from 256MB pages\n+ *   - RTE_MEMZONE_512MB - Reserved from 512MB pages\n+ *   - RTE_MEMZONE_4GB - Reserved from 4GB pages\n+ *   - RTE_MEMZONE_SIZE_HINT_ONLY - Allow alternative page size to be used if\n+ *                                  the requested page size is unavailable.\n+ *                                  If this flag is not set, the function\n+ *                                  will return error on an unavailable size\n+ *                                  request.\n+ * @param align\n+ *   Alignment for resulting memzone. Must be a power of 2.\n+ * @return\n+ *   A pointer to a correctly-filled read-only memzone descriptor, or NULL\n+ *   on error.\n+ *   On error case, rte_errno will be set appropriately:\n+ *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config structure\n+ *    - E_RTE_SECONDARY - function was called from a secondary process instance\n+ *    - ENOSPC - the maximum number of memzones has already been allocated\n+ *    - EEXIST - a memzone with the same name already exists\n+ *    - ENOMEM - no appropriate memory area found in which to create memzone\n+ *    - EINVAL - invalid parameters\n+ */\n+const struct rte_memzone *rte_memzone_reserve_aligned_contig(const char *name,\n+\t\t\tsize_t len, int socket_id,\n+\t\t\tunsigned flags, unsigned align);\n+\n+/**\n+ * Reserve a portion of physical memory with specified alignment and\n+ * boundary.\n+ *\n+ * This function reserves some memory with specified alignment and\n+ * boundary, and returns a pointer to a correctly filled memzone\n+ * descriptor. If the allocation cannot be done or if the alignment\n+ * or boundary are not a power of 2, returns NULL.\n+ * Memory buffer is reserved in a way, that it wouldn't cross specified\n+ * boundary. That implies that requested length should be less or equal\n+ * then boundary.\n+ *\n+ * @param name\n+ *   The name of the memzone. If it already exists, the function will\n+ *   fail and return NULL.\n+ * @param len\n+ *   The size of the memory to be reserved. If it\n+ *   is 0, the biggest contiguous zone will be reserved.\n+ * @param socket_id\n+ *   The socket identifier in the case of\n+ *   NUMA. The value can be SOCKET_ID_ANY if there is no NUMA\n+ *   constraint for the reserved zone.\n+ * @param flags\n+ *   The flags parameter is used to request memzones to be\n+ *   taken from specifically sized hugepages.\n+ *   - RTE_MEMZONE_2MB - Reserved from 2MB pages\n+ *   - RTE_MEMZONE_1GB - Reserved from 1GB pages\n+ *   - RTE_MEMZONE_16MB - Reserved from 16MB pages\n+ *   - RTE_MEMZONE_16GB - Reserved from 16GB pages\n+ *   - RTE_MEMZONE_256KB - Reserved from 256KB pages\n+ *   - RTE_MEMZONE_256MB - Reserved from 256MB pages\n+ *   - RTE_MEMZONE_512MB - Reserved from 512MB pages\n+ *   - RTE_MEMZONE_4GB - Reserved from 4GB pages\n+ *   - RTE_MEMZONE_SIZE_HINT_ONLY - Allow alternative page size to be used if\n+ *                                  the requested page size is unavailable.\n+ *                                  If this flag is not set, the function\n+ *                                  will return error on an unavailable size\n+ *                                  request.\n+ * @param align\n+ *   Alignment for resulting memzone. Must be a power of 2.\n+ * @param bound\n+ *   Boundary for resulting memzone. Must be a power of 2 or zero.\n+ *   Zero value implies no boundary condition.\n+ * @return\n+ *   A pointer to a correctly-filled read-only memzone descriptor, or NULL\n+ *   on error.\n+ *   On error case, rte_errno will be set appropriately:\n+ *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config structure\n+ *    - E_RTE_SECONDARY - function was called from a secondary process instance\n+ *    - ENOSPC - the maximum number of memzones has already been allocated\n+ *    - EEXIST - a memzone with the same name already exists\n+ *    - ENOMEM - no appropriate memory area found in which to create memzone\n+ *    - EINVAL - invalid parameters\n+ */\n+const struct rte_memzone *rte_memzone_reserve_bounded_contig(const char *name,\n+\t\t\tsize_t len, int socket_id,\n+\t\t\tunsigned flags, unsigned align, unsigned bound);\n+\n+/**\n  * Free a memzone.\n  *\n  * @param mz\n",
    "prefixes": [
        "dpdk-dev",
        "RFC",
        "v2",
        "19/23"
    ]
}