get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 12474,
    "url": "https://patches.dpdk.org/api/patches/12474/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1462531720-26217-10-git-send-email-viktorin@rehivetech.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1462531720-26217-10-git-send-email-viktorin@rehivetech.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1462531720-26217-10-git-send-email-viktorin@rehivetech.com",
    "date": "2016-05-06T10:48:39",
    "name": "[dpdk-dev,v1,09/10] app/test: scan PCI bus using a fake sysfs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "51c0cfa204a743cea9fc1f121dd0462b5490de9a",
    "submitter": {
        "id": 292,
        "url": "https://patches.dpdk.org/api/people/292/?format=api",
        "name": "Jan Viktorin",
        "email": "viktorin@rehivetech.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1462531720-26217-10-git-send-email-viktorin@rehivetech.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/12474/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/12474/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id D0E145A63;\n\tFri,  6 May 2016 12:50:58 +0200 (CEST)",
            "from wes1-so2.wedos.net (wes1-so2.wedos.net [46.28.106.16])\n\tby dpdk.org (Postfix) with ESMTP id 322DD5A13\n\tfor <dev@dpdk.org>; Fri,  6 May 2016 12:50:50 +0200 (CEST)",
            "from pcviktorin.fit.vutbr.cz (pcviktorin.fit.vutbr.cz\n\t[147.229.13.147])\n\tby wes1-so2.wedos.net (Postfix) with ESMTPSA id 3r1T8S3Q2cz2c6;\n\tFri,  6 May 2016 12:50:48 +0200 (CEST)"
        ],
        "From": "Jan Viktorin <viktorin@rehivetech.com>",
        "To": "dev@dpdk.org",
        "Cc": "Jan Viktorin <viktorin@rehivetech.com>,\n\tBruce Richardson <bruce.richardson@intel.com>,\n\tThomas Monjalon <thomas.monjalon@6wind.com>,\n\tDavid Marchand <david.marchand@6wind.com>",
        "Date": "Fri,  6 May 2016 12:48:39 +0200",
        "Message-Id": "<1462531720-26217-10-git-send-email-viktorin@rehivetech.com>",
        "X-Mailer": "git-send-email 2.8.0",
        "In-Reply-To": [
            "<1462531720-26217-1-git-send-email-viktorin@rehivetech.com>",
            "<1461935496-20367-1-git-send-email-viktorin@rehivetech.com>"
        ],
        "References": [
            "<1462531720-26217-1-git-send-email-viktorin@rehivetech.com>",
            "<1461935496-20367-1-git-send-email-viktorin@rehivetech.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v1 09/10] app/test: scan PCI bus using a fake\n\tsysfs",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://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": "<http://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": "Scan the PCI bus by providing a fake sysfs with a PCI device. The fake sysfs\nis a packed file hierarchy linked into the test.\n\nSigned-off-by: Jan Viktorin <viktorin@rehivetech.com>\n---\n app/test/Makefile                                  |   4 ++\n app/test/test_pci.c                                |  58 +++++++++++++++++++--\n .../bus/pci/devices/0000:01:00.0/class             |   1 +\n .../bus/pci/devices/0000:01:00.0/config            | Bin 0 -> 64 bytes\n .../devices/0000:01:00.0/consistent_dma_mask_bits  |   1 +\n .../bus/pci/devices/0000:01:00.0/device            |   1 +\n .../bus/pci/devices/0000:01:00.0/dma_mask_bits     |   1 +\n .../bus/pci/devices/0000:01:00.0/enable            |   1 +\n .../bus/pci/devices/0000:01:00.0/irq               |   1 +\n .../bus/pci/devices/0000:01:00.0/modalias          |   1 +\n .../bus/pci/devices/0000:01:00.0/msi_bus           |   1 +\n .../bus/pci/devices/0000:01:00.0/numa_node         |   1 +\n .../bus/pci/devices/0000:01:00.0/resource          |  13 +++++\n .../bus/pci/devices/0000:01:00.0/sriov_numvfs      |   1 +\n .../bus/pci/devices/0000:01:00.0/sriov_totalvfs    |   1 +\n .../bus/pci/devices/0000:01:00.0/subsystem_device  |   1 +\n .../bus/pci/devices/0000:01:00.0/subsystem_vendor  |   1 +\n .../bus/pci/devices/0000:01:00.0/uevent            |   6 +++\n .../bus/pci/devices/0000:01:00.0/vendor            |   1 +\n 19 files changed, 92 insertions(+), 3 deletions(-)\n create mode 100644 app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/class\n create mode 100644 app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/config\n create mode 100644 app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/consistent_dma_mask_bits\n create mode 100644 app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/device\n create mode 100644 app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/dma_mask_bits\n create mode 100644 app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/enable\n create mode 100644 app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/irq\n create mode 100644 app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/modalias\n create mode 100644 app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/msi_bus\n create mode 100644 app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/numa_node\n create mode 100644 app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/resource\n create mode 100644 app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/sriov_numvfs\n create mode 100644 app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/sriov_totalvfs\n create mode 100644 app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/subsystem_device\n create mode 100644 app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/subsystem_vendor\n create mode 100644 app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/uevent\n create mode 100644 app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/vendor",
    "diff": "diff --git a/app/test/Makefile b/app/test/Makefile\nindex 90acd63..6c3d8c2 100644\n--- a/app/test/Makefile\n+++ b/app/test/Makefile\n@@ -81,6 +81,10 @@ $(eval $(call resource,test_resource_tar,resource.tar))\n resource.tar: test_resource.c\n \ttar -C $(dir $<) -cf $@ $(notdir $<)\n SRCS-y += test_pci.c\n+$(eval $(call resource,test_pci_sysfs,test_pci_sysfs.tar))\n+test_pci_sysfs.tar: test_pci_sysfs\n+\ttar -C $(dir $<) -cf $@ $(notdir $<)\n+\n SRCS-y += test_prefetch.c\n SRCS-y += test_byteorder.c\n SRCS-y += test_per_lcore.c\ndiff --git a/app/test/test_pci.c b/app/test/test_pci.c\nindex df12bb2..3c6c955 100644\n--- a/app/test/test_pci.c\n+++ b/app/test/test_pci.c\n@@ -43,6 +43,7 @@\n #include <rte_devargs.h>\n \n #include \"test.h\"\n+#include \"resource.h\"\n \n /* Generic maximum number of drivers to have room to allocate all drivers */\n #define NUM_MAX_DRIVERS 256\n@@ -215,37 +216,88 @@ static int test_pci_sysfs(void)\n \treturn 0;\n }\n \n-/* real drivers (not used for testing) */\n+/* real devices & drivers (not used for testing) */\n struct pci_driver_list real_pci_driver_list =\n \tTAILQ_HEAD_INITIALIZER(real_pci_driver_list);\n+struct pci_device_list real_pci_device_list =\n+\tTAILQ_HEAD_INITIALIZER(real_pci_device_list);\n+\n+REGISTER_LINKED_RESOURCE(test_pci_sysfs);\n \n static int\n test_pci_setup(void)\n {\n+\tstruct rte_pci_device *dev;\n \tstruct rte_pci_driver *dr;\n+\tconst struct resource *r;\n+\tint ret;\n+\n+\tr = resource_find(\"test_pci_sysfs\");\n+\tTEST_ASSERT_NOT_NULL(r, \"missing resource test_pci_sysfs\");\n+\n+\tret = resource_untar(r);\n+\tTEST_ASSERT_SUCCESS(ret, \"failed to untar %s\", r->name);\n+\n+\tret = setenv(\"SYSFS_PCI_DEVICES\", \"test_pci_sysfs/bus/pci/devices\", 1);\n+\tTEST_ASSERT_SUCCESS(ret, \"failed to setenv\");\n \n-\t/* Unregister original driver list */\n+\t/* Unregister original devices & drivers lists */\n \twhile (!TAILQ_EMPTY(&pci_driver_list)) {\n \t\tdr = TAILQ_FIRST(&pci_driver_list);\n \t\trte_eal_pci_unregister(dr);\n \t\tTAILQ_INSERT_TAIL(&real_pci_driver_list, dr, next);\n \t}\n \n+\twhile (!TAILQ_EMPTY(&pci_device_list)) {\n+\t\tdev = TAILQ_FIRST(&pci_device_list);\n+\t\tTAILQ_REMOVE(&pci_device_list, dev, next);\n+\t\tTAILQ_INSERT_TAIL(&real_pci_device_list, dev, next);\n+\t}\n+\n+\tret = rte_eal_pci_scan();\n+\tTEST_ASSERT_SUCCESS(ret, \"failed to scan PCI bus\");\n+\trte_eal_pci_dump(stdout);\n+\n \treturn 0;\n }\n \n static int\n test_pci_cleanup(void)\n {\n+\tstruct rte_pci_device *dev;\n \tstruct rte_pci_driver *dr;\n+\tconst struct resource *r;\n+\tint ret;\n+\n+\tunsetenv(\"SYSFS_PCI_DEVICES\");\n+\n+\tr = resource_find(\"test_pci_sysfs\");\n+\tTEST_ASSERT_NOT_NULL(r, \"missing resource test_pci_sysfs\");\n+\n+\tret = resource_rm_by_tar(r);\n+\tTEST_ASSERT_SUCCESS(ret, \"Failed to delete resource %s\", r->name);\n \n-\t/* Restore original driver list */\n+\t/* FIXME: there is no API in DPDK to free a rte_pci_device so we\n+\t   cannot free the devices in the right way. Let's assume that we\n+\t   don't care for tests. */\n+\twhile (!TAILQ_EMPTY(&pci_device_list)) {\n+\t\tdev = TAILQ_FIRST(&pci_device_list);\n+\t\tTAILQ_REMOVE(&pci_device_list, dev, next);\n+\t}\n+\n+\t/* Restore original devices & drivers lists */\n \twhile (!TAILQ_EMPTY(&real_pci_driver_list)) {\n \t\tdr = TAILQ_FIRST(&real_pci_driver_list);\n \t\tTAILQ_REMOVE(&real_pci_driver_list, dr, next);\n \t\trte_eal_pci_register(dr);\n \t}\n \n+\twhile (!TAILQ_EMPTY(&real_pci_device_list)) {\n+\t\tdev = TAILQ_FIRST(&real_pci_device_list);\n+\t\tTAILQ_REMOVE(&real_pci_device_list, dev, next);\n+\t\tTAILQ_INSERT_TAIL(&pci_device_list, dev, next);\n+\t}\n+\n \treturn 0;\n }\n \ndiff --git a/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/class b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/class\nnew file mode 100644\nindex 0000000..2f9c1da\n--- /dev/null\n+++ b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/class\n@@ -0,0 +1 @@\n+0x020000\ndiff --git a/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/config b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/config\nnew file mode 100644\nindex 0000000000000000000000000000000000000000..7752421cf13a5aa00a28eaee02cac2add9ce5566\nGIT binary patch\nliteral 64\nzcmZo`_$|QBBEZ1Nz`(@7(7?dMz;S^A2oxWHNCpNT2LUi2#BOU~22l(SV3L7>8>k5Y\nDD^Ld(\n\nliteral 0\nHcmV?d00001\n\ndiff --git a/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/consistent_dma_mask_bits b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/consistent_dma_mask_bits\nnew file mode 100644\nindex 0000000..900731f\n--- /dev/null\n+++ b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/consistent_dma_mask_bits\n@@ -0,0 +1 @@\n+64\ndiff --git a/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/device b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/device\nnew file mode 100644\nindex 0000000..9e4789e\n--- /dev/null\n+++ b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/device\n@@ -0,0 +1 @@\n+0x10fb\ndiff --git a/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/dma_mask_bits b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/dma_mask_bits\nnew file mode 100644\nindex 0000000..900731f\n--- /dev/null\n+++ b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/dma_mask_bits\n@@ -0,0 +1 @@\n+64\ndiff --git a/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/enable b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/enable\nnew file mode 100644\nindex 0000000..d00491f\n--- /dev/null\n+++ b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/enable\n@@ -0,0 +1 @@\n+1\ndiff --git a/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/irq b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/irq\nnew file mode 100644\nindex 0000000..573541a\n--- /dev/null\n+++ b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/irq\n@@ -0,0 +1 @@\n+0\ndiff --git a/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/modalias b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/modalias\nnew file mode 100644\nindex 0000000..f4c76ed\n--- /dev/null\n+++ b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/modalias\n@@ -0,0 +1 @@\n+pci:v00008086d000010FBsv00008086sd00000003bc02sc00i00\ndiff --git a/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/msi_bus b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/msi_bus\nnew file mode 100644\nindex 0000000..d00491f\n--- /dev/null\n+++ b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/msi_bus\n@@ -0,0 +1 @@\n+1\ndiff --git a/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/numa_node b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/numa_node\nnew file mode 100644\nindex 0000000..3a2e3f4\n--- /dev/null\n+++ b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/numa_node\n@@ -0,0 +1 @@\n+-1\ndiff --git a/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/resource b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/resource\nnew file mode 100644\nindex 0000000..f388929\n--- /dev/null\n+++ b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/resource\n@@ -0,0 +1,13 @@\n+0x00000000d0080000 0x00000000d00fffff 0x000000000014220c\n+0x0000000000000000 0x0000000000000000 0x0000000000000000\n+0x000000000000e020 0x000000000000e03f 0x0000000000040101\n+0x0000000000000000 0x0000000000000000 0x0000000000000000\n+0x00000000d0104000 0x00000000d0107fff 0x000000000014220c\n+0x0000000000000000 0x0000000000000000 0x0000000000000000\n+0x0000000000000000 0x0000000000000000 0x0000000000000000\n+0x00000000ab000000 0x00000000ab0fffff 0x0000000000140204\n+0x0000000000000000 0x0000000000000000 0x0000000000000000\n+0x0000000000000000 0x0000000000000000 0x0000000000000000\n+0x00000000ab100000 0x00000000ab1fffff 0x0000000000140204\n+0x0000000000000000 0x0000000000000000 0x0000000000000000\n+0x0000000000000000 0x0000000000000000 0x0000000000000000\ndiff --git a/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/sriov_numvfs b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/sriov_numvfs\nnew file mode 100644\nindex 0000000..573541a\n--- /dev/null\n+++ b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/sriov_numvfs\n@@ -0,0 +1 @@\n+0\ndiff --git a/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/sriov_totalvfs b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/sriov_totalvfs\nnew file mode 100644\nindex 0000000..4b9026d\n--- /dev/null\n+++ b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/sriov_totalvfs\n@@ -0,0 +1 @@\n+63\ndiff --git a/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/subsystem_device b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/subsystem_device\nnew file mode 100644\nindex 0000000..89a932c\n--- /dev/null\n+++ b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/subsystem_device\n@@ -0,0 +1 @@\n+0x0003\ndiff --git a/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/subsystem_vendor b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/subsystem_vendor\nnew file mode 100644\nindex 0000000..ce6dc4d\n--- /dev/null\n+++ b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/subsystem_vendor\n@@ -0,0 +1 @@\n+0x8086\ndiff --git a/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/uevent b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/uevent\nnew file mode 100644\nindex 0000000..1dbe34d\n--- /dev/null\n+++ b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/uevent\n@@ -0,0 +1,6 @@\n+DRIVER=ixgbe\n+PCI_CLASS=20000\n+PCI_ID=8086:10FB\n+PCI_SUBSYS_ID=8086:0003\n+PCI_SLOT_NAME=0000:01:00.0\n+MODALIAS=pci:v00008086d000010FBsv00008086sd00000003bc02sc00i00\ndiff --git a/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/vendor b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/vendor\nnew file mode 100644\nindex 0000000..ce6dc4d\n--- /dev/null\n+++ b/app/test/test_pci_sysfs/bus/pci/devices/0000:01:00.0/vendor\n@@ -0,0 +1 @@\n+0x8086\n",
    "prefixes": [
        "dpdk-dev",
        "v1",
        "09/10"
    ]
}