get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 57223,
    "url": "http://patches.dpdk.org/api/patches/57223/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190729121313.30639-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": "<20190729121313.30639-3-vattunuru@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190729121313.30639-3-vattunuru@marvell.com",
    "date": "2019-07-29T12:13:10",
    "name": "[v9,2/5] kni: add IOVA=VA support in KNI lib",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c413c1ceb5679030a6aa6548756b23b2c93e0a53",
    "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/20190729121313.30639-3-vattunuru@marvell.com/mbox/",
    "series": [
        {
            "id": 5808,
            "url": "http://patches.dpdk.org/api/series/5808/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5808",
            "date": "2019-07-29T12:13:08",
            "name": "kni: add IOVA=VA support",
            "version": 9,
            "mbox": "http://patches.dpdk.org/series/5808/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/57223/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/57223/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 7D1191BF58;\n\tMon, 29 Jul 2019 14:13:44 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n\t[67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 6734A1BF58\n\tfor <dev@dpdk.org>; Mon, 29 Jul 2019 14:13:39 +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\tx6TCAOIH027444; Mon, 29 Jul 2019 05:13:36 -0700",
            "from sc-exch02.marvell.com ([199.233.58.182])\n\tby mx0a-0016f401.pphosted.com with ESMTP id 2u0kyq017h-2\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tMon, 29 Jul 2019 05:13:36 -0700",
            "from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com\n\t(10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tMon, 29 Jul 2019 05:13:35 -0700",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com\n\t(10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Mon, 29 Jul 2019 05:13:35 -0700",
            "from hyd1vattunuru-dt.caveonetworks.com (unknown [10.29.52.72])\n\tby maili.marvell.com (Postfix) with ESMTP id E3D5F3F704D;\n\tMon, 29 Jul 2019 05:13:32 -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=qJN1nrYJIHYpBBwdx25T0sJWazuYXaXe7jthBhhGULk=; \n\tb=QQj+YQ3oJcbD2UhVipB5v+fYGxgWIdFSQzllWSg6K8+xO8vGLgfHcIaJvrFuAZf6g6sP\n\tw22jKOeanDHFD748wMx9PzNqrg9seTsE5uoeItPSXa6PxsJlLSsNb7MCyOqcnNvHqvvk\n\tdRa9KhBWGU4+o5GG/o0X05J3JoXnZX1qIEIX0LpJpXTrdKD5wRMe0BjmlFW7lejNT2io\n\tsvq0EVLLgoSUu+aM9ypmcklGGtGbmlfC+qBjR+4evRqWwwq5v6jZh1tc36DTBLuxKhDp\n\tNZ7hmQZxC6tXnPcVPeDODbmdMUFKeyIltS3S5DDvzLxj8gXmv7x6szE9YFo+KCZFXAVW\n\t0g== ",
        "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:10 +0530",
        "Message-ID": "<20190729121313.30639-3-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 2/5] kni: add IOVA=VA support in KNI lib",
        "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 only operates in IOVA=PA mode, patch adds\nrequired functionality in KNI lib to support IOVA=VA mode.\n\nKNI kernel module requires device info to get iommu domain related\ninformation for IOVA addr related translations. Patch defines device\nrelated info in rte_kni_device_info structure and passes device info\nto the kernel KNI module when IOVA=VA mode is enabled.\n\nSigned-off-by: Vamsi Attunuru <vattunuru@marvell.com>\nSigned-off-by: Kiran Kumar K <kirankumark@marvell.com>\n---\n lib/librte_eal/linux/eal/include/rte_kni_common.h |  8 ++++++\n lib/librte_kni/Makefile                           |  1 +\n lib/librte_kni/meson.build                        |  1 +\n lib/librte_kni/rte_kni.c                          | 30 +++++++++++++++++++++++\n 4 files changed, 40 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/linux/eal/include/rte_kni_common.h b/lib/librte_eal/linux/eal/include/rte_kni_common.h\nindex 37d9ee8..4fd8a90 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@@ -111,6 +111,13 @@ struct rte_kni_device_info {\n \tvoid * mbuf_va;\n \tphys_addr_t mbuf_phys;\n \n+\t/* PCI info */\n+\tuint16_t vendor_id;           /**< Vendor ID or PCI_ANY_ID. */\n+\tuint16_t device_id;           /**< Device ID or PCI_ANY_ID. */\n+\tuint8_t bus;                  /**< Device bus */\n+\tuint8_t devid;                /**< Device ID */\n+\tuint8_t function;             /**< Device function. */\n+\n \tuint16_t group_id;            /**< Group ID */\n \tuint32_t core_id;             /**< core ID to bind for kernel thread */\n \n@@ -121,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/Makefile b/lib/librte_kni/Makefile\nindex cbd6599..ab15d10 100644\n--- a/lib/librte_kni/Makefile\n+++ b/lib/librte_kni/Makefile\n@@ -7,6 +7,7 @@ include $(RTE_SDK)/mk/rte.vars.mk\n LIB = librte_kni.a\n \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\n \n EXPORT_MAP := rte_kni_version.map\ndiff --git a/lib/librte_kni/meson.build b/lib/librte_kni/meson.build\nindex 41fa2e3..fd46f87 100644\n--- a/lib/librte_kni/meson.build\n+++ b/lib/librte_kni/meson.build\n@@ -9,3 +9,4 @@ version = 2\n sources = files('rte_kni.c')\n headers = files('rte_kni.h')\n deps += ['ethdev', 'pci']\n+includes += include_directories('../../drivers/bus/pci')\ndiff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c\nindex 4b51fb4..2aaaeaa 100644\n--- a/lib/librte_kni/rte_kni.c\n+++ b/lib/librte_kni/rte_kni.c\n@@ -14,6 +14,7 @@\n #include <rte_spinlock.h>\n #include <rte_string_fns.h>\n #include <rte_ethdev.h>\n+#include <rte_bus_pci.h>\n #include <rte_malloc.h>\n #include <rte_log.h>\n #include <rte_kni.h>\n@@ -199,6 +200,27 @@ kni_release_mz(struct rte_kni *kni)\n \trte_memzone_free(kni->m_sync_addr);\n }\n \n+static void\n+kni_dev_pci_addr_get(uint16_t port_id, struct rte_kni_device_info *kni_dev_info)\n+{\n+\tconst struct rte_pci_device *pci_dev;\n+\tstruct rte_eth_dev_info dev_info;\n+\tconst struct rte_bus *bus = NULL;\n+\n+\trte_eth_dev_info_get(port_id, &dev_info);\n+\n+\tif (dev_info.device)\n+\t\tbus = rte_bus_find_by_device(dev_info.device);\n+\tif (bus && !strcmp(bus->name, \"pci\")) {\n+\t\tpci_dev = RTE_DEV_TO_PCI(dev_info.device);\n+\t\tkni_dev_info->bus = pci_dev->addr.bus;\n+\t\tkni_dev_info->devid = pci_dev->addr.devid;\n+\t\tkni_dev_info->function = pci_dev->addr.function;\n+\t\tkni_dev_info->vendor_id = pci_dev->id.vendor_id;\n+\t\tkni_dev_info->device_id = pci_dev->id.device_id;\n+\t}\n+}\n+\n struct rte_kni *\n rte_kni_alloc(struct rte_mempool *pktmbuf_pool,\n \t      const struct rte_kni_conf *conf,\n@@ -247,6 +269,12 @@ rte_kni_alloc(struct rte_mempool *pktmbuf_pool,\n \t\tkni->ops.port_id = UINT16_MAX;\n \n \tmemset(&dev_info, 0, sizeof(dev_info));\n+\n+\tif (rte_eal_iova_mode() == RTE_IOVA_VA) {\n+\t\tuint16_t port_id = conf->group_id;\n+\n+\t\tkni_dev_pci_addr_get(port_id, &dev_info);\n+\t}\n \tdev_info.core_id = conf->core_id;\n \tdev_info.force_bind = conf->force_bind;\n \tdev_info.group_id = conf->group_id;\n@@ -300,6 +328,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": [
        "v9",
        "2/5"
    ]
}