get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 56585,
    "url": "https://patches.dpdk.org/api/patches/56585/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190717090408.13717-2-vattunuru@marvell.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": "<20190717090408.13717-2-vattunuru@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190717090408.13717-2-vattunuru@marvell.com",
    "date": "2019-07-17T09:04:05",
    "name": "[v7,1/4] mempool: modify mempool populate() to skip objects from page boundaries",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c39acdb294dd77c46893756dc3f6c1c1804acf3a",
    "submitter": {
        "id": 1277,
        "url": "https://patches.dpdk.org/api/people/1277/?format=api",
        "name": "Vamsi Krishna Attunuru",
        "email": "vattunuru@marvell.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190717090408.13717-2-vattunuru@marvell.com/mbox/",
    "series": [
        {
            "id": 5556,
            "url": "https://patches.dpdk.org/api/series/5556/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=5556",
            "date": "2019-07-17T09:04:04",
            "name": "kni: add IOVA=VA support",
            "version": 7,
            "mbox": "https://patches.dpdk.org/series/5556/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/56585/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/56585/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 34263276C;\n\tWed, 17 Jul 2019 11:04:57 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n\t[67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 1B6E61DBE\n\tfor <dev@dpdk.org>; Wed, 17 Jul 2019 11:04:54 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n\tby mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n\tx6H93ZBH001991; Wed, 17 Jul 2019 02:04:54 -0700",
            "from sc-exch01.marvell.com ([199.233.58.181])\n\tby mx0b-0016f401.pphosted.com with ESMTP id 2ts0a26x0k-2\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tWed, 17 Jul 2019 02:04:53 -0700",
            "from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com\n\t(10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tWed, 17 Jul 2019 02:04:52 -0700",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com\n\t(10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Wed, 17 Jul 2019 02:04:52 -0700",
            "from hyd1vattunuru-dt.caveonetworks.com (unknown [10.29.52.72])\n\tby maili.marvell.com (Postfix) with ESMTP id D82A43F7040;\n\tWed, 17 Jul 2019 02:04:49 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n\th=from : to : cc :\n\tsubject : date : message-id : in-reply-to : references : mime-version\n\t: content-type; s=pfpt0818;\n\tbh=bhIk2ix3UfThvL5mxEF5ava1Ge5pp9WCNPgjkg/Lo9s=; \n\tb=qoSZx69RN16YxJpISwmol19LIoQ2P6ZnRdmGAfHkRxusgW/GajXl0wJCu8Roi1in7PUs\n\twm9u9y//Zs3O/s2Ilt8fvQVkFxYFFObMVlC9iJTH9jb8P5MNiTx0m/y/7b/l8UlXaCF8\n\twABcSchZC9Tr1LjmpsKTVaqbzh1NoBsDKzt7IAks1ae3bn6rRIkk2JOg/tl+Ca4K1lU0\n\tcu/DhWLzPPt3tl7GnDDZh5hEXIL0bVREkukifTcT9JhdJyEK+qVEg56QUEgyesjkiSNA\n\tf1lbiw4G9ivO/14mDYeUn3TXuQ7lBu+Tlts1B2i/FnytsRKmJC1Qq00C2cYgmGLLu0+N\n\t9g== ",
        "From": "<vattunuru@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<thomas@monjalon.net>, <jerinj@marvell.com>, <olivier.matz@6wind.com>,\n\t<ferruh.yigit@intel.com>, <anatoly.burakov@intel.com>,\n\t<kirankumark@marvell.com>, Vamsi Attunuru <vattunuru@marvell.com>",
        "Date": "Wed, 17 Jul 2019 14:34:05 +0530",
        "Message-ID": "<20190717090408.13717-2-vattunuru@marvell.com>",
        "X-Mailer": "git-send-email 2.8.4",
        "In-Reply-To": "<20190717090408.13717-1-vattunuru@marvell.com>",
        "References": "<20190625035700.2953-1-vattunuru@marvell.com>\n\t<20190717090408.13717-1-vattunuru@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:5.22.84,1.0.8\n\tdefinitions=2019-07-17_03:2019-07-16,2019-07-17 signatures=0",
        "Subject": "[dpdk-dev] [PATCH v7 1/4] mempool: modify mempool populate() to\n\tskip objects from page boundaries",
        "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": "From: Vamsi Attunuru <vattunuru@marvell.com>\n\nCurrently the phys address of a mempool object populated by the mempool\npopulate default() routine may not be contiguous with in that mbuf range.\n\nPatch ensures that each object's phys address is contiguous by modifying\ndefault behaviour of mempool populate() to prevent objects from being\nacross 2 pages, expect if the size of object is bigger than size of page.\n\nSince the overhead after this modification will be very minimal considering\nthe hugepage sizes of 512M & 1G, default behaviour is modified except for\nthe object sizes bigger than the page size.\n\nSigned-off-by: Vamsi Attunuru <vattunuru@marvell.com>\nSigned-off-by: Kiran Kumar K <kirankumark@marvell.com>\n---\n lib/librte_mempool/rte_mempool.c             |  2 +-\n lib/librte_mempool/rte_mempool_ops_default.c | 33 ++++++++++++++++++++++++++--\n 2 files changed, 32 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c\nindex 7260ce0..1c48325 100644\n--- a/lib/librte_mempool/rte_mempool.c\n+++ b/lib/librte_mempool/rte_mempool.c\n@@ -339,7 +339,7 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr,\n \ti = rte_mempool_ops_populate(mp, mp->size - mp->populated_size,\n \t\t(char *)vaddr + off,\n \t\t(iova == RTE_BAD_IOVA) ? RTE_BAD_IOVA : (iova + off),\n-\t\tlen - off, mempool_add_elem, NULL);\n+\t\tlen - off, mempool_add_elem, opaque);\n \n \t/* not enough room to store one object */\n \tif (i == 0) {\ndiff --git a/lib/librte_mempool/rte_mempool_ops_default.c b/lib/librte_mempool/rte_mempool_ops_default.c\nindex 4e2bfc8..85da264 100644\n--- a/lib/librte_mempool/rte_mempool_ops_default.c\n+++ b/lib/librte_mempool/rte_mempool_ops_default.c\n@@ -45,19 +45,48 @@ rte_mempool_op_calc_mem_size_default(const struct rte_mempool *mp,\n \treturn mem_size;\n }\n \n+/* Returns -1 if object falls on a page boundary, else returns 0 */\n+static inline int\n+mempool_check_obj_bounds(void *obj, uint64_t hugepage_sz, size_t elt_sz)\n+{\n+\tuintptr_t page_end, elt_addr = (uintptr_t)obj;\n+\tuint32_t pg_shift = rte_bsf32(hugepage_sz);\n+\tuint64_t page_mask;\n+\n+\tpage_mask =  ~((1ull << pg_shift) - 1);\n+\tpage_end = (elt_addr & page_mask) + hugepage_sz;\n+\n+\tif (elt_addr + elt_sz > page_end)\n+\t\treturn -1;\n+\n+\treturn 0;\n+}\n+\n int\n rte_mempool_op_populate_default(struct rte_mempool *mp, unsigned int max_objs,\n \t\tvoid *vaddr, rte_iova_t iova, size_t len,\n \t\trte_mempool_populate_obj_cb_t *obj_cb, void *obj_cb_arg)\n {\n-\tsize_t total_elt_sz;\n-\tsize_t off;\n+\tstruct rte_memzone *mz = obj_cb_arg;\n+\tsize_t total_elt_sz, off;\n \tunsigned int i;\n \tvoid *obj;\n \n \ttotal_elt_sz = mp->header_size + mp->elt_size + mp->trailer_size;\n \n \tfor (off = 0, i = 0; off + total_elt_sz <= len && i < max_objs; i++) {\n+\n+\t\t/* Skip page boundary check if element is bigger than page */\n+\t\tif (mz->hugepage_sz >= total_elt_sz) {\n+\t\t\tif (mempool_check_obj_bounds((char *)vaddr + off,\n+\t\t\t\t\t\t    mz->hugepage_sz,\n+\t\t\t\t\t\t    total_elt_sz) < 0) {\n+\t\t\t\ti--; /* Decrement count & skip this obj */\n+\t\t\t\toff += total_elt_sz;\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t}\n+\n \t\toff += mp->header_size;\n \t\tobj = (char *)vaddr + off;\n \t\tobj_cb(mp, obj_cb_arg, obj,\n",
    "prefixes": [
        "v7",
        "1/4"
    ]
}