get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 19759,
    "url": "https://patches.dpdk.org/api/patches/19759/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1484801117-779-4-git-send-email-thomas.monjalon@6wind.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": "<1484801117-779-4-git-send-email-thomas.monjalon@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1484801117-779-4-git-send-email-thomas.monjalon@6wind.com",
    "date": "2017-01-19T04:45:07",
    "name": "[dpdk-dev,v11,03/13] bus: add probing",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "3adc83a1b5d27ea9375e4a9568e6407e0f3f5b9d",
    "submitter": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/people/1/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas.monjalon@6wind.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1484801117-779-4-git-send-email-thomas.monjalon@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/19759/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/19759/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 3C44AFB38;\n\tThu, 19 Jan 2017 05:45:35 +0100 (CET)",
            "from mail-wm0-f42.google.com (mail-wm0-f42.google.com\n\t[74.125.82.42]) by dpdk.org (Postfix) with ESMTP id E68702B83\n\tfor <dev@dpdk.org>; Thu, 19 Jan 2017 05:45:24 +0100 (CET)",
            "by mail-wm0-f42.google.com with SMTP id r144so58579401wme.1\n\tfor <dev@dpdk.org>; Wed, 18 Jan 2017 20:45:24 -0800 (PST)",
            "from XPS13.localdomain (184.203.134.77.rev.sfr.net.\n\t[77.134.203.184]) by smtp.gmail.com with ESMTPSA id\n\tt194sm2568586wmd.1.2017.01.18.20.45.23\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tWed, 18 Jan 2017 20:45:24 -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=wLIclXLTbwXrGoyR/O9KB0UnEHBK1naeodGa4i/L8t8=;\n\tb=JEwK8Y9FMNB50CRGMiyNMdqK0NSwb1zYrPUHCWTS3q3b/bqar7PvAM+3xJtgPFWl2l\n\txMI7VlREV+EmGRiL0w0Ed3jmypAmrVE+6kZeJwtYYFOtV6ulPc1yWlNl8a1VgdHN8MWK\n\tBt80SVWpSMqB7qpsy7cq1zAm77UTbFjldEqkOUi67eim+nN8ibZYtlIkL9ZxBW0Pbrw1\n\tt2keCHvBOpO6kTxK3NjksRQ7HYl348DxFe8D5oWWYkFNtJqT5XEBzVchSaHkQOlP7Bs1\n\t8JbvOB8CaOpBT/2RVwpApYoQuw4LUeFTxzttPo/tMhop81i9j1Fli6ux/HNfZFM/sXjr\n\tqsFA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=wLIclXLTbwXrGoyR/O9KB0UnEHBK1naeodGa4i/L8t8=;\n\tb=FV6gOwlFkBTkPHJn4u09lVEe1Syy/TYQYHu7jHF586lVOa2rYPBWBUmVi/Z37tPFFk\n\tC8FVVadPR1a9bIMMmyQXcOnc58Pwy9hy6TdXjkskW3QWUN34GO/8WOmPURuHpJo4Mwln\n\tg1+tQci7SKYP5csML0LHtHdPJkOMGix0vIhuFNDjMkzRZjSWXsEYvKFv05X3oKY6TcF9\n\txDmyHJKWVM3DBTpMKVky9hH3vkN5m3+fYBI/YS+2b9Lpdohc7dC79RbNZLpcFWSEXVPD\n\tez6Dwc9hEA3KYvFe+lAWkQgD3SBsxx1J0Wlv/qTG/4aqTH3NkMtl4wnWm7xF9lyY7lFa\n\tVvig==",
        "X-Gm-Message-State": "AIkVDXIYNbdsF0i0WbsAeMhM5/GSFS/1aTrKtFwTBkTx/irJU6yNVpkDOa+nX2zYMDZ2+iWK",
        "X-Received": "by 10.223.152.210 with SMTP id w76mr6297987wrb.72.1484801124618; \n\tWed, 18 Jan 2017 20:45:24 -0800 (PST)",
        "From": "Thomas Monjalon <thomas.monjalon@6wind.com>",
        "To": "Shreyansh Jain <shreyansh.jain@nxp.com>",
        "Cc": "dev@dpdk.org",
        "Date": "Thu, 19 Jan 2017 05:45:07 +0100",
        "Message-Id": "<1484801117-779-4-git-send-email-thomas.monjalon@6wind.com>",
        "X-Mailer": "git-send-email 2.7.0",
        "In-Reply-To": "<1484801117-779-1-git-send-email-thomas.monjalon@6wind.com>",
        "References": "<1484748329-5418-1-git-send-email-shreyansh.jain@nxp.com>\n\t<1484801117-779-1-git-send-email-thomas.monjalon@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH v11 03/13] bus: add probing",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <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": "From: Shreyansh Jain <shreyansh.jain@nxp.com>\n\nBus implementations can implement a probe handler to match the devices\nscanned against the drivers registered.\n\nSigned-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>\nReviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>\nSigned-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>\n---\n lib/librte_eal/bsdapp/eal/eal.c                 |  4 ++++\n lib/librte_eal/bsdapp/eal/rte_eal_version.map   |  1 +\n lib/librte_eal/common/eal_common_bus.c          | 20 ++++++++++++++++++++\n lib/librte_eal/common/include/rte_bus.h         | 23 +++++++++++++++++++++++\n lib/librte_eal/linuxapp/eal/eal.c               |  4 ++++\n lib/librte_eal/linuxapp/eal/rte_eal_version.map |  1 +\n 6 files changed, 53 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c\nindex be5d295..534aeea 100644\n--- a/lib/librte_eal/bsdapp/eal/eal.c\n+++ b/lib/librte_eal/bsdapp/eal/eal.c\n@@ -612,6 +612,10 @@ rte_eal_init(int argc, char **argv)\n \trte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);\n \trte_eal_mp_wait_lcore();\n \n+\t/* Probe all the buses and devices/drivers on them */\n+\tif (rte_bus_probe())\n+\t\trte_panic(\"Cannot probe devices\\n\");\n+\n \t/* Probe & Initialize PCI devices */\n \tif (rte_eal_pci_probe())\n \t\trte_panic(\"Cannot probe PCI\\n\");\ndiff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map\nindex 931afeb..2cf1ac8 100644\n--- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map\n+++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map\n@@ -179,6 +179,7 @@ DPDK_17.02 {\n \tglobal:\n \n \trte_bus_dump;\n+\trte_bus_probe;\n \trte_bus_register;\n \trte_bus_scan;\n \trte_bus_unregister;\ndiff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c\nindex ef10390..4638e78 100644\n--- a/lib/librte_eal/common/eal_common_bus.c\n+++ b/lib/librte_eal/common/eal_common_bus.c\n@@ -49,6 +49,7 @@ rte_bus_register(struct rte_bus *bus)\n \tRTE_VERIFY(bus->name && strlen(bus->name));\n \t/* A bus should mandatorily have the scan implemented */\n \tRTE_VERIFY(bus->scan);\n+\tRTE_VERIFY(bus->probe);\n \n \tTAILQ_INSERT_TAIL(&rte_bus_list, bus, next);\n \tRTE_LOG(DEBUG, EAL, \"Registered [%s] bus.\\n\", bus->name);\n@@ -80,6 +81,25 @@ rte_bus_scan(void)\n \treturn 0;\n }\n \n+/* Probe all devices of all buses */\n+int\n+rte_bus_probe(void)\n+{\n+\tint ret;\n+\tstruct rte_bus *bus;\n+\n+\tTAILQ_FOREACH(bus, &rte_bus_list, next) {\n+\t\tret = bus->probe();\n+\t\tif (ret) {\n+\t\t\tRTE_LOG(ERR, EAL, \"Bus (%s) probe failed.\\n\",\n+\t\t\t\tbus->name);\n+\t\t\treturn ret;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n /* Dump information of a single bus */\n static int\n bus_dump_one(FILE *f, struct rte_bus *bus)\ndiff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h\nindex b01930a..7c36969 100644\n--- a/lib/librte_eal/common/include/rte_bus.h\n+++ b/lib/librte_eal/common/include/rte_bus.h\n@@ -70,12 +70,25 @@ TAILQ_HEAD(rte_bus_list, rte_bus);\n typedef int (*rte_bus_scan_t)(void);\n \n /**\n+ * Implementation specific probe function which is responsible for linking\n+ * devices on that bus with applicable drivers.\n+ *\n+ * This is called while iterating over each registered bus.\n+ *\n+ * @return\n+ *\t0 for successful probe\n+ *\t!0 for any error while probing\n+ */\n+typedef int (*rte_bus_probe_t)(void);\n+\n+/**\n  * A structure describing a generic bus.\n  */\n struct rte_bus {\n \tTAILQ_ENTRY(rte_bus) next;   /**< Next bus object in linked list */\n \tconst char *name;            /**< Name of the bus */\n \trte_bus_scan_t scan;         /**< Scan for devices attached to bus */\n+\trte_bus_probe_t probe;       /**< Probe devices on bus */\n };\n \n /**\n@@ -106,6 +119,16 @@ void rte_bus_unregister(struct rte_bus *bus);\n int rte_bus_scan(void);\n \n /**\n+ * For each device on the buses, perform a driver 'match' and call the\n+ * driver-specific probe for device initialization.\n+ *\n+ * @return\n+ *\t 0 for successful match/probe\n+ *\t!0 otherwise\n+ */\n+int rte_bus_probe(void);\n+\n+/**\n  * Dump information of all the buses registered with EAL.\n  *\n  * @param f\ndiff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c\nindex 1d2a16a..bf6b818 100644\n--- a/lib/librte_eal/linuxapp/eal/eal.c\n+++ b/lib/librte_eal/linuxapp/eal/eal.c\n@@ -884,6 +884,10 @@ rte_eal_init(int argc, char **argv)\n \trte_eal_mp_remote_launch(sync_func, NULL, SKIP_MASTER);\n \trte_eal_mp_wait_lcore();\n \n+\t/* Probe all the buses and devices/drivers on them */\n+\tif (rte_bus_probe())\n+\t\trte_panic(\"Cannot probe devices\\n\");\n+\n \t/* Probe & Initialize PCI devices */\n \tif (rte_eal_pci_probe())\n \t\trte_panic(\"Cannot probe PCI\\n\");\ndiff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map\nindex c238381..3c68ff5 100644\n--- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map\n+++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map\n@@ -183,6 +183,7 @@ DPDK_17.02 {\n \tglobal:\n \n \trte_bus_dump;\n+\trte_bus_probe;\n \trte_bus_register;\n \trte_bus_scan;\n \trte_bus_unregister;\n",
    "prefixes": [
        "dpdk-dev",
        "v11",
        "03/13"
    ]
}