get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 42226,
    "url": "http://patches.dpdk.org/api/patches/42226/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1530708838-2682-2-git-send-email-alejandro.lucero@netronome.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": "<1530708838-2682-2-git-send-email-alejandro.lucero@netronome.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1530708838-2682-2-git-send-email-alejandro.lucero@netronome.com",
    "date": "2018-07-04T12:53:53",
    "name": "[v3,1/6] mem: add function for checking memsegs IOVAs addresses",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "61f24a032d43e480ba784bc0de282f614700976d",
    "submitter": {
        "id": 270,
        "url": "http://patches.dpdk.org/api/people/270/?format=api",
        "name": "Alejandro Lucero",
        "email": "alejandro.lucero@netronome.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1530708838-2682-2-git-send-email-alejandro.lucero@netronome.com/mbox/",
    "series": [
        {
            "id": 397,
            "url": "http://patches.dpdk.org/api/series/397/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=397",
            "date": "2018-07-04T12:53:54",
            "name": "use IOVAs check based on DMA mask",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/397/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/42226/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/42226/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 EF57A1BF2D;\n\tWed,  4 Jul 2018 14:54:12 +0200 (CEST)",
            "from netronome.com (host-79-78-33-110.static.as9105.net\n\t[79.78.33.110]) by dpdk.org (Postfix) with ESMTP id 1E88B1BF20;\n\tWed,  4 Jul 2018 14:54:09 +0200 (CEST)",
            "from netronome.com (localhost [127.0.0.1])\n\tby netronome.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id\n\tw64Cs4aG002730; Wed, 4 Jul 2018 13:54:04 +0100",
            "(from alucero@localhost)\n\tby netronome.com (8.14.4/8.14.4/Submit) id w64Cs4AX002729;\n\tWed, 4 Jul 2018 13:54:04 +0100"
        ],
        "From": "Alejandro Lucero <alejandro.lucero@netronome.com>",
        "To": "dev@dpdk.org",
        "Cc": "stable@dpdk.org, anatoly.burakov@intel.com, maxime.coquelin@redhat.com, \n\tferruh.yigit@intel.com",
        "Date": "Wed,  4 Jul 2018 13:53:53 +0100",
        "Message-Id": "<1530708838-2682-2-git-send-email-alejandro.lucero@netronome.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1530708838-2682-1-git-send-email-alejandro.lucero@netronome.com>",
        "References": "<1530708838-2682-1-git-send-email-alejandro.lucero@netronome.com>",
        "Subject": "[dpdk-dev] [PATCH v3 1/6] mem: add function for checking memsegs\n\tIOVAs addresses",
        "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": "A device can suffer addressing limitations. This functions checks\nmemsegs have iovas within the supported range based on dma mask.\n\nPMD should use this during initialization if supported devices\nsuffer addressing limitations, returning an error if this function\nreturns memsegs out of range.\n\nAnother potential usage is for emulated IOMMU hardware with addressing\nlimitations.\n\nSigned-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>\nAcked-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/common/eal_common_memory.c  | 33 ++++++++++++++++++++++++++++++\n lib/librte_eal/common/include/rte_memory.h |  3 +++\n lib/librte_eal/rte_eal_version.map         |  1 +\n 3 files changed, 37 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c\nindex fc6c44d..f5efebe 100644\n--- a/lib/librte_eal/common/eal_common_memory.c\n+++ b/lib/librte_eal/common/eal_common_memory.c\n@@ -109,6 +109,39 @@\n \t}\n }\n \n+/* check memseg iovas are within the required range based on dma mask */\n+int\n+rte_eal_check_dma_mask(uint8_t maskbits)\n+{\n+\n+\tconst struct rte_mem_config *mcfg;\n+\tuint64_t mask;\n+\tint i;\n+\n+\t/* create dma mask */\n+\tmask = ~((1ULL << maskbits) - 1);\n+\n+\t/* get pointer to global configuration */\n+\tmcfg = rte_eal_get_configuration()->mem_config;\n+\n+\tfor (i = 0; i < RTE_MAX_MEMSEG; i++) {\n+\t\tif (mcfg->memseg[i].addr == NULL)\n+\t\t\tbreak;\n+\n+\t\tif (mcfg->memseg[i].iova & mask) {\n+\t\t\tRTE_LOG(INFO, EAL,\n+\t\t\t\t\"memseg[%d] iova %\"PRIx64\" out of range:\\n\",\n+\t\t\t\ti, mcfg->memseg[i].iova);\n+\n+\t\t\tRTE_LOG(INFO, EAL, \"\\tusing dma mask %\"PRIx64\"\\n\",\n+\t\t\t\tmask);\n+\t\t\treturn -1;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n /* return the number of memory channels */\n unsigned rte_memory_get_nchannel(void)\n {\ndiff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h\nindex 80a8fc0..b2a0168 100644\n--- a/lib/librte_eal/common/include/rte_memory.h\n+++ b/lib/librte_eal/common/include/rte_memory.h\n@@ -209,6 +209,9 @@ struct rte_memseg {\n  */\n unsigned rte_memory_get_nrank(void);\n \n+/* check memsegs iovas are within a range based on dma mask */\n+int rte_eal_check_dma_mask(uint8_t maskbits);\n+\n /**\n  * Drivers based on uio will not load unless physical\n  * addresses are obtainable. It is only possible to get\ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex f4f46c1..aa6cf87 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -184,6 +184,7 @@ DPDK_17.11 {\n \n \trte_eal_create_uio_dev;\n \trte_bus_get_iommu_class;\n+\trte_eal_check_dma_mask;\n \trte_eal_has_pci;\n \trte_eal_iova_mode;\n \trte_eal_mbuf_default_mempool_ops;\n",
    "prefixes": [
        "v3",
        "1/6"
    ]
}