get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 63050,
    "url": "http://patches.dpdk.org/api/patches/63050/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191115170752.9488-3-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": "<20191115170752.9488-3-vattunuru@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191115170752.9488-3-vattunuru@marvell.com",
    "date": "2019-11-15T17:07:52",
    "name": "[v14,2/2] kni: support IOVA mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9cb527751622d179324c62f356524feecc4d04ad",
    "submitter": {
        "id": 1277,
        "url": "http://patches.dpdk.org/api/people/1277/?format=api",
        "name": "Vamsi Krishna Attunuru",
        "email": "vattunuru@marvell.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20191115170752.9488-3-vattunuru@marvell.com/mbox/",
    "series": [
        {
            "id": 7480,
            "url": "http://patches.dpdk.org/api/series/7480/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7480",
            "date": "2019-11-15T17:07:50",
            "name": "kni: support IOVA mode",
            "version": 14,
            "mbox": "http://patches.dpdk.org/series/7480/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/63050/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/63050/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id DA724A04CC;\n\tFri, 15 Nov 2019 18:08:27 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id A089D37AF;\n\tFri, 15 Nov 2019 18:08:27 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 1F971316B\n for <dev@dpdk.org>; Fri, 15 Nov 2019 18:08:26 +0100 (CET)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n xAFH5xqU004572; Fri, 15 Nov 2019 09:08:25 -0800",
            "from sc-exch04.marvell.com ([199.233.58.184])\n by mx0b-0016f401.pphosted.com with ESMTP id 2w8whr0ubr-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Fri, 15 Nov 2019 09:08:25 -0800",
            "from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com\n (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 15 Nov\n 2019 09:08:23 -0800",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com\n (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n Transport; Fri, 15 Nov 2019 09:08:23 -0800",
            "from hyd1vattunuru-dt.caveonetworks.com (unknown [10.29.52.72])\n by maili.marvell.com (Postfix) with ESMTP id B644F3F703F;\n Fri, 15 Nov 2019 09:08:19 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-type; s=pfpt0818; bh=e0w4dzRKgC208hiG857d7u0NYpn2cQWA1+WmTzhUK/8=;\n b=K4j2smGQxalK+ol7F6hypeRb15/Lyrogrzz8YKiV1Z32jbbVchD6NpvAvKlzYDZUaI9P\n Th0G+yKBCZssU3WMt5vYocK5Aym4W90rG3R/CvJCWYhz28iMVe4TZafZd3aqotHPtmlj\n wnUXnlaMrTGxecsGeAShmsTjSB18Ek8tM6CWrFKOn7sk3tedQWjWmvyP+JUQwrYVRN8L\n hWYHyhht0DMd/EGblSwoUmaVJ6p1So0KAeA0SDLnyw4iCVOLAM8R2rK2zUrYjWzP+ASw\n 9vcnxfAzpffDp+zu9VIpMB9Ephd0RZecYTpc9Jjfra6jIqdIf6mguEFDiPvjhUqDPBUL 9g==",
        "From": "<vattunuru@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<thomas@monjalon.net>, <jerinj@marvell.com>, <kirankumark@marvell.com>,\n <olivier.matz@6wind.com>, <ferruh.yigit@intel.com>,\n <anatoly.burakov@intel.com>, <arybchenko@solarflare.com>,\n <stephen@networkplumber.org>, <david.marchand@redhat.com>, Vamsi Attunuru\n <vattunuru@marvell.com>",
        "Date": "Fri, 15 Nov 2019 22:37:52 +0530",
        "Message-ID": "<20191115170752.9488-3-vattunuru@marvell.com>",
        "X-Mailer": "git-send-email 2.8.4",
        "In-Reply-To": "<20191115170752.9488-1-vattunuru@marvell.com>",
        "References": "<20191115111807.20935-1-vattunuru@marvell.com>\n <20191115170752.9488-1-vattunuru@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.95,18.0.572\n definitions=2019-11-15_05:2019-11-15,2019-11-15 signatures=0",
        "Subject": "[dpdk-dev]  [PATCH v14 2/2] kni: support IOVA mode",
        "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: David Marchand <david.marchand@redhat.com>\n\nCurrent KNI implementation only operates in IOVA_PA mode\npatch adds required functionality to enable KNI in\nIOVA_VA mode.\n\nDue to IOVA to KVA address translations, based on the KNI\nuse case there can be a performance impact.\n\nTo mitigate the impact on performance,forcing IOVA to PA\nvia eal \"--iova-mode=pa\" option can be used, IOVA_DC bus\niommu scheme can also result in IOVA as PA.\n\nDuring KNI creation, app's iova_mode details are passed to\nthe KNI kernel module, accordingly kernel module translates\nPA/IOVA addresses to KVA and vice-versa.\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\nSigned-off-by: Vamsi Attunuru <vattunuru@marvell.com>\nSigned-off-by: Kiran Kumar K <kirankumark@marvell.com>\n---\n doc/guides/prog_guide/kernel_nic_interface.rst | 14 ++++++++++++++\n doc/guides/rel_notes/release_19_11.rst         | 13 ++++++++++++-\n lib/librte_eal/linux/eal/eal.c                 | 11 +++++++++--\n lib/librte_kni/rte_kni.c                       |  5 +++++\n 4 files changed, 40 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/doc/guides/prog_guide/kernel_nic_interface.rst b/doc/guides/prog_guide/kernel_nic_interface.rst\nindex 2fd58e1..e688efc 100644\n--- a/doc/guides/prog_guide/kernel_nic_interface.rst\n+++ b/doc/guides/prog_guide/kernel_nic_interface.rst\n@@ -300,6 +300,20 @@ The sk_buff is then freed and the mbuf sent in the tx_q FIFO.\n The DPDK TX thread dequeues the mbuf and sends it to the PMD via ``rte_eth_tx_burst()``.\n It then puts the mbuf back in the cache.\n \n+IOVA = VA: Support\n+------------------\n+\n+KNI operates in IOVA_VA scheme when\n+\n+- LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) and\n+- eal option `iova-mode=va` is passed or bus IOVA scheme in the DPDK is selected\n+  as RTE_IOVA_VA.\n+\n+Due to IOVA to KVA address translations, based on the KNI use case there\n+can be a performance impact. For mitigation, forcing IOVA to PA via eal\n+\"--iova-mode=pa\" option can be used, IOVA_DC bus iommu scheme can also\n+result in IOVA as PA.\n+\n Ethtool\n -------\n \ndiff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst\nindex 682c1bd..bed3344 100644\n--- a/doc/guides/rel_notes/release_19_11.rst\n+++ b/doc/guides/rel_notes/release_19_11.rst\n@@ -292,8 +292,19 @@ New Features\n   compilers store their internal representation of the source code that\n   the linker uses at the final stage of compilation process.\n \n-  See :doc:`../prog_guide/lto` for more information:\n+* **Added IOVA as VA support for KNI.**\n+\n+  * Added IOVA = VA support for KNI, KNI can operate in IOVA = VA mode when\n+    `iova-mode=va` eal option is passed to the application or when bus IOVA\n+    scheme is selected as RTE_IOVA_VA. This mode only works on Linux Kernel\n+    versions 4.6.0 and above.\n \n+  * Due to IOVA to KVA address translations, based on the KNI use case there\n+    can be a performance impact. For mitigation, forcing IOVA to PA via eal\n+    \"--iova-mode=pa\" option can be used, IOVA_DC bus iommu scheme can also\n+    result in IOVA as PA.\n+\n+  See :doc:`../prog_guide/lto` for more information:\n \n \n Removed Items\ndiff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c\nindex 9e2d50c..b5b7150 100644\n--- a/lib/librte_eal/linux/eal/eal.c\n+++ b/lib/librte_eal/linux/eal/eal.c\n@@ -1073,6 +1073,11 @@ rte_eal_init(int argc, char **argv)\n \t\t\t\t */\n \t\t\t\tiova_mode = RTE_IOVA_VA;\n \t\t\t\tRTE_LOG(DEBUG, EAL, \"Physical addresses are unavailable, selecting IOVA as VA mode.\\n\");\n+#if defined(RTE_LIBRTE_KNI) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)\n+\t\t\t} else if (rte_eal_check_module(\"rte_kni\") == 1) {\n+\t\t\t\tiova_mode = RTE_IOVA_PA;\n+\t\t\t\tRTE_LOG(DEBUG, EAL, \"KNI is loaded, selecting IOVA as PA mode for better KNI perfomance.\\n\");\n+#endif\n \t\t\t} else if (is_iommu_enabled()) {\n \t\t\t\t/* we have an IOMMU, pick IOVA as VA mode */\n \t\t\t\tiova_mode = RTE_IOVA_VA;\n@@ -1085,8 +1090,10 @@ rte_eal_init(int argc, char **argv)\n \t\t\t\tRTE_LOG(DEBUG, EAL, \"IOMMU is not available, selecting IOVA as PA mode.\\n\");\n \t\t\t}\n \t\t}\n-#ifdef RTE_LIBRTE_KNI\n-\t\t/* Workaround for KNI which requires physical address to work */\n+#if defined(RTE_LIBRTE_KNI) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)\n+\t\t/* Workaround for KNI which requires physical address to work\n+\t\t * in kernels < 4.6\n+\t\t */\n \t\tif (iova_mode == RTE_IOVA_VA &&\n \t\t\t\trte_eal_check_module(\"rte_kni\") == 1) {\n \t\t\tif (phys_addrs) {\ndiff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c\nindex 7fbcf22..0507a48 100644\n--- a/lib/librte_kni/rte_kni.c\n+++ b/lib/librte_kni/rte_kni.c\n@@ -10,6 +10,7 @@\n #include <fcntl.h>\n #include <unistd.h>\n #include <sys/ioctl.h>\n+#include <linux/version.h>\n \n #include <rte_spinlock.h>\n #include <rte_string_fns.h>\n@@ -97,10 +98,12 @@ static volatile int kni_fd = -1;\n int\n rte_kni_init(unsigned int max_kni_ifaces __rte_unused)\n {\n+#if KERNEL_VERSION(4, 6, 0) > LINUX_VERSION_CODE\n \tif (rte_eal_iova_mode() != RTE_IOVA_PA) {\n \t\tRTE_LOG(ERR, KNI, \"KNI requires IOVA as PA\\n\");\n \t\treturn -1;\n \t}\n+#endif\n \n \t/* Check FD and open */\n \tif (kni_fd < 0) {\n@@ -302,6 +305,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": [
        "v14",
        "2/2"
    ]
}