get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 6110,
    "url": "https://patches.dpdk.org/api/patches/6110/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1436172698-21749-8-git-send-email-zlu@ezchip.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": "<1436172698-21749-8-git-send-email-zlu@ezchip.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1436172698-21749-8-git-send-email-zlu@ezchip.com",
    "date": "2015-07-06T08:51:32",
    "name": "[dpdk-dev,v3,07/12] memzone: allow multiple pagesizes to be requested",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "2fa152a01cac45338acc4b028ca887538d40169f",
    "submitter": {
        "id": 130,
        "url": "https://patches.dpdk.org/api/people/130/?format=api",
        "name": "Zhigang Lu",
        "email": "zlu@ezchip.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1436172698-21749-8-git-send-email-zlu@ezchip.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/6110/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/6110/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id B33345A52;\n\tMon,  6 Jul 2015 10:53:14 +0200 (CEST)",
            "from emea01-am1-obe.outbound.protection.outlook.com\n\t(mail-am1on0094.outbound.protection.outlook.com [157.56.112.94])\n\tby dpdk.org (Postfix) with ESMTP id 09D505A52\n\tfor <dev@dpdk.org>; Mon,  6 Jul 2015 10:53:13 +0200 (CEST)",
            "from AMSPR02CA0045.eurprd02.prod.outlook.com (10.242.225.173) by\n\tVI1PR02MB0815.eurprd02.prod.outlook.com (10.162.14.152) with\n\tMicrosoft SMTP\n\tServer (TLS) id 15.1.207.19; Mon, 6 Jul 2015 08:53:12 +0000",
            "from DB3FFO11FD008.protection.gbl (2a01:111:f400:7e04::163) by\n\tAMSPR02CA0045.outlook.office365.com (2a01:111:e400:8028::45) with\n\tMicrosoft SMTP Server (TLS) id 15.1.207.19 via Frontend Transport;\n\tMon, 6 Jul 2015 08:53:12 +0000",
            "from bjgfarm-1.internal.tilera.com (124.207.145.166) by\n\tDB3FFO11FD008.mail.protection.outlook.com (10.47.216.97) with\n\tMicrosoft SMTP Server (TLS) id 15.1.201.10 via Frontend Transport;\n\tMon, 6 Jul 2015 08:53:10 +0000",
            "(from zlu@localhost)\n\tby bjgfarm-1.internal.tilera.com (8.14.4/8.14.4/Submit) id\n\tt668r6B2024551; Mon, 6 Jul 2015 16:53:06 +0800"
        ],
        "Authentication-Results": "spf=fail (sender IP is 124.207.145.166)\n\tsmtp.mailfrom=ezchip.com; ezchip.com; dkim=none (message not signed)\n\theader.d=none;",
        "Received-SPF": "Fail (protection.outlook.com: domain of ezchip.com does not\n\tdesignate 124.207.145.166 as permitted sender)\n\treceiver=protection.outlook.com; client-ip=124.207.145.166;\n\thelo=bjgfarm-1.internal.tilera.com;",
        "From": "Zhigang Lu <zlu@ezchip.com>",
        "To": "<dev@dpdk.org>",
        "Date": "Mon, 6 Jul 2015 16:51:32 +0800",
        "Message-ID": "<1436172698-21749-8-git-send-email-zlu@ezchip.com>",
        "X-Mailer": "git-send-email 2.1.2",
        "In-Reply-To": "<1436172698-21749-1-git-send-email-zlu@ezchip.com>",
        "References": "<1436172698-21749-1-git-send-email-zlu@ezchip.com>",
        "X-EOPAttributedMessage": "0",
        "X-Microsoft-Exchange-Diagnostics": [
            "1; DB3FFO11FD008;\n\t1:pho3dJ7c2mOvZck0jExTxM6PhQoyp35ttVn5EVl7G50e+bsnQbWG+HPaN0hDMQfu/U6fw9ss0nx0QzTZDSdpev/wffx4fikefl4BsuUMfv5/dsOZCJhe6MZpRonCf3eJOLFxy6oZ6f0zRB5it92uT1EhZGYZ2JicVMjoLMdiuSOYF0A/BpApE8RUgsDfRvAy7d6CphwDQ/vIrAw+FBN5tO0LASZJdwDEQUEDEx3vg9PkNhb0uYwyjglq9fWoHzWmyOH1Xzgh74olUU4K16dTHSy4PoZ3Xxf45feSTfj2MRrX7AQtb6bWPQKwGZgEXsXIS0kLv68cVXCE6Y3PTN/t3w==",
            "1; VI1PR02MB0815;\n\t2:2pxptVLpgTIU+alS5sjzPHQ8ZJgrj82bxRolinrK1VLUhtTy/1qOJxdUFNYZBCKE;\n\t3:sjLyhiMV++Y7qAdeKopblDyea1WPkTOA2AIWb/n4DsE/FNeDmuztDq0wQnMOwlJTn/WChbxKXM7eDOJNoDluM1iByH3RpcmHyIOkjlslaxwWuiOOdr53nROEeDhg4kZTApgdTgdEDW6yTHnE/70RohdmswjwanxhiBCUDUrYb4dOifD+bSDRgxP7NN7Eajmg+b6AHTTd+b7ZberTM0HedI+mRsxoVOieSfZQ7JReE9R8vtULbXIhJY+4HBwcvdBc;\n\t25:I+BIMj56Y0WhNtmnVSs3n2+67yH+ctlKcpj7AJuTWvds41KbHNzWUNli80Na2QDVyIBhYlSiZltHCB1gkguCpY07PkqxwsyEvmKP6lKgfFZsfa9qDKEigL+8CpILezZrCsGSmlfn5ZccBwORDFmCnkQAo3oXMCoLyYX5qg04RvCntqu1iIFGc09atxBegZVozTjceKZp60G0pewRRHy9D4Vs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c5wOmTtDuWaNg7jqlhicg1slyCcP0B60UZCerbqVGPGaoEoHCxwQRTN42Es=;\n\t20:aSAhrucgdXYgy2cuJxUg9PmHbVjoQA6bMWxRKijHwWJXP5MOQPZS76XghRi0roPiC6KS1RxlhqNDLndM/yIoDQ=="
        ],
        "X-Forefront-Antispam-Report": "CIP:124.207.145.166; CTRY:CN; IPV:NLI; EFV:NLI; \n\tSFV:NSPM;\n\tSFS:(10009020)(6009001)(2980300002)(339900001)(189002)(199003)(104016003)(5001960100002)(107886002)(575784001)(110136002)(86362001)(2351001)(2950100001)(76176999)(50986999)(106466001)(19580405001)(87936001)(6806004)(229853001)(189998001)(19580395003)(33646002)(50226001)(46102003)(36756003)(92566002)(105606002)(85426001)(62966003)(77156002)(42186005)(450100001)(47776003)(50466002)(48376002)(4001430100001);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR02MB0815;\n\tH:bjgfarm-1.internal.tilera.com; \n\tFPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; ",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Microsoft-Antispam": "UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR02MB0815;",
        "X-Microsoft-Antispam-PRVS": "<VI1PR02MB08157FAF9F24EDE1B2312FF8DB930@VI1PR02MB0815.eurprd02.prod.outlook.com>",
        "X-Exchange-Antispam-Report-Test": "UriScan:;",
        "X-Exchange-Antispam-Report-CFA-Test": "BCL:0; PCL:0;\n\tRULEID:(601004)(5005006)(3002001); SRVR:VI1PR02MB0815; BCL:0; PCL:0;\n\tRULEID:; SRVR:VI1PR02MB0815; ",
        "X-Forefront-PRVS": "06290ECA9D",
        "SpamDiagnosticOutput": "1:23",
        "SpamDiagnosticMetadata": "NSPM",
        "X-OriginatorOrg": "ezchip.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "06 Jul 2015 08:53:10.6686\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-Id": "0fc16e0a-3cd3-4092-8b2f-0a42cff122c3",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "TenantId=0fc16e0a-3cd3-4092-8b2f-0a42cff122c3;\n\tIp=[124.207.145.166]; \n\tHelo=[bjgfarm-1.internal.tilera.com]",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "VI1PR02MB0815",
        "Subject": "[dpdk-dev] [PATCH v3 07/12] memzone: allow multiple pagesizes to be\n\trequested",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://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": "<http://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 patch extends the memzone allocator to remove the restriction\nthat prevented callers from specifying multiple page sizes in the\nflags argument.\n\nIn doing so, we also sanitize the free segment matching logic to get\nrid of architecture specific disjunctions (2MB vs 1GB on x86, and 16MB\nvs 16GB on PPC), thereby allowing for a broader range of hugepages on\narchitectures that support it.\n\nChange-Id: Ic3713f61da49629a570fe4de34a8aaf5e2e0a19b\nSigned-off-by: Zhigang Lu <zlu@ezchip.com>\n---\n lib/librte_eal/common/eal_common_memzone.c | 58 ++++++++++++++----------------\n 1 file changed, 27 insertions(+), 31 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c\nindex 1ea502b..76bae72 100644\n--- a/lib/librte_eal/common/eal_common_memzone.c\n+++ b/lib/librte_eal/common/eal_common_memzone.c\n@@ -113,7 +113,8 @@ align_phys_boundary(const struct rte_memseg *ms, size_t len, size_t align,\n \n static const struct rte_memzone *\n memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,\n-\t\tint socket_id, unsigned flags, unsigned align, unsigned bound)\n+\t\tint socket_id, uint64_t size_mask, unsigned align,\n+\t\tunsigned bound)\n {\n \tstruct rte_mem_config *mcfg;\n \tunsigned i = 0;\n@@ -201,18 +202,7 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,\n \t\tif ((requested_len + addr_offset) > free_memseg[i].len)\n \t\t\tcontinue;\n \n-\t\t/* check flags for hugepage sizes */\n-\t\tif ((flags & RTE_MEMZONE_2MB) &&\n-\t\t\t\tfree_memseg[i].hugepage_sz == RTE_PGSIZE_1G)\n-\t\t\tcontinue;\n-\t\tif ((flags & RTE_MEMZONE_1GB) &&\n-\t\t\t\tfree_memseg[i].hugepage_sz == RTE_PGSIZE_2M)\n-\t\t\tcontinue;\n-\t\tif ((flags & RTE_MEMZONE_16MB) &&\n-\t\t\t\tfree_memseg[i].hugepage_sz == RTE_PGSIZE_16G)\n-\t\t\tcontinue;\n-\t\tif ((flags & RTE_MEMZONE_16GB) &&\n-\t\t\t\tfree_memseg[i].hugepage_sz == RTE_PGSIZE_16M)\n+\t\tif ((size_mask & free_memseg[i].hugepage_sz) == 0)\n \t\t\tcontinue;\n \n \t\t/* this segment is the best until now */\n@@ -244,16 +234,6 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,\n \n \t/* no segment found */\n \tif (memseg_idx == -1) {\n-\t\t/*\n-\t\t * If RTE_MEMZONE_SIZE_HINT_ONLY flag is specified,\n-\t\t * try allocating again without the size parameter otherwise -fail.\n-\t\t */\n-\t\tif ((flags & RTE_MEMZONE_SIZE_HINT_ONLY)  &&\n-\t\t    ((flags & RTE_MEMZONE_1GB) || (flags & RTE_MEMZONE_2MB)\n-\t\t|| (flags & RTE_MEMZONE_16MB) || (flags & RTE_MEMZONE_16GB)))\n-\t\t\treturn memzone_reserve_aligned_thread_unsafe(name,\n-\t\t\t\tlen, socket_id, 0, align, bound);\n-\n \t\trte_errno = ENOMEM;\n \t\treturn NULL;\n \t}\n@@ -302,13 +282,18 @@ rte_memzone_reserve_thread_safe(const char *name, size_t len,\n {\n \tstruct rte_mem_config *mcfg;\n \tconst struct rte_memzone *mz = NULL;\n-\n-\t/* both sizes cannot be explicitly called for */\n-\tif (((flags & RTE_MEMZONE_1GB) && (flags & RTE_MEMZONE_2MB))\n-\t\t|| ((flags & RTE_MEMZONE_16MB) && (flags & RTE_MEMZONE_16GB))) {\n-\t\trte_errno = EINVAL;\n-\t\treturn NULL;\n-\t}\n+\tuint64_t size_mask = 0;\n+\n+\tif (flags & RTE_MEMZONE_2MB)\n+\t\tsize_mask |= RTE_PGSIZE_2M;\n+\tif (flags & RTE_MEMZONE_16MB)\n+\t\tsize_mask |= RTE_PGSIZE_16M;\n+\tif (flags & RTE_MEMZONE_1GB)\n+\t\tsize_mask |= RTE_PGSIZE_1G;\n+\tif (flags & RTE_MEMZONE_16GB)\n+\t\tsize_mask |= RTE_PGSIZE_16G;\n+\tif (!size_mask)\n+\t\tsize_mask = UINT64_MAX;\n \n \t/* get pointer to global configuration */\n \tmcfg = rte_eal_get_configuration()->mem_config;\n@@ -316,7 +301,18 @@ rte_memzone_reserve_thread_safe(const char *name, size_t len,\n \trte_rwlock_write_lock(&mcfg->mlock);\n \n \tmz = memzone_reserve_aligned_thread_unsafe(\n-\t\tname, len, socket_id, flags, align, bound);\n+\t\tname, len, socket_id, size_mask, align, bound);\n+\n+\t/*\n+\t * If we failed to allocate the requested page size, and the \n+\t * RTE_MEMZONE_SIZE_HINT_ONLY flag is specified, try allocating\n+\t * again.\n+\t */\n+\tif (!mz && rte_errno == ENOMEM && size_mask != UINT64_MAX &&\n+\t    flags & RTE_MEMZONE_SIZE_HINT_ONLY) {\n+\t\tmz = memzone_reserve_aligned_thread_unsafe(\n+\t\t\tname, len, socket_id, UINT64_MAX, align, bound);\n+\t}\n \n \trte_rwlock_write_unlock(&mcfg->mlock);\n \n",
    "prefixes": [
        "dpdk-dev",
        "v3",
        "07/12"
    ]
}