get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 63038,
    "url": "http://patches.dpdk.org/api/patches/63038/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191115111807.20935-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": "<20191115111807.20935-3-vattunuru@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191115111807.20935-3-vattunuru@marvell.com",
    "date": "2019-11-15T11:18:07",
    "name": "[v13,2/2] kni: support IOVA mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "caa9d88ab431a67ca0c1db778c61d75d68571790",
    "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/20191115111807.20935-3-vattunuru@marvell.com/mbox/",
    "series": [
        {
            "id": 7472,
            "url": "http://patches.dpdk.org/api/series/7472/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7472",
            "date": "2019-11-15T11:18:05",
            "name": "kni: support IOVA mode",
            "version": 13,
            "mbox": "http://patches.dpdk.org/series/7472/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/63038/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/63038/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 A998FA04CA;\n\tFri, 15 Nov 2019 12:19:11 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 80F91374E;\n\tFri, 15 Nov 2019 12:19:11 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id A788B2C12\n for <dev@dpdk.org>; Fri, 15 Nov 2019 12:19:09 +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 xAFBFfAt013525; Fri, 15 Nov 2019 03:19:09 -0800",
            "from sc-exch02.marvell.com ([199.233.58.182])\n by mx0b-0016f401.pphosted.com with ESMTP id 2w8whqygss-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Fri, 15 Nov 2019 03:19:08 -0800",
            "from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com\n (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 15 Nov\n 2019 03:19:06 -0800",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com\n (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n Transport; Fri, 15 Nov 2019 03:19:06 -0800",
            "from hyd1vattunuru-dt.caveonetworks.com (unknown [10.29.52.72])\n by maili.marvell.com (Postfix) with ESMTP id 7454A3F704C;\n Fri, 15 Nov 2019 03:19:02 -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=RbOTmXnLBFkml6s01MvBqBImjxFeKuF+TaTYW3qfa9g=;\n b=XLlwcMz0TFEiGYskEgZM+yl+Hv8zTTpWrIZVQM2TRlkOzcmPLajRyNW2pMaIenCLI0ZF\n jO+f2KY8tu0vA3zX/ucNBZcB0fiJmjlxhty1l8gJ4W8FxxPIRo8K8DBE3EfayaLY578F\n 3be1c41ER1AdHQim+k5uzmpQg6OVZHcGa+MHJklUx8r5Veoo5krfPuRpe9u5IQY5B2ow\n K0x3bszfRewarCwDP3Tp3j21nXVaAmRPaKxtqRzGHmm7jFem/SxSlEtWDnNGpwXI9J+i\n eSI/x8em0OpgR6NFm6FwkbyIBhxQygWd7P93JcJ6l/IDl/htb4reAnDWUcwNE6VvDoKH 5g==",
        "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 16:48:07 +0530",
        "Message-ID": "<20191115111807.20935-3-vattunuru@marvell.com>",
        "X-Mailer": "git-send-email 2.8.4",
        "In-Reply-To": "<20191115111807.20935-1-vattunuru@marvell.com>",
        "References": "<20191105110416.8955-1-vattunuru@marvell.com>\n <20191115111807.20935-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_03:2019-11-15,2019-11-15 signatures=0",
        "Subject": "[dpdk-dev]  [PATCH v13 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: Vamsi Attunuru <vattunuru@marvell.com>\n\nCurrent KNI implementation only operates in IOVA_PA mode\npatch adds required functionality to enable KNI in\nIOVA_VA mode.\n\nKNI loopback mode tests will have performance impact in\nthis mode due to IOVA to KVA address translations.\nHowever, In KNI real world use cases, the performace\nimpact will be based on Linux kernel stack and scheduler\nlatencies. Performance varies based on the KNI use case.\nIf bus iommu scheme is IOVA_DC and KNI module is loaded,\nDPDK chooses IOVA as PA as existing behaviour.\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: Vamsi Attunuru <vattunuru@marvell.com>\nSigned-off-by: Kiran Kumar K <kirankumark@marvell.com>\nSuggested-by: Ferruh Yigit <ferruh.yigit@intel.com>\n---\n doc/guides/prog_guide/kernel_nic_interface.rst | 15 +++++++++++++++\n doc/guides/rel_notes/release_19_11.rst         | 15 ++++++++++++++-\n lib/librte_eal/linux/eal/eal.c                 | 23 ++++++++++++++++-------\n lib/librte_kni/rte_kni.c                       |  6 ++++++\n 4 files changed, 51 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/doc/guides/prog_guide/kernel_nic_interface.rst b/doc/guides/prog_guide/kernel_nic_interface.rst\nindex 2fd58e1..3bed18f 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,21 @@ 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+KNI loopback mode tests will have performance impact in this mode due to IOVA to\n+KVA address translations. However, In KNI real world use cases, the performace\n+impact will be based on Linux kernel stack and scheduler latencies. Performance\n+varies based on the KNI use case. If bus iommu scheme is IOVA_DC and KNI module\n+is loaded, DPDK chooses IOVA as PA as existing behaviour.\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..c207c93 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,21 @@ 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+  * KNI loopback mode tests will have performance impact in this mode due\n+    to IOVA to KVA address translations. However, In KNI real world use cases,\n+    the performace impact will be based on Linux kernel stack and scheduler\n+    latencies. Performance varies based on the KNI use case. If bus iommu\n+    scheme is IOVA_DC and KNI module is loaded, DPDK chooses IOVA as PA as\n+    existing behaviour.\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..53ca84b 100644\n--- a/lib/librte_eal/linux/eal/eal.c\n+++ b/lib/librte_eal/linux/eal/eal.c\n@@ -1086,14 +1086,23 @@ rte_eal_init(int argc, char **argv)\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-\t\tif (iova_mode == RTE_IOVA_VA &&\n-\t\t\t\trte_eal_check_module(\"rte_kni\") == 1) {\n-\t\t\tif (phys_addrs) {\n+\t\tif (rte_eal_check_module(\"rte_kni\") == 1) {\n+#if KERNEL_VERSION(4, 6, 0) > LINUX_VERSION_CODE\n+\t\t\tif (iova_mode == RTE_IOVA_VA) {\n \t\t\t\tiova_mode = RTE_IOVA_PA;\n-\t\t\t\tRTE_LOG(WARNING, EAL, \"Forcing IOVA as 'PA' because KNI module is loaded\\n\");\n-\t\t\t} else {\n-\t\t\t\tRTE_LOG(DEBUG, EAL, \"KNI can not work since physical addresses are unavailable\\n\");\n+\t\t\t\tRTE_LOG(WARNING, EAL, \"Forcing IOVA as 'PA' because \"\n+\t\t\t\t\t\t\"Kernel version supports only 'PA' mode for KNI module\\n\");\n+\t\t\t}\n+#endif\n+\t\t\tif (rte_bus_get_iommu_class() == RTE_IOVA_DC)\n+\t\t\t\tiova_mode = RTE_IOVA_PA;\n+\n+\t\t\tif (iova_mode == RTE_IOVA_PA) {\n+\t\t\t\tif (phys_addrs && is_iommu_enabled())\n+\t\t\t\t\tRTE_LOG(WARNING, EAL, \"Forced IOVA as 'PA' because KNI module is loaded\\n\");\n+\n+\t\t\t\tif (!phys_addrs)\n+\t\t\t\t\tRTE_LOG(DEBUG, EAL, \"KNI can not work since physical addresses are unavailable\\n\");\n \t\t\t}\n \t\t}\n #endif\ndiff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c\nindex 7fbcf22..a609d2f 100644\n--- a/lib/librte_kni/rte_kni.c\n+++ b/lib/librte_kni/rte_kni.c\n@@ -6,6 +6,8 @@\n #error \"KNI is not supported\"\n #endif\n \n+#include <linux/version.h>\n+\n #include <string.h>\n #include <fcntl.h>\n #include <unistd.h>\n@@ -97,10 +99,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 +306,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": [
        "v13",
        "2/2"
    ]
}