get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 10270,
    "url": "http://patches.dpdk.org/api/patches/10270/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1454078953-23744-4-git-send-email-david.marchand@6wind.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": "<1454078953-23744-4-git-send-email-david.marchand@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1454078953-23744-4-git-send-email-david.marchand@6wind.com",
    "date": "2016-01-29T14:49:07",
    "name": "[dpdk-dev,v2,3/9] pci/linux: rework sysfs parsing for driver",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4b0356d20ba6aa489041ac7d2a1bfda90d8dac82",
    "submitter": {
        "id": 3,
        "url": "http://patches.dpdk.org/api/people/3/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@6wind.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/1454078953-23744-4-git-send-email-david.marchand@6wind.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/10270/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/10270/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 B07ADC6D8;\n\tFri, 29 Jan 2016 15:49:24 +0100 (CET)",
            "from mail-wm0-f50.google.com (mail-wm0-f50.google.com\n\t[74.125.82.50]) by dpdk.org (Postfix) with ESMTP id 00F11C6AC\n\tfor <dev@dpdk.org>; Fri, 29 Jan 2016 15:49:22 +0100 (CET)",
            "by mail-wm0-f50.google.com with SMTP id l66so57665800wml.0\n\tfor <dev@dpdk.org>; Fri, 29 Jan 2016 06:49:21 -0800 (PST)",
            "from gloops.dev.6wind.com (144.77.126.78.rev.sfr.net.\n\t[78.126.77.144]) by smtp.gmail.com with ESMTPSA id\n\ty188sm7811294wmy.11.2016.01.29.06.49.20\n\t(version=TLSv1/SSLv3 cipher=OTHER);\n\tFri, 29 Jan 2016 06:49:21 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=377yMuTlsT4JWAxLxpl/PkCU6Ha9W/SOlvWYjuET/oQ=;\n\tb=eoR91rohjlF8HLBP94yEnSIxxrlLDl64Xo3IzLMJgL6N0Y5UKKmTRZwQa4r1V5lxnw\n\t7KNd3CiKLJ7V0xMC3rx+jjqgUKii4pj52PokEIvIEc2cMYvxQIsuQp147erqoB+oiG4d\n\tXIcEj76kTvEwlEBLZONzbW789rwxZK0kB49WtuHrlGzyxRiuE79DgsLmTMz0FjBKjsTg\n\t0YONMgYHnWn+5DX6qqocc/nB6x88e+DmPQHnq0aJMvvS+1S9tAEvi8CQ/zziyvhK7Y/F\n\tbI2HMNB0BQh9zJY9AAIzinGbmeNBLbqt5TPycrqdY+OYbEN+Zr63S1L6WWQwqsv7AdvL\n\tg7KA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=377yMuTlsT4JWAxLxpl/PkCU6Ha9W/SOlvWYjuET/oQ=;\n\tb=Wk/yjINqHSgexOBGB95OwOQwWviiBKH1+cExZEirMJS+wAWGys8McP5RTHfrRaYZse\n\teGkPlSAEJO5OQH30w+NsVTiU1eJ9FxG41DUf2utXSVRblWJJ0ozR49xzq6oWND6wxI78\n\t9qNWY9N7ISfvARVG7MqW1pVOA6etfMXglUxGivCxYn+syd2CwCszrhwrBi/9BpLJwqdp\n\tFFSp+uiEcaG4ORpO5pLwgpobiiyBl9jpw/Qey4r4PSSH7HWFGk+yMg61l798zz8KhKEf\n\tnFArUpgs3xoYC9hx6YCYPj3ZSW+hUs8OiwY1Jcm9o35yOKuED790WoduHwsyuyPDg5C1\n\tL0UA==",
        "X-Gm-Message-State": "AG10YORhqCVmF4Oiyu8uK3V1oPpGsIOkoNl5d6KIvXsxzPKFjEEVVB3oXGizoLc7LHEIXjvl",
        "X-Received": "by 10.28.229.20 with SMTP id c20mr8871132wmh.79.1454078961870;\n\tFri, 29 Jan 2016 06:49:21 -0800 (PST)",
        "From": "David Marchand <david.marchand@6wind.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 29 Jan 2016 15:49:07 +0100",
        "Message-Id": "<1454078953-23744-4-git-send-email-david.marchand@6wind.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1454078953-23744-1-git-send-email-david.marchand@6wind.com>",
        "References": "<1453476464-31767-1-git-send-email-david.marchand@6wind.com>\n\t<1454078953-23744-1-git-send-email-david.marchand@6wind.com>",
        "Cc": "viktorin@rehivetech.com",
        "Subject": "[dpdk-dev] [PATCH v2 3/9] pci/linux: rework sysfs parsing for driver",
        "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": "There is no use for pci_get_kernel_driver_by_path() apart recognising\nkernel driver and fill kdrv field.\n\nSigned-off-by: David Marchand <david.marchand@6wind.com>\n---\nChanges since v1:\n- updated the commitlog, Huawei already did the \"unknown\" -> \"none\"\n  change, so this patch ends up just refactoring code\n\n---\n lib/librte_eal/linuxapp/eal/eal_pci.c | 48 ++++++++++++++---------------------\n 1 file changed, 19 insertions(+), 29 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c\nindex 6751b48..c3118fc 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_pci.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c\n@@ -94,32 +94,37 @@ error:\n }\n \n static int\n-pci_get_kernel_driver_by_path(const char *filename, char *dri_name)\n+pci_parse_sysfs_driver(const char *filename, struct rte_pci_device *dev)\n {\n \tint count;\n \tchar path[PATH_MAX];\n \tchar *name;\n \n-\tif (!filename || !dri_name)\n-\t\treturn -1;\n-\n \tcount = readlink(filename, path, PATH_MAX);\n \tif (count >= PATH_MAX)\n \t\treturn -1;\n \n-\t/* For device does not have a driver */\n-\tif (count < 0)\n-\t\treturn 1;\n+\tdev->kdrv = RTE_KDRV_NONE;\n \n-\tpath[count] = '\\0';\n+\tif (count > 0) {\n+\t\tdev->kdrv = RTE_KDRV_UNKNOWN;\n \n-\tname = strrchr(path, '/');\n-\tif (name) {\n-\t\tstrncpy(dri_name, name + 1, strlen(name + 1) + 1);\n-\t\treturn 0;\n+\t\tpath[count] = '\\0';\n+\t\tname = strrchr(path, '/');\n+\t\tif (name) {\n+\t\t\tname[0] = '\\0';\n+\t\t\tname++;\n+\t\t}\n+\n+\t\tif (!strcmp(name, \"vfio-pci\"))\n+\t\t\tdev->kdrv = RTE_KDRV_VFIO;\n+\t\telse if (!strcmp(name, \"igb_uio\"))\n+\t\t\tdev->kdrv = RTE_KDRV_IGB_UIO;\n+\t\telse if (!strcmp(name, \"uio_pci_generic\"))\n+\t\t\tdev->kdrv = RTE_KDRV_UIO_GENERIC;\n \t}\n \n-\treturn -1;\n+\treturn 0;\n }\n \n /* Map pci device */\n@@ -260,8 +265,6 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus,\n \tunsigned long tmp;\n \tstruct rte_pci_device *dev;\n \tstruct rte_pci_device *dev2;\n-\tchar driver[PATH_MAX];\n-\tint ret;\n \n \tdev = malloc(sizeof(*dev));\n \tif (dev == NULL)\n@@ -341,25 +344,12 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus,\n \n \t/* parse driver */\n \tsnprintf(filename, sizeof(filename), \"%s/driver\", dirname);\n-\tret = pci_get_kernel_driver_by_path(filename, driver);\n-\tif (ret < 0) {\n+\tif (pci_parse_sysfs_driver(filename, dev) < 0) {\n \t\tRTE_LOG(ERR, EAL, \"Fail to get kernel driver\\n\");\n \t\tfree(dev);\n \t\treturn -1;\n \t}\n \n-\tif (!ret) {\n-\t\tif (!strcmp(driver, \"vfio-pci\"))\n-\t\t\tdev->kdrv = RTE_KDRV_VFIO;\n-\t\telse if (!strcmp(driver, \"igb_uio\"))\n-\t\t\tdev->kdrv = RTE_KDRV_IGB_UIO;\n-\t\telse if (!strcmp(driver, \"uio_pci_generic\"))\n-\t\t\tdev->kdrv = RTE_KDRV_UIO_GENERIC;\n-\t\telse\n-\t\t\tdev->kdrv = RTE_KDRV_UNKNOWN;\n-\t} else\n-\t\tdev->kdrv = RTE_KDRV_UNKNOWN;\n-\n \tdev2 = pci_find_device(&dev->addr);\n \tif (!dev2)\n \t\tpci_add_device(dev);\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "3/9"
    ]
}