get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 45862,
    "url": "http://patches.dpdk.org/api/patches/45862/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1538484302-97153-3-git-send-email-jia.guo@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": "<1538484302-97153-3-git-send-email-jia.guo@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1538484302-97153-3-git-send-email-jia.guo@intel.com",
    "date": "2018-10-02T12:45:00",
    "name": "[v3,2/4] eal: modify device event callback process func",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "96c32d48bce1f14d4915481a53ba2378db757805",
    "submitter": {
        "id": 507,
        "url": "http://patches.dpdk.org/api/people/507/?format=api",
        "name": "Guo, Jia",
        "email": "jia.guo@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1538484302-97153-3-git-send-email-jia.guo@intel.com/mbox/",
    "series": [
        {
            "id": 1638,
            "url": "http://patches.dpdk.org/api/series/1638/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1638",
            "date": "2018-10-02T12:44:59",
            "name": "Enable hotplug in vfio",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/1638/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/45862/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/45862/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 75A2D54AE;\n\tTue,  2 Oct 2018 14:48:23 +0200 (CEST)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id 1DBE5200\n\tfor <dev@dpdk.org>; Tue,  2 Oct 2018 14:48:19 +0200 (CEST)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Oct 2018 05:48:18 -0700",
            "from jeffguo-s2600wt2.sh.intel.com (HELO localhost.localdomain)\n\t([10.67.110.10])\n\tby orsmga006.jf.intel.com with ESMTP; 02 Oct 2018 05:41:25 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.54,332,1534834800\"; d=\"scan'208\";a=\"79210140\"",
        "From": "Jeff Guo <jia.guo@intel.com>",
        "To": "stephen@networkplumber.org, bruce.richardson@intel.com,\n\tferruh.yigit@intel.com, konstantin.ananyev@intel.com,\n\tgaetan.rivet@6wind.com, jingjing.wu@intel.com, thomas@monjalon.net,\n\tmotih@mellanox.com, matan@mellanox.com, harry.van.haaren@intel.com,\n\tqi.z.zhang@intel.com, shaopeng.he@intel.com,\n\tbernard.iremonger@intel.com, \n\tarybchenko@solarflare.com, anatoly.burakov@intel.com",
        "Cc": "jblunck@infradead.org, shreyansh.jain@nxp.com, dev@dpdk.org,\n\tjia.guo@intel.com, helin.zhang@intel.com, jerin.jacob@caviumnetworks.com",
        "Date": "Tue,  2 Oct 2018 20:45:00 +0800",
        "Message-Id": "<1538484302-97153-3-git-send-email-jia.guo@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1538484302-97153-1-git-send-email-jia.guo@intel.com>",
        "References": "<1534503091-31910-1-git-send-email-jia.guo@intel.com>\n\t<1538484302-97153-1-git-send-email-jia.guo@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3 2/4] eal: modify device event callback process\n\tfunc",
        "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": "This patch modify the device event callback process function name to be\nmore explicit, change the variable to be const. And more, because not only\neal device helper will use the callback, but also vfio bus will use the\ncallback to handle hot-unplug, so exposure the API out from private eal.\nThe bus drivers and eal device would directly use this API to process\ndevice event callback.\n\nSigned-off-by: Jeff Guo <jia.guo@intel.com>\n---\nmodify commit log to be more clear\n---\n app/test-pmd/testpmd.c                  |  4 ++--\n lib/librte_eal/bsdapp/eal/eal_dev.c     |  8 ++++++++\n lib/librte_eal/common/eal_common_dev.c  |  5 +++--\n lib/librte_eal/common/eal_private.h     | 12 ------------\n lib/librte_eal/common/include/rte_dev.h | 18 +++++++++++++++++-\n lib/librte_eal/linuxapp/eal/eal_dev.c   |  2 +-\n lib/librte_eal/rte_eal_version.map      |  1 +\n 7 files changed, 32 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex bfef483..1313100 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -431,7 +431,7 @@ static void check_all_ports_link_status(uint32_t port_mask);\n static int eth_event_callback(portid_t port_id,\n \t\t\t      enum rte_eth_event_type type,\n \t\t\t      void *param, void *ret_param);\n-static void eth_dev_event_callback(char *device_name,\n+static void eth_dev_event_callback(const char *device_name,\n \t\t\t\tenum rte_dev_event_type type,\n \t\t\t\tvoid *param);\n static int eth_dev_event_callback_register(void);\n@@ -2249,7 +2249,7 @@ eth_event_callback(portid_t port_id, enum rte_eth_event_type type, void *param,\n \n /* This function is used by the interrupt thread */\n static void\n-eth_dev_event_callback(char *device_name, enum rte_dev_event_type type,\n+eth_dev_event_callback(const char *device_name, enum rte_dev_event_type type,\n \t\t\t     __rte_unused void *arg)\n {\n \tuint16_t port_id;\ndiff --git a/lib/librte_eal/bsdapp/eal/eal_dev.c b/lib/librte_eal/bsdapp/eal/eal_dev.c\nindex 255d611..3a3a2a5 100644\n--- a/lib/librte_eal/bsdapp/eal/eal_dev.c\n+++ b/lib/librte_eal/bsdapp/eal/eal_dev.c\n@@ -33,3 +33,11 @@ rte_dev_hotplug_handle_disable(void)\n \tRTE_LOG(ERR, EAL, \"Device event is not supported for FreeBSD\\n\");\n \treturn -1;\n }\n+\n+void  __rte_experimental\n+rte_dev_event_callback_process(const char *device_name,\n+\t\t\t       enum rte_dev_event_type event)\n+{\n+\tRTE_LOG(ERR, EAL,\n+\t\t\"Device event callback process is not supported for FreeBSD.\\n\");\n+}\ndiff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c\nindex 678dbca..2d610a4 100644\n--- a/lib/librte_eal/common/eal_common_dev.c\n+++ b/lib/librte_eal/common/eal_common_dev.c\n@@ -342,8 +342,9 @@ rte_dev_event_callback_unregister(const char *device_name,\n \treturn ret;\n }\n \n-void\n-dev_callback_process(char *device_name, enum rte_dev_event_type event)\n+void __rte_experimental\n+rte_dev_event_callback_process(const char *device_name,\n+\t\t\t       enum rte_dev_event_type event)\n {\n \tstruct dev_event_callback *cb_lst;\n \ndiff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h\nindex 637f20d..47e8a33 100644\n--- a/lib/librte_eal/common/eal_private.h\n+++ b/lib/librte_eal/common/eal_private.h\n@@ -259,18 +259,6 @@ struct rte_bus *rte_bus_find_by_device_name(const char *str);\n int rte_mp_channel_init(void);\n \n /**\n- * Internal Executes all the user application registered callbacks for\n- * the specific device. It is for DPDK internal user only. User\n- * application should not call it directly.\n- *\n- * @param device_name\n- *  The device name.\n- * @param event\n- *  the device event type.\n- */\n-void dev_callback_process(char *device_name, enum rte_dev_event_type event);\n-\n-/**\n  * @internal\n  * Parse a device string and store its information in an\n  * rte_devargs structure.\ndiff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h\nindex ff580a0..58fab43 100644\n--- a/lib/librte_eal/common/include/rte_dev.h\n+++ b/lib/librte_eal/common/include/rte_dev.h\n@@ -39,7 +39,7 @@ struct rte_dev_event {\n \tchar *devname;\t\t\t/**< device name */\n };\n \n-typedef void (*rte_dev_event_cb_fn)(char *device_name,\n+typedef void (*rte_dev_event_cb_fn)(const char *device_name,\n \t\t\t\t\tenum rte_dev_event_type event,\n \t\t\t\t\tvoid *cb_arg);\n \n@@ -438,6 +438,22 @@ rte_dev_event_callback_unregister(const char *device_name,\n  * @warning\n  * @b EXPERIMENTAL: this API may change without prior notice\n  *\n+ * Executes all the user application registered callbacks for\n+ * the specific device.\n+ *\n+ * @param device_name\n+ *  The device name.\n+ * @param event\n+ *  the device event type.\n+ */\n+void  __rte_experimental\n+rte_dev_event_callback_process(const char *device_name,\n+\t\t\t       enum rte_dev_event_type event);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n  * Start the device event monitoring.\n  *\n  * @return\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_dev.c b/lib/librte_eal/linuxapp/eal/eal_dev.c\nindex 14b18d8..7f44251 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_dev.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_dev.c\n@@ -271,7 +271,7 @@ dev_uev_handler(__rte_unused void *param)\n \t\t\t\treturn;\n \t\t\t}\n \t\t}\n-\t\tdev_callback_process(uevent.devname, uevent.type);\n+\t\trte_dev_event_callback_process(uevent.devname, uevent.type);\n \t}\n }\n \ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex a3255aa..b96da50 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -277,6 +277,7 @@ EXPERIMENTAL {\n \trte_class_register;\n \trte_class_unregister;\n \trte_ctrl_thread_create;\n+\trte_dev_event_callback_process;\n \trte_dev_event_callback_register;\n \trte_dev_event_callback_unregister;\n \trte_dev_event_monitor_start;\n",
    "prefixes": [
        "v3",
        "2/4"
    ]
}