get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 43114,
    "url": "http://patchwork.dpdk.org/api/patches/43114/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1e4e38f022da0d791b454b8d9cddce61b479b7ad.1531752592.git.anatoly.burakov@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<1e4e38f022da0d791b454b8d9cddce61b479b7ad.1531752592.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1e4e38f022da0d791b454b8d9cddce61b479b7ad.1531752592.git.anatoly.burakov@intel.com",
    "date": "2018-07-16T14:57:19",
    "name": "mem: fix alignment of requested virtual areas",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "740280a036e06508b361210ae6602463d84dafb7",
    "submitter": {
        "id": 4,
        "url": "http://patchwork.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1e4e38f022da0d791b454b8d9cddce61b479b7ad.1531752592.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 607,
            "url": "http://patchwork.dpdk.org/api/series/607/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=607",
            "date": "2018-07-16T14:57:19",
            "name": "mem: fix alignment of requested virtual areas",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/607/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/43114/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/43114/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 87D4623C;\n\tMon, 16 Jul 2018 16:57:24 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 4045416E;\n\tMon, 16 Jul 2018 16:57:22 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t16 Jul 2018 07:57:21 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga001.jf.intel.com with ESMTP; 16 Jul 2018 07:57:20 -0700",
            "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\tw6GEvJFf014117; Mon, 16 Jul 2018 15:57:19 +0100",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w6GEvJKd023234;\n\tMon, 16 Jul 2018 15:57:19 +0100",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w6GEvJnb023230;\n\tMon, 16 Jul 2018 15:57:19 +0100"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,361,1526367600\"; d=\"scan'208\";a=\"73183180\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, lei.a.yao@intel.com, dariuszx.stojaczyk@intel.com, \n\tstable@dpdk.org",
        "Date": "Mon, 16 Jul 2018 15:57:19 +0100",
        "Message-Id": "<1e4e38f022da0d791b454b8d9cddce61b479b7ad.1531752592.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "Subject": "[dpdk-dev] [PATCH] mem: fix alignment of requested virtual areas",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The original code did not align any addresses that were requested as\npage-aligned, but were different because addr_is_hint was set.\n\nBelow fix by Dariusz has introduced an issue where all unaligned addresses\nwere left as unaligned.\n\nThis patch is a partial revert of\ncommit 7fa7216ed48d (\"mem: fix alignment of requested virtual areas\")\n\nand implements a proper fix for this issue, by asking for alignment in all\nbut the following two cases:\n\n1) page size is equal to system page size, or\n2) we got an aligned requested address, and will not accept a different one\n\nThis ensures that alignment is performed in all cases, except for those we\ncan guarantee that the address will not need alignment.\n\nFixes: b7cc54187ea4 (\"mem: move virtual area function in common directory\")\nFixes: 7fa7216ed48d (\"mem: fix alignment of requested virtual areas\")\nCc: dariuszx.stojaczyk@intel.com\nCc: stable@dpdk.org\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/common/eal_common_memory.c | 15 +++++++++------\n 1 file changed, 9 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c\nindex 659cc08f6..fbfb1b055 100644\n--- a/lib/librte_eal/common/eal_common_memory.c\n+++ b/lib/librte_eal/common/eal_common_memory.c\n@@ -66,14 +66,17 @@ eal_get_virtual_area(void *requested_addr, size_t *size,\n \t\taddr_is_hint = true;\n \t}\n \n-\t/* if requested address is not aligned by page size, or if requested\n-\t * address is NULL, add page size to requested length as we may get an\n-\t * address that's aligned by system page size, which can be smaller than\n-\t * our requested page size. additionally, we shouldn't try to align if\n-\t * system page size is the same as requested page size.\n+\t/* we don't need alignment of resulting pointer in the following cases:\n+\t *\n+\t * 1. page size is equal to system size\n+\t * 2. we have a requested address, and it is page-aligned, and we will\n+\t *    be discarding the address if we get a different one.\n+\t *\n+\t * for all other cases, alignment is potentially necessary.\n \t */\n \tno_align = (requested_addr != NULL &&\n-\t\t((uintptr_t)requested_addr & (page_sz - 1))) ||\n+\t\trequested_addr == RTE_PTR_ALIGN(requested_addr, page_sz) &&\n+\t\t!addr_is_hint) ||\n \t\tpage_sz == system_page_sz;\n \n \tdo {\n",
    "prefixes": []
}