get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 34922,
    "url": "http://patches.dpdk.org/api/patches/34922/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180204145542.38345-2-xiao.w.wang@intel.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": "<20180204145542.38345-2-xiao.w.wang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180204145542.38345-2-xiao.w.wang@intel.com",
    "date": "2018-02-04T14:55:40",
    "name": "[dpdk-dev,1/3] bus/pci: expose API for vDPA",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "17ff50f1dbaf4a9514a449d1c37ebe4266099cfc",
    "submitter": {
        "id": 281,
        "url": "http://patches.dpdk.org/api/people/281/?format=api",
        "name": "Xiao Wang",
        "email": "xiao.w.wang@intel.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20180204145542.38345-2-xiao.w.wang@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/34922/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/34922/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 7387B1B1BF;\n\tSun,  4 Feb 2018 15:56:49 +0100 (CET)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 118B71B1B6\n\tfor <dev@dpdk.org>; Sun,  4 Feb 2018 15:56:47 +0100 (CET)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t04 Feb 2018 06:56:45 -0800",
            "from dpdk-xiao-1.sh.intel.com ([10.67.110.153])\n\tby orsmga001.jf.intel.com with ESMTP; 04 Feb 2018 06:56:44 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.46,458,1511856000\"; d=\"scan'208\";a=\"28692305\"",
        "From": "Xiao Wang <xiao.w.wang@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "jianfeng.tan@intel.com, tiwei.bie@intel.com, maxime.coquelin@redhat.com, \n\tyliu@fridaylinux.org, cunming.liang@intel.com, dan.daly@intel.com,\n\tzhihong.wang@intel.com, Xiao Wang <xiao.w.wang@intel.com>",
        "Date": "Sun,  4 Feb 2018 22:55:40 +0800",
        "Message-Id": "<20180204145542.38345-2-xiao.w.wang@intel.com>",
        "X-Mailer": "git-send-email 2.15.1",
        "In-Reply-To": "<20180204145542.38345-1-xiao.w.wang@intel.com>",
        "References": "<20180204145542.38345-1-xiao.w.wang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 1/3] bus/pci: expose API for vDPA",
        "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://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Some existing PCI APIs are helpful for vDPA device setup, expose them\nfor the later driver patch.\n\nSigned-off-by: Xiao Wang <xiao.w.wang@intel.com>\n---\n drivers/bus/pci/Makefile                |  1 +\n drivers/bus/pci/linux/pci.c             | 10 +++-------\n drivers/bus/pci/linux/pci_init.h        | 22 +++++++++++++++++++++-\n drivers/bus/pci/linux/pci_vfio.c        |  5 ++---\n drivers/bus/pci/rte_bus_pci_version.map | 13 +++++++++++++\n 5 files changed, 40 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/drivers/bus/pci/Makefile b/drivers/bus/pci/Makefile\nindex f3df1c4ce..e45bee024 100644\n--- a/drivers/bus/pci/Makefile\n+++ b/drivers/bus/pci/Makefile\n@@ -45,6 +45,7 @@ ifneq ($(CONFIG_RTE_EXEC_ENV_BSDAPP),)\n SYSTEM := bsd\n endif\n \n+CFLAGS += -DALLOW_EXPERIMENTAL_API\n CFLAGS += -I$(RTE_SDK)/drivers/bus/pci/$(SYSTEM)\n CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common\n CFLAGS += -I$(RTE_SDK)/lib/librte_eal/$(SYSTEM)app/eal\ndiff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c\nindex abde64119..06b811d5e 100644\n--- a/drivers/bus/pci/linux/pci.c\n+++ b/drivers/bus/pci/linux/pci.c\n@@ -32,7 +32,7 @@\n \n extern struct rte_pci_bus rte_pci_bus;\n \n-static int\n+int\n pci_get_kernel_driver_by_path(const char *filename, char *dri_name)\n {\n \tint count;\n@@ -168,8 +168,7 @@ pci_parse_one_sysfs_resource(char *line, size_t len, uint64_t *phys_addr,\n \treturn 0;\n }\n \n-/* parse the \"resource\" sysfs file */\n-static int\n+int\n pci_parse_sysfs_resource(const char *filename, struct rte_pci_device *dev)\n {\n \tFILE *f;\n@@ -372,10 +371,7 @@ pci_update_device(const struct rte_pci_addr *addr)\n \treturn pci_scan_one(filename, addr);\n }\n \n-/*\n- * split up a pci address into its constituent parts.\n- */\n-static int\n+int\n parse_pci_addr_format(const char *buf, int bufsize, struct rte_pci_addr *addr)\n {\n \t/* first split on ':' */\ndiff --git a/drivers/bus/pci/linux/pci_init.h b/drivers/bus/pci/linux/pci_init.h\nindex c2e603a37..9e06cb57d 100644\n--- a/drivers/bus/pci/linux/pci_init.h\n+++ b/drivers/bus/pci/linux/pci_init.h\n@@ -6,6 +6,7 @@\n #define EAL_PCI_INIT_H_\n \n #include <rte_vfio.h>\n+#include <stdbool.h>\n \n /** IO resource type: */\n #define IORESOURCE_IO         0x00000100\n@@ -15,7 +16,7 @@\n  * Helper function to map PCI resources right after hugepages in virtual memory\n  */\n extern void *pci_map_addr;\n-void *pci_find_max_end_va(void);\n+void *__rte_experimental pci_find_max_end_va(void);\n \n /* parse one line of the \"resource\" sysfs file (note that the 'line'\n  * string is modified)\n@@ -83,6 +84,25 @@ int pci_vfio_unmap_resource(struct rte_pci_device *dev);\n \n int pci_vfio_is_enabled(void);\n \n+/* parse sysfs file path */\n+int __rte_experimental\n+pci_get_kernel_driver_by_path(const char *filename, char *dri_name);\n+\n+/* parse the \"resource\" sysfs file */\n+int __rte_experimental\n+pci_parse_sysfs_resource(const char *filename, struct rte_pci_device *dev);\n+\n+/* split up a pci address into its constituent parts */\n+int __rte_experimental\n+parse_pci_addr_format(const char *buf, int bufsize, struct rte_pci_addr *addr);\n+\n+/* get PCI BAR info for MSI-X interrupts */\n+int __rte_experimental\n+pci_vfio_get_msix_bar(int fd, struct pci_msix_table *msix_table);\n+\n+/* enable DMA and reset device */\n+int __rte_experimental\n+pci_rte_vfio_setup_device(struct rte_pci_device *dev, int vfio_dev_fd);\n #endif\n \n #endif /* EAL_PCI_INIT_H_ */\ndiff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c\nindex aeeaa9ed8..6d0486a7d 100644\n--- a/drivers/bus/pci/linux/pci_vfio.c\n+++ b/drivers/bus/pci/linux/pci_vfio.c\n@@ -59,8 +59,7 @@ pci_vfio_write_config(const struct rte_intr_handle *intr_handle,\n \t       VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) + offs);\n }\n \n-/* get PCI BAR number where MSI-X interrupts are */\n-static int\n+int\n pci_vfio_get_msix_bar(int fd, struct pci_msix_table *msix_table)\n {\n \tint ret;\n@@ -295,7 +294,7 @@ pci_vfio_is_ioport_bar(int vfio_dev_fd, int bar_index)\n \treturn (ioport_bar & PCI_BASE_ADDRESS_SPACE_IO) != 0;\n }\n \n-static int\n+int\n pci_rte_vfio_setup_device(struct rte_pci_device *dev, int vfio_dev_fd)\n {\n \tif (pci_vfio_setup_interrupts(dev, vfio_dev_fd) != 0) {\ndiff --git a/drivers/bus/pci/rte_bus_pci_version.map b/drivers/bus/pci/rte_bus_pci_version.map\nindex 27e9c4f10..fd806ad33 100644\n--- a/drivers/bus/pci/rte_bus_pci_version.map\n+++ b/drivers/bus/pci/rte_bus_pci_version.map\n@@ -16,3 +16,16 @@ DPDK_17.11 {\n \n \tlocal: *;\n };\n+\n+EXPERIMENTAL {\n+\tglobal:\n+\n+\tpci_map_addr;\n+\tpci_find_max_end_va;\n+\tpci_get_kernel_driver_by_path;\n+\tpci_parse_sysfs_resource;\n+\tpci_vfio_get_msix_bar;\n+\tpci_rte_vfio_setup_device;\n+\tparse_pci_addr_format;\n+\n+} DPDK_17.11;\n",
    "prefixes": [
        "dpdk-dev",
        "1/3"
    ]
}