get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 63065,
    "url": "http://patches.dpdk.org/api/patches/63065/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191117151244.3854-3-david.marchand@redhat.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": "<20191117151244.3854-3-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191117151244.3854-3-david.marchand@redhat.com",
    "date": "2019-11-17T15:12:44",
    "name": "[v15,2/2] eal/linux: remove KNI restriction on IOVA",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "667da91e045918fa82b6e3ba894f5b4576da9d02",
    "submitter": {
        "id": 1173,
        "url": "http://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.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/20191117151244.3854-3-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 7486,
            "url": "http://patches.dpdk.org/api/series/7486/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7486",
            "date": "2019-11-17T15:12:42",
            "name": "kni: support IOVA mode",
            "version": 15,
            "mbox": "http://patches.dpdk.org/series/7486/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/63065/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/63065/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 1A0E6A04B4;\n\tSun, 17 Nov 2019 16:13:23 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 1EC851B948;\n\tSun, 17 Nov 2019 16:13:09 +0100 (CET)",
            "from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81])\n by dpdk.org (Postfix) with ESMTP id 5C2FA5B3E\n for <dev@dpdk.org>; Sun, 17 Nov 2019 16:13:07 +0100 (CET)",
            "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-3-iOM5ZaVONiCChd2bIMJfqg-1; Sun, 17 Nov 2019 10:13:03 -0500",
            "from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com\n [10.5.11.11])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 63C1A801E5D;\n Sun, 17 Nov 2019 15:13:01 +0000 (UTC)",
            "from dmarchan.remote.csb (unknown [10.40.205.71])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 23F7C60171;\n Sun, 17 Nov 2019 15:12:58 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1574003586;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=DE3+/ZqHDSqHRqoaQu2vO7+cwb95SbnjWzoH/XLcFWE=;\n b=T1aFY3PRxtzdAx1EujqZ4bSp1gY+xamd41MwYt7rkGlpHRUwP9d4MmPriFj65NdY8OFfjl\n hXRgh6SzwFwKSGTm6+y/zs9FRWS0hlalk2yICO4vS/EIsmcBuHQSVm9Gd3t5KItZspOyG3\n ogbbThhvWYGyFAr7d4VMsBppS9iB0V8=",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, kirankumark@marvell.com, olivier.matz@6wind.com,\n ferruh.yigit@intel.com, anatoly.burakov@intel.com,\n arybchenko@solarflare.com, stephen@networkplumber.org,\n vattunuru@marvell.com",
        "Date": "Sun, 17 Nov 2019 16:12:44 +0100",
        "Message-Id": "<20191117151244.3854-3-david.marchand@redhat.com>",
        "In-Reply-To": "<20191117151244.3854-1-david.marchand@redhat.com>",
        "References": "<20191117151244.3854-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.11",
        "X-MC-Unique": "iOM5ZaVONiCChd2bIMJfqg-1",
        "X-Mimecast-Spam-Score": "0",
        "Content-Type": "text/plain; charset=US-ASCII",
        "Content-Transfer-Encoding": "quoted-printable",
        "Subject": "[dpdk-dev] [PATCH v15 2/2] eal/linux: remove KNI restriction on IOVA",
        "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\nNow that KNI supports VA (with kernel versions starting 4.6.0), we can\naccept IOVA as VA, but KNI must be configured for this.\nPass iova_mode when creating KNI netdevs.\n\nSo far, IOVA detection policy forced IOVA as PA when KNI is loaded,\nwhatever the buses IOVA requirements were.\n\nWe can now use IOVA as VA, but this comes with a cost in KNI.\nWhen no constraint is expressed by the buses, keep the current behavior\nof choosing PA.\n\nNote: this change supposes that dpdk is built on the same kernel than\nthe target system kernel; no objection has been expressed on this topic.\n\nSigned-off-by: Vamsi Attunuru <vattunuru@marvell.com>\nSigned-off-by: Kiran Kumar K <kirankumark@marvell.com>\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\nChangelog since v14:\n- reworded commitlog,\n- added note on kernel version check,\n- updated EAL documentation,\n- fixed broken LTO link in release note update,\n- s/eal/EAL/g,\n- inverted kernel version check in KNI,\n\n---\n doc/guides/prog_guide/env_abstraction_layer.rst |  3 +++\n doc/guides/prog_guide/kernel_nic_interface.rst  | 14 ++++++++++++++\n doc/guides/rel_notes/release_19_11.rst          | 11 +++++++++++\n lib/librte_eal/linux/eal/eal.c                  | 11 +++++++++--\n lib/librte_kni/rte_kni.c                        |  5 +++++\n 5 files changed, 42 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst\nindex cd8e3003e..6e7c2080a 100644\n--- a/doc/guides/prog_guide/env_abstraction_layer.rst\n+++ b/doc/guides/prog_guide/env_abstraction_layer.rst\n@@ -475,6 +475,9 @@ devices would fail anyway.\n     ``RTE_PCI_DRV_NEED_IOVA_AS_VA`` flag is used to dictate that this PCI\n     driver can only work in RTE_IOVA_VA mode.\n \n+    When the KNI kernel module is detected, RTE_IOVA_PA mode is preferred as a\n+    performance penalty is expected in RTE_IOVA_VA mode.\n+\n IOVA Mode Configuration\n ~~~~~~~~~~~~~~~~~~~~~~~\n \ndiff --git a/doc/guides/prog_guide/kernel_nic_interface.rst b/doc/guides/prog_guide/kernel_nic_interface.rst\nindex e12634ddc..c4479ffbf 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 c0045a91f..21be600ab 100644\n--- a/doc/guides/rel_notes/release_19_11.rst\n+++ b/doc/guides/rel_notes/release_19_11.rst\n@@ -294,6 +294,17 @@ New Features\n \n   See :doc:`../prog_guide/lto` for more information:\n \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 \n Removed Items\ndiff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/eal.c\nindex 9e2d50cfb..b5b71500c 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 7fbcf2201..86995fc81 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 LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)\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": [
        "v15",
        "2/2"
    ]
}