get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 57224,
    "url": "http://patchwork.dpdk.org/api/patches/57224/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20190729121313.30639-4-vattunuru@marvell.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": "<20190729121313.30639-4-vattunuru@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190729121313.30639-4-vattunuru@marvell.com",
    "date": "2019-07-29T12:13:11",
    "name": "[v9,3/5] kni: add app specific mempool create & free routine",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "453d2ce0ac1bbc4e6c50bac258732a3af35b3899",
    "submitter": {
        "id": 1277,
        "url": "http://patchwork.dpdk.org/api/people/1277/?format=api",
        "name": "Vamsi Krishna Attunuru",
        "email": "vattunuru@marvell.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/20190729121313.30639-4-vattunuru@marvell.com/mbox/",
    "series": [
        {
            "id": 5808,
            "url": "http://patchwork.dpdk.org/api/series/5808/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=5808",
            "date": "2019-07-29T12:13:08",
            "name": "kni: add IOVA=VA support",
            "version": 9,
            "mbox": "http://patchwork.dpdk.org/series/5808/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/57224/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/57224/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 7DB8A1BF5E;\n\tMon, 29 Jul 2019 14:13:46 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n\t[67.231.148.174]) by dpdk.org (Postfix) with ESMTP id E61741BE83\n\tfor <dev@dpdk.org>; Mon, 29 Jul 2019 14:13:42 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n\tby mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n\tx6TCAOPv027447; Mon, 29 Jul 2019 05:13:40 -0700",
            "from sc-exch04.marvell.com ([199.233.58.184])\n\tby mx0a-0016f401.pphosted.com with ESMTP id 2u0kyq017s-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tMon, 29 Jul 2019 05:13:40 -0700",
            "from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com\n\t(10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tMon, 29 Jul 2019 05:13:39 -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; Mon, 29 Jul 2019 05:13:39 -0700",
            "from hyd1vattunuru-dt.caveonetworks.com (unknown [10.29.52.72])\n\tby maili.marvell.com (Postfix) with ESMTP id 6E4633F703F;\n\tMon, 29 Jul 2019 05:13:36 -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=bjuGPQCoeAatfv+tL5VcT1z/9Bt59vdi4ScjmsTUQ4o=; \n\tb=b1Lzsyn3x0At5D/hbOO80nDlePkjJWRbP415nubKJXWdFxT9OUvJNSOXR+z71gBjFm4K\n\tREjCqpWNfsONQNSkShQD09ZmlUBmu3mvRmtW2XLIjPx133WBlj3Gadx6614mIwjZRbcd\n\t5xp4Cixo27kFfZldj//CyzCWEOGM+i1O96YV54ROpPqjm6PSQTN35ACSe81F0OtqQsSw\n\tZFobvR3CQ5vH1T7ymtu3zkvDUpHkDAei/ldnEKI2EHu8rRP5uXUb4vE/89/6MnUkUEQJ\n\thMhywNS4c2To1KcI6CzLyo8qJx5S1RGVS1mxTMChQr8ahNg6I0LqBAFkB7ETD3bN2+S4\n\tCg== ",
        "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<arybchenko@solarflare.com>, <kirankumark@marvell.com>, Vamsi Attunuru\n\t<vattunuru@marvell.com>",
        "Date": "Mon, 29 Jul 2019 17:43:11 +0530",
        "Message-ID": "<20190729121313.30639-4-vattunuru@marvell.com>",
        "X-Mailer": "git-send-email 2.8.4",
        "In-Reply-To": "<20190729121313.30639-1-vattunuru@marvell.com>",
        "References": "<20190723053821.30227-1-vattunuru@marvell.com>\n\t<20190729121313.30639-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-29_06:2019-07-29,2019-07-29 signatures=0",
        "Subject": "[dpdk-dev] [PATCH v9 3/5] kni: add app specific mempool create &\n\tfree routine",
        "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\nWhen KNI operates in IOVA = VA mode, it requires mbuf memory\nto be physically contiguous to ensure KNI kernel module could\ntranslate IOVA addresses properly. Patch adds a KNI specific\nmempool create routine to populate the KNI packet mbuf pool\nwith memory objects that are being on a page.\n\nKNI applications need to use this mempool create & free routines\nso that mbuf related requirements in IOVA = VA mode are handled\ninside those routines based on the enabled mode.\n\nUpdated the release notes with these new routine details.\n\nSigned-off-by: Vamsi Attunuru <vattunuru@marvell.com>\n---\n doc/guides/rel_notes/release_19_08.rst |  6 ++++\n examples/kni/main.c                    |  5 ++-\n lib/librte_kni/Makefile                |  1 +\n lib/librte_kni/meson.build             |  1 +\n lib/librte_kni/rte_kni.c               | 60 ++++++++++++++++++++++++++++++++++\n lib/librte_kni/rte_kni.h               | 48 +++++++++++++++++++++++++++\n lib/librte_kni/rte_kni_version.map     |  2 ++\n 7 files changed, 122 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/doc/guides/rel_notes/release_19_08.rst b/doc/guides/rel_notes/release_19_08.rst\nindex c9bd3ce..b200aae 100644\n--- a/doc/guides/rel_notes/release_19_08.rst\n+++ b/doc/guides/rel_notes/release_19_08.rst\n@@ -301,6 +301,12 @@ API Changes\n   best-effort tc, and qsize field of struct ``rte_sched_port_params`` is\n   changed to allow different size of the each queue.\n \n+* kni: ``rte_kni_pktmbuf_pool_create`` ``rte_kni_pktmbuf_pool_free`` functions\n+  were introduced for KNI applications for creating & freeing packet pool.\n+  Since IOVA=VA mode was added in KNI, packet pool's mbuf memory should be\n+  physically contiguous for the KNI kernel module to work in IOVA=VA mode,\n+  this requirement was taken care in the kni packet pool creation fucntions.\n+\n \n ABI Changes\n -----------\ndiff --git a/examples/kni/main.c b/examples/kni/main.c\nindex 4710d71..fdfeed2 100644\n--- a/examples/kni/main.c\n+++ b/examples/kni/main.c\n@@ -975,7 +975,7 @@ main(int argc, char** argv)\n \t\trte_exit(EXIT_FAILURE, \"Could not parse input parameters\\n\");\n \n \t/* Create the mbuf pool */\n-\tpktmbuf_pool = rte_pktmbuf_pool_create(\"mbuf_pool\", NB_MBUF,\n+\tpktmbuf_pool = rte_kni_pktmbuf_pool_create(\"mbuf_pool\", NB_MBUF,\n \t\tMEMPOOL_CACHE_SZ, 0, MBUF_DATA_SZ, rte_socket_id());\n \tif (pktmbuf_pool == NULL) {\n \t\trte_exit(EXIT_FAILURE, \"Could not initialise mbuf pool\\n\");\n@@ -1043,6 +1043,9 @@ main(int argc, char** argv)\n \t\t\tcontinue;\n \t\tkni_free_kni(port);\n \t}\n+\n+\trte_kni_pktmbuf_pool_free(pktmbuf_pool);\n+\n \tfor (i = 0; i < RTE_MAX_ETHPORTS; i++)\n \t\tif (kni_port_params_array[i]) {\n \t\t\trte_free(kni_port_params_array[i]);\ndiff --git a/lib/librte_kni/Makefile b/lib/librte_kni/Makefile\nindex ab15d10..5e3dd01 100644\n--- a/lib/librte_kni/Makefile\n+++ b/lib/librte_kni/Makefile\n@@ -6,6 +6,7 @@ include $(RTE_SDK)/mk/rte.vars.mk\n # library name\n LIB = librte_kni.a\n \n+CFLAGS += -DALLOW_EXPERIMENTAL_API\n CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3 -fno-strict-aliasing\n CFLAGS += -I$(RTE_SDK)/drivers/bus/pci\n LDLIBS += -lrte_eal -lrte_mempool -lrte_mbuf -lrte_ethdev\ndiff --git a/lib/librte_kni/meson.build b/lib/librte_kni/meson.build\nindex fd46f87..e357445 100644\n--- a/lib/librte_kni/meson.build\n+++ b/lib/librte_kni/meson.build\n@@ -1,6 +1,7 @@\n # SPDX-License-Identifier: BSD-3-Clause\n # Copyright(c) 2017 Intel Corporation\n \n+allow_experimental_apis = true\n if not is_linux or not dpdk_conf.get('RTE_ARCH_64')\n \tbuild = false\n \treason = 'only supported on 64-bit linux'\ndiff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c\nindex 2aaaeaa..15dda45 100644\n--- a/lib/librte_kni/rte_kni.c\n+++ b/lib/librte_kni/rte_kni.c\n@@ -22,6 +22,7 @@\n #include <rte_tailq.h>\n #include <rte_rwlock.h>\n #include <rte_eal_memconfig.h>\n+#include <rte_mbuf_pool_ops.h>\n #include <rte_kni_common.h>\n #include \"rte_kni_fifo.h\"\n \n@@ -681,6 +682,65 @@ kni_allocate_mbufs(struct rte_kni *kni)\n \t}\n }\n \n+struct rte_mempool *\n+rte_kni_pktmbuf_pool_create(const char *name, unsigned int n,\n+\tunsigned int cache_size, uint16_t priv_size, uint16_t data_room_size,\n+\tint socket_id)\n+{\n+\tstruct rte_pktmbuf_pool_private mbp_priv;\n+\tconst char *mp_ops_name;\n+\tstruct rte_mempool *mp;\n+\tunsigned int elt_size;\n+\tint ret;\n+\n+\tif (RTE_ALIGN(priv_size, RTE_MBUF_PRIV_ALIGN) != priv_size) {\n+\t\tRTE_LOG(ERR, MBUF, \"mbuf priv_size=%u is not aligned\\n\",\n+\t\t\tpriv_size);\n+\t\trte_errno = EINVAL;\n+\t\treturn NULL;\n+\t}\n+\telt_size = sizeof(struct rte_mbuf) + (unsigned int)priv_size +\n+\t\t(unsigned int)data_room_size;\n+\tmbp_priv.mbuf_data_room_size = data_room_size;\n+\tmbp_priv.mbuf_priv_size = priv_size;\n+\n+\tmp = rte_mempool_create_empty(name, n, elt_size, cache_size,\n+\t\t sizeof(struct rte_pktmbuf_pool_private), socket_id, 0);\n+\tif (mp == NULL)\n+\t\treturn NULL;\n+\n+\tmp_ops_name = rte_mbuf_best_mempool_ops();\n+\tret = rte_mempool_set_ops_byname(mp, mp_ops_name, NULL);\n+\tif (ret != 0) {\n+\t\tRTE_LOG(ERR, MBUF, \"error setting mempool handler\\n\");\n+\t\trte_mempool_free(mp);\n+\t\trte_errno = -ret;\n+\t\treturn NULL;\n+\t}\n+\trte_pktmbuf_pool_init(mp, &mbp_priv);\n+\n+\tif (rte_eal_iova_mode() == RTE_IOVA_VA)\n+\t\tret = rte_mempool_populate_from_pg_sz_chunks(mp);\n+\telse\n+\t\tret = rte_mempool_populate_default(mp);\n+\n+\tif (ret < 0) {\n+\t\trte_mempool_free(mp);\n+\t\trte_errno = -ret;\n+\t\treturn NULL;\n+\t}\n+\n+\trte_mempool_obj_iter(mp, rte_pktmbuf_init, NULL);\n+\n+\treturn mp;\n+}\n+\n+void\n+rte_kni_pktmbuf_pool_free(struct rte_mempool *mp)\n+{\n+\trte_mempool_free(mp);\n+}\n+\n struct rte_kni *\n rte_kni_get(const char *name)\n {\ndiff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h\nindex 5699a64..99d263d 100644\n--- a/lib/librte_kni/rte_kni.h\n+++ b/lib/librte_kni/rte_kni.h\n@@ -184,6 +184,54 @@ unsigned rte_kni_tx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs,\n \t\tunsigned num);\n \n /**\n+ * Create a kni packet mbuf pool.\n+ *\n+ * This function creates and initializes a packet mbuf pool for KNI applications\n+ * It calls the required mempool populate routine based on the IOVA mode.\n+ *\n+ * @param name\n+ *   The name of the mbuf pool.\n+ * @param n\n+ *   The number of elements in the mbuf pool. The optimum size (in terms\n+ *   of memory usage) for a mempool is when n is a power of two minus one:\n+ *   n = (2^q - 1).\n+ * @param cache_size\n+ *   Size of the per-core object cache. See rte_mempool_create() for\n+ *   details.\n+ * @param priv_size\n+ *   Size of application private are between the rte_mbuf structure\n+ *   and the data buffer. This value must be aligned to RTE_MBUF_PRIV_ALIGN.\n+ * @param data_room_size\n+ *   Size of data buffer in each mbuf, including RTE_PKTMBUF_HEADROOM.\n+ * @param socket_id\n+ *   The socket identifier where the memory should be allocated. The\n+ *   value can be *SOCKET_ID_ANY* if there is no NUMA constraint for the\n+ *   reserved zone.\n+ * @return\n+ *   The pointer to the new allocated mempool, on success. NULL on error\n+ *   with rte_errno set appropriately. Possible rte_errno values include:\n+ *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config structure\n+ *    - E_RTE_SECONDARY - function was called from a secondary process instance\n+ *    - EINVAL - cache size provided is too large, or priv_size is not aligned.\n+ *    - ENOSPC - the maximum number of memzones has already been allocated\n+ *    - EEXIST - a memzone with the same name already exists\n+ *    - ENOMEM - no appropriate memory area found in which to create memzone\n+ */\n+__rte_experimental\n+struct rte_mempool *rte_kni_pktmbuf_pool_create(const char *name,\n+\t\tunsigned int n, unsigned int cache_size, uint16_t priv_size,\n+\t\tuint16_t data_room_size, int socket_id);\n+\n+/**\n+ * Free the given packet mempool.\n+ *\n+ * @param mp\n+ *  The mempool pointer.\n+ */\n+__rte_experimental\n+void rte_kni_pktmbuf_pool_free(struct rte_mempool *mp);\n+\n+/**\n  * Get the KNI context of its name.\n  *\n  * @param name\ndiff --git a/lib/librte_kni/rte_kni_version.map b/lib/librte_kni/rte_kni_version.map\nindex c877dc6..aba9728 100644\n--- a/lib/librte_kni/rte_kni_version.map\n+++ b/lib/librte_kni/rte_kni_version.map\n@@ -20,4 +20,6 @@ EXPERIMENTAL {\n \tglobal:\n \n \trte_kni_update_link;\n+\trte_kni_pktmbuf_pool_create;\n+\trte_kni_pktmbuf_pool_free;\n };\n",
    "prefixes": [
        "v9",
        "3/5"
    ]
}