get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 55277,
    "url": "http://patches.dpdk.org/api/patches/55277/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190625035700.2953-2-vattunuru@marvell.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": "<20190625035700.2953-2-vattunuru@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190625035700.2953-2-vattunuru@marvell.com",
    "date": "2019-06-25T03:56:57",
    "name": "[v6,1/4] lib/mempool: skip populating mempool objs that falls on page boundaries",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "22f581b131d699f2d5d2caaecf712dfc26d28c6d",
    "submitter": {
        "id": 1277,
        "url": "http://patches.dpdk.org/api/people/1277/?format=api",
        "name": "Vamsi Krishna Attunuru",
        "email": "vattunuru@marvell.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/20190625035700.2953-2-vattunuru@marvell.com/mbox/",
    "series": [
        {
            "id": 5141,
            "url": "http://patches.dpdk.org/api/series/5141/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5141",
            "date": "2019-06-25T03:56:56",
            "name": "add IOVA = VA support in KNI",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/5141/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/55277/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/55277/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 1489D1BC01;\n\tTue, 25 Jun 2019 05:57:17 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n\t[67.231.156.173]) by dpdk.org (Postfix) with ESMTP id EDC8C1BC06\n\tfor <dev@dpdk.org>; Tue, 25 Jun 2019 05:57:14 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n\tby mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id\n\tx5P3uV5U020675; Mon, 24 Jun 2019 20:57:13 -0700",
            "from sc-exch02.marvell.com ([199.233.58.182])\n\tby mx0b-0016f401.pphosted.com with ESMTP id 2tb2hqj117-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tMon, 24 Jun 2019 20:57:13 -0700",
            "from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com\n\t(10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tMon, 24 Jun 2019 20:57:11 -0700",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com\n\t(10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Mon, 24 Jun 2019 20:57:12 -0700",
            "from hyd1vattunuru-dt.caveonetworks.com (unknown [10.29.52.72])\n\tby maili.marvell.com (Postfix) with ESMTP id E70533F703F;\n\tMon, 24 Jun 2019 20:57:09 -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=bcp60yXFEzDXfH3s14tTgyM2dLKwq9lxy2Tcby9pCfc=; \n\tb=e9PZ9t1JUNhbBdrBXXlEeqdTfLsJQ691k6MfzWEfZknJk4Rb3VKUBCrgIQKkvvs/N0t0\n\tj/mAGRA6BfaaIFhJqPoAhc3Wp2gybbZ9zYRIjkVFoJzKIf/+FogDVsDPCDErLhIQ4qkx\n\tnI0nIFivOs3wlDQXOtLtu3+8zoShJm4hIpErq9eySw58gtF3v/iIebaOkGGWlqJasqAr\n\t3qvLyIEZPCTvgmVv6aN474dpRLA82GnJkN8LapvrZV2CpKtUTk/VIMY2G9vNhJrMTpOv\n\tCunJRJeJ6UrCh8SnOp1+tpSyFvxG9JfqVApG7dAW3c2X+P9FV3DKXR+HH3WAJpm0EaKI\n\t2A== ",
        "From": "<vattunuru@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@intel.com>, <olivier.matz@6wind.com>,\n\t<arybchenko@solarflare.com>, Vamsi Attunuru <vattunuru@marvell.com>",
        "Date": "Tue, 25 Jun 2019 09:26:57 +0530",
        "Message-ID": "<20190625035700.2953-2-vattunuru@marvell.com>",
        "X-Mailer": "git-send-email 2.8.4",
        "In-Reply-To": "<20190625035700.2953-1-vattunuru@marvell.com>",
        "References": "<20190422061533.17538-1-kirankumark@marvell.com>\n\t<20190625035700.2953-1-vattunuru@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:, ,\n\tdefinitions=2019-06-25_02:, , signatures=0",
        "Subject": "[dpdk-dev] [PATCH v6 1/4] lib/mempool: skip populating mempool objs\n\tthat falls on 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\nPatch adds new mempool flag to avoid scattering mbuf memory\nacross page boundaries. Mempool created with this flag set,\npopulated with mbufs which are exactly inside the page boundaries.\n\nSigned-off-by: Vamsi Attunuru <vattunuru@marvell.com>\n---\n lib/librte_mempool/rte_mempool.c             |  2 +-\n lib/librte_mempool/rte_mempool.h             |  2 ++\n lib/librte_mempool/rte_mempool_ops_default.c | 30 ++++++++++++++++++++++++++++\n 3 files changed, 33 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c\nindex 69bd2a6..175a20a 100644\n--- a/lib/librte_mempool/rte_mempool.c\n+++ b/lib/librte_mempool/rte_mempool.c\n@@ -338,7 +338,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.h b/lib/librte_mempool/rte_mempool.h\nindex 8053f7a..97a1529 100644\n--- a/lib/librte_mempool/rte_mempool.h\n+++ b/lib/librte_mempool/rte_mempool.h\n@@ -263,6 +263,8 @@ struct rte_mempool {\n #define MEMPOOL_F_SC_GET         0x0008 /**< Default get is \"single-consumer\".*/\n #define MEMPOOL_F_POOL_CREATED   0x0010 /**< Internal: pool is created. */\n #define MEMPOOL_F_NO_IOVA_CONTIG 0x0020 /**< Don't need IOVA contiguous objs. */\n+#define MEMPOOL_F_NO_PAGE_BOUND  0x0040\n+/**< Don't create objs on page boundaries. */\n #define MEMPOOL_F_NO_PHYS_CONTIG MEMPOOL_F_NO_IOVA_CONTIG /* deprecated */\n \n /**\ndiff --git a/lib/librte_mempool/rte_mempool_ops_default.c b/lib/librte_mempool/rte_mempool_ops_default.c\nindex 4e2bfc8..c029e9a 100644\n--- a/lib/librte_mempool/rte_mempool_ops_default.c\n+++ b/lib/librte_mempool/rte_mempool_ops_default.c\n@@ -45,11 +45,29 @@ 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+\tstruct rte_memzone *mz;\n \tsize_t total_elt_sz;\n \tsize_t off;\n \tunsigned int i;\n@@ -58,6 +76,18 @@ rte_mempool_op_populate_default(struct rte_mempool *mp, unsigned int max_objs,\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\tif (mp->flags & MEMPOOL_F_NO_PAGE_BOUND) {\n+\t\t\tmz = (struct rte_memzone *)obj_cb_arg;\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": [
        "v6",
        "1/4"
    ]
}