get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 55279,
    "url": "http://patches.dpdk.org/api/patches/55279/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190625035700.2953-4-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-4-vattunuru@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190625035700.2953-4-vattunuru@marvell.com",
    "date": "2019-06-25T03:56:59",
    "name": "[v6,3/4] example/kni: add IOVA support for kni application",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "fa3642c53112f0d90c426790b218238e45edf8db",
    "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-4-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/55279/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/55279/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 609381BC21;\n\tTue, 25 Jun 2019 05:57:24 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n\t[67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 54D411BC1E\n\tfor <dev@dpdk.org>; Tue, 25 Jun 2019 05:57:22 +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\tx5P3v5iG021379; Mon, 24 Jun 2019 20:57:21 -0700",
            "from sc-exch04.marvell.com ([199.233.58.184])\n\tby mx0b-0016f401.pphosted.com with ESMTP id 2tb2hqj11j-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tMon, 24 Jun 2019 20:57:20 -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, 24 Jun 2019 20:57:19 -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, 24 Jun 2019 20:57:19 -0700",
            "from hyd1vattunuru-dt.caveonetworks.com (unknown [10.29.52.72])\n\tby maili.marvell.com (Postfix) with ESMTP id BA4CB3F703F;\n\tMon, 24 Jun 2019 20:57:16 -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=deeESjb7oiamCNeJHk8XT19nQoSn0mt4S3Gxxnfpb/k=; \n\tb=ULYphC/BzrhcxXoxeTXtgGQx1m6FNK/sOphWOjhOQc5AVtABYaMFUp705TAHPc72Ad+6\n\taBsSf7dIv+lDsbNWBbBOGuI03CAR5MqYH4ENdPS/oEhEsJWU8MCCAhSZA2F94IlwYw6p\n\tbs4L6vWlBkY83q1cmMLpYZRk+OlfBcHgggmmUszkzdytaOZd6XRD08hHgIx8CIZFtmCD\n\t4FUOtrDqZNnDaU5CvykSbnzbi895Q1fUPJNev+WSFNPqbVSuq8I75gx7boNyIkLU9ooB\n\t6GfKrE/efhj7wKR1r+UYnUkydsuCLZCkGFOg6dsnZ4C6PRlLPpq7py/doKqTTx7FTw6t\n\txA== ",
        "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>,\n\t\"Kiran Kumar K\" <kirankumark@marvell.com>",
        "Date": "Tue, 25 Jun 2019 09:26:59 +0530",
        "Message-ID": "<20190625035700.2953-4-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 3/4] example/kni: add IOVA support for kni\n\tapplication",
        "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\nCurrent KNI implementation operates in IOVA = PA mode,\nPatch adds support for IOVA = VA mode by addressing\nthe issues with page address translations(IOVA <==> KVA).\n\nIn this patch KNI application creates mempool with\n\"MEMPOOL_F_NO_PAGE_BOUND\" flag to ensure all mbuf memory\nis with in the page boundaries and subsequently kernel KNI\nmodule uses iommu_iova_to_phys() and phys_to_virt() APIs\nto get the kernel virtual addresses.\n\nSigned-off-by: Vamsi Attunuru <vattunuru@marvell.com>\nSigned-off-by: Kiran Kumar K <kirankumark@marvell.com>\n---\n examples/kni/main.c                               | 53 ++++++++++++++++++++++-\n lib/librte_eal/linux/eal/eal.c                    |  8 ----\n lib/librte_eal/linux/eal/include/rte_kni_common.h |  1 +\n lib/librte_kni/rte_kni.c                          |  2 +\n 4 files changed, 55 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/examples/kni/main.c b/examples/kni/main.c\nindex 4710d71..13083a7 100644\n--- a/examples/kni/main.c\n+++ b/examples/kni/main.c\n@@ -37,6 +37,7 @@\n #include <rte_ethdev.h>\n #include <rte_mempool.h>\n #include <rte_mbuf.h>\n+#include <rte_mbuf_pool_ops.h>\n #include <rte_string_fns.h>\n #include <rte_cycles.h>\n #include <rte_malloc.h>\n@@ -945,6 +946,56 @@ kni_free_kni(uint16_t port_id)\n \treturn 0;\n }\n \n+static struct rte_mempool *\n+kni_packet_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,\n+\t\t MEMPOOL_F_NO_PAGE_BOUND);\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+\tret = rte_mempool_populate_default(mp);\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 /* Initialise ports/queues etc. and start main loop on each core */\n int\n main(int argc, char** argv)\n@@ -975,7 +1026,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 = kni_packet_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\");\ndiff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c\nindex 3e1d6eb..d143c49 100644\n--- a/lib/librte_eal/linux/eal/eal.c\n+++ b/lib/librte_eal/linux/eal/eal.c\n@@ -1041,14 +1041,6 @@ rte_eal_init(int argc, char **argv)\n \t\trte_eal_get_configuration()->iova_mode =\n \t\t\trte_bus_get_iommu_class();\n \n-\t\t/* Workaround for KNI which requires physical address to work */\n-\t\tif (rte_eal_get_configuration()->iova_mode == RTE_IOVA_VA &&\n-\t\t\t\trte_eal_check_module(\"rte_kni\") == 1) {\n-\t\t\trte_eal_get_configuration()->iova_mode = RTE_IOVA_PA;\n-\t\t\tRTE_LOG(WARNING, EAL,\n-\t\t\t\t\"Some devices want IOVA as VA but PA will be used because.. \"\n-\t\t\t\t\"KNI module inserted\\n\");\n-\t\t}\n \t} else {\n \t\trte_eal_get_configuration()->iova_mode =\n \t\t\tinternal_config.iova_mode;\ndiff --git a/lib/librte_eal/linux/eal/include/rte_kni_common.h b/lib/librte_eal/linux/eal/include/rte_kni_common.h\nindex 5db5a13..404c85d 100644\n--- a/lib/librte_eal/linux/eal/include/rte_kni_common.h\n+++ b/lib/librte_eal/linux/eal/include/rte_kni_common.h\n@@ -128,6 +128,7 @@ struct rte_kni_device_info {\n \tunsigned mbuf_size;\n \tunsigned int mtu;\n \tuint8_t mac_addr[6];\n+\tuint8_t iova_mode;\n };\n \n #define KNI_DEVICE \"kni\"\ndiff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c\nindex 99c4bf5..4263f21 100644\n--- a/lib/librte_kni/rte_kni.c\n+++ b/lib/librte_kni/rte_kni.c\n@@ -300,6 +300,8 @@ rte_kni_alloc(struct rte_mempool *pktmbuf_pool,\n \tkni->group_id = conf->group_id;\n \tkni->mbuf_size = conf->mbuf_size;\n \n+\tdev_info.iova_mode = (rte_eal_iova_mode() == RTE_IOVA_VA) ? 1 : 0;\n+\n \tret = ioctl(kni_fd, RTE_KNI_IOCTL_CREATE, &dev_info);\n \tif (ret < 0)\n \t\tgoto ioctl_fail;\n",
    "prefixes": [
        "v6",
        "3/4"
    ]
}