get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 42038,
    "url": "http://patches.dpdk.org/api/patches/42038/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180702054450.29269-5-qi.z.zhang@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": "<20180702054450.29269-5-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180702054450.29269-5-qi.z.zhang@intel.com",
    "date": "2018-07-02T05:44:35",
    "name": "[v8,04/19] ethdev: introduce device lock",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "1672d03df547f047bc75a8209b80734538950e5a",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.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/20180702054450.29269-5-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 344,
            "url": "http://patches.dpdk.org/api/series/344/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=344",
            "date": "2018-07-02T05:44:31",
            "name": "enable hotplug on multi-process",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/344/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/42038/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/42038/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 8E0795B14;\n\tMon,  2 Jul 2018 07:44:32 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 88B345398\n\tfor <dev@dpdk.org>; Mon,  2 Jul 2018 07:44:26 +0200 (CEST)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t01 Jul 2018 22:44:23 -0700",
            "from dpdk51.sh.intel.com ([10.67.110.190])\n\tby orsmga007.jf.intel.com with ESMTP; 01 Jul 2018 22:44:21 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,298,1526367600\"; d=\"scan'208\";a=\"53378935\"",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "thomas@monjalon.net,\n\tanatoly.burakov@intel.com",
        "Cc": "konstantin.ananyev@intel.com, dev@dpdk.org, bruce.richardson@intel.com, \n\tferruh.yigit@intel.com, benjamin.h.shelton@intel.com,\n\tnarender.vangati@intel.com, Qi Zhang <qi.z.zhang@intel.com>",
        "Date": "Mon,  2 Jul 2018 13:44:35 +0800",
        "Message-Id": "<20180702054450.29269-5-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20180702054450.29269-1-qi.z.zhang@intel.com>",
        "References": "<20180607123849.14439-1-qi.z.zhang@intel.com>\n\t<20180702054450.29269-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v8 04/19] ethdev: introduce device lock",
        "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": "Introduce API rte_eth_dev_lock and rte_eth_dev_unlock to let\napplication lock or unlock on specific ethdev, a locked device\ncan't be detached, this help applicaiton to prevent unexpected\ndevice detaching, especially in multi-process envrionment.\n\nAslo introduce the new API rte_eth_dev_lock_with_callback and\nrte_eth_dev_unlock_with callback to let application to register\na callback function which will be invoked before a device is going\nto be detached, the return value of the function will decide if\ndevice will continue be detached or not, this support application\nto do condition check at runtime.\n\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\nReviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_ethdev/Makefile               |   1 +\n lib/librte_ethdev/ethdev_lock.c          | 140 +++++++++++++++++++++++++++++++\n lib/librte_ethdev/ethdev_lock.h          |  31 +++++++\n lib/librte_ethdev/ethdev_mp.c            |   3 +-\n lib/librte_ethdev/meson.build            |   1 +\n lib/librte_ethdev/rte_ethdev.c           |  60 ++++++++++++-\n lib/librte_ethdev/rte_ethdev.h           | 124 +++++++++++++++++++++++++++\n lib/librte_ethdev/rte_ethdev_version.map |   2 +\n 8 files changed, 360 insertions(+), 2 deletions(-)\n create mode 100644 lib/librte_ethdev/ethdev_lock.c\n create mode 100644 lib/librte_ethdev/ethdev_lock.h",
    "diff": "diff --git a/lib/librte_ethdev/Makefile b/lib/librte_ethdev/Makefile\nindex d0a059b83..62bef03fc 100644\n--- a/lib/librte_ethdev/Makefile\n+++ b/lib/librte_ethdev/Makefile\n@@ -20,6 +20,7 @@ LIBABIVER := 9\n \n SRCS-y += rte_ethdev.c\n SRCS-y += ethdev_mp.c\n+SRCS-y += ethdev_lock.c\n SRCS-y += rte_flow.c\n SRCS-y += rte_tm.c\n SRCS-y += rte_mtr.c\ndiff --git a/lib/librte_ethdev/ethdev_lock.c b/lib/librte_ethdev/ethdev_lock.c\nnew file mode 100644\nindex 000000000..6379519e3\n--- /dev/null\n+++ b/lib/librte_ethdev/ethdev_lock.c\n@@ -0,0 +1,140 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018 Intel Corporation\n+ */\n+#include \"ethdev_lock.h\"\n+\n+struct lock_entry {\n+\tTAILQ_ENTRY(lock_entry) next;\n+\trte_eth_dev_lock_callback_t callback;\n+\tuint16_t port_id;\n+\tvoid *user_args;\n+\tint ref_count;\n+};\n+\n+TAILQ_HEAD(lock_entry_list, lock_entry);\n+static struct lock_entry_list lock_entry_list =\n+\tTAILQ_HEAD_INITIALIZER(lock_entry_list);\n+static rte_spinlock_t lock_entry_lock = RTE_SPINLOCK_INITIALIZER;\n+\n+int\n+register_lock_callback(uint16_t port_id,\n+\t\t\trte_eth_dev_lock_callback_t callback,\n+\t\t\tvoid *user_args)\n+{\n+\tstruct lock_entry *le;\n+\n+\trte_spinlock_lock(&lock_entry_lock);\n+\n+\tTAILQ_FOREACH(le, &lock_entry_list, next) {\n+\t\tif (le->port_id == port_id &&\n+\t\t    le->callback == callback &&\n+\t\t    le->user_args == user_args)\n+\t\t\tbreak;\n+\t}\n+\n+\tif (le == NULL) {\n+\t\tle = calloc(1, sizeof(struct lock_entry));\n+\t\tif (le == NULL) {\n+\t\t\trte_spinlock_unlock(&lock_entry_lock);\n+\t\t\treturn -ENOMEM;\n+\t\t}\n+\t\tle->callback = callback;\n+\t\tle->port_id = port_id;\n+\t\tle->user_args = user_args;\n+\t\tTAILQ_INSERT_TAIL(&lock_entry_list, le, next);\n+\t}\n+\tle->ref_count++;\n+\n+\trte_spinlock_unlock(&lock_entry_lock);\n+\treturn 0;\n+}\n+\n+int\n+unregister_lock_callback(uint16_t port_id,\n+\t\t\trte_eth_dev_lock_callback_t callback,\n+\t\t\tvoid *user_args)\n+{\n+\tstruct lock_entry *le;\n+\tint ret = 0;\n+\n+\trte_spinlock_lock(&lock_entry_lock);\n+\n+\tTAILQ_FOREACH(le, &lock_entry_list, next) {\n+\t\tif (le->port_id == port_id &&\n+\t\t    le->callback == callback &&\n+\t\t    le->user_args == user_args)\n+\t\t\tbreak;\n+\t}\n+\n+\tif (le != NULL) {\n+\t\tle->ref_count--;\n+\t\tif (le->ref_count == 0) {\n+\t\t\tTAILQ_REMOVE(&lock_entry_list, le, next);\n+\t\t\tfree(le);\n+\t\t}\n+\t} else {\n+\t\tret = -ENOENT;\n+\t}\n+\n+\trte_spinlock_unlock(&lock_entry_lock);\n+\treturn ret;\n+}\n+\n+static int clean_lock_callback_one(uint16_t port_id)\n+{\n+\tstruct lock_entry *le;\n+\tint ret = 0;\n+\n+\tTAILQ_FOREACH(le, &lock_entry_list, next) {\n+\t\tif (le->port_id == port_id)\n+\t\t\tbreak;\n+\t}\n+\n+\tif (le != NULL) {\n+\t\tle->ref_count--;\n+\t\tif (le->ref_count == 0) {\n+\t\t\tTAILQ_REMOVE(&lock_entry_list, le, next);\n+\t\t\tfree(le);\n+\t\t}\n+\t} else {\n+\t\tret = -ENOENT;\n+\t}\n+\n+\treturn ret;\n+\n+}\n+\n+void clean_lock_callback(uint16_t port_id)\n+{\n+\tint ret;\n+\n+\trte_spinlock_lock(&lock_entry_lock);\n+\n+\tfor (;;) {\n+\t\tret = clean_lock_callback_one(port_id);\n+\t\tif (ret == -ENOENT)\n+\t\t\tbreak;\n+\t}\n+\n+\trte_spinlock_unlock(&lock_entry_lock);\n+}\n+\n+int process_lock_callbacks(uint16_t port_id)\n+{\n+\tstruct lock_entry *le;\n+\n+\trte_spinlock_lock(&lock_entry_lock);\n+\n+\tTAILQ_FOREACH(le, &lock_entry_list, next) {\n+\t\tif (le->port_id != port_id)\n+\t\t\tcontinue;\n+\n+\t\tif (le->callback(port_id, le->user_args)) {\n+\t\t\trte_spinlock_unlock(&lock_entry_lock);\n+\t\t\treturn -EBUSY;\n+\t\t}\n+\t}\n+\n+\trte_spinlock_unlock(&lock_entry_lock);\n+\treturn 0;\n+}\ndiff --git a/lib/librte_ethdev/ethdev_lock.h b/lib/librte_ethdev/ethdev_lock.h\nnew file mode 100644\nindex 000000000..82132eb0c\n--- /dev/null\n+++ b/lib/librte_ethdev/ethdev_lock.h\n@@ -0,0 +1,31 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018 Intel Corporation\n+ */\n+\n+#ifndef _RTE_ETHDEV_LOCK_H_\n+#define _RTE_ETHDEV_LOCK_H_\n+\n+#include \"rte_ethdev.h\"\n+\n+/* Register lock callback function on specific port */\n+int\n+register_lock_callback(uint16_t port_id,\n+\t\t\trte_eth_dev_lock_callback_t callback,\n+\t\t\tvoid *user_args);\n+\n+/* Unregister lock callback function on specific port */\n+int\n+unregister_lock_callback(uint16_t port_id,\n+\t\t\trte_eth_dev_lock_callback_t callback,\n+\t\t\tvoid *user_args);\n+\n+/**\n+ * Unregister all callback function on specific port.\n+ * This will be called when a device is detached.\n+ */\n+void clean_lock_callback(uint16_t port_id);\n+\n+/* Run each callback one by one. */\n+int process_lock_callbacks(uint16_t port_id);\n+\n+#endif\ndiff --git a/lib/librte_ethdev/ethdev_mp.c b/lib/librte_ethdev/ethdev_mp.c\nindex 0f9d8990d..1d148cd5e 100644\n--- a/lib/librte_ethdev/ethdev_mp.c\n+++ b/lib/librte_ethdev/ethdev_mp.c\n@@ -6,6 +6,7 @@\n \n #include \"rte_ethdev_driver.h\"\n #include \"ethdev_mp.h\"\n+#include \"ethdev_lock.h\"\n \n #define MP_TIMEOUT_S 5 /**< 5 seconds timeouts */\n \n@@ -108,7 +109,7 @@ static void __handle_primary_request(void *param)\n \t\tret = attach_on_secondary(req->devargs, req->port_id);\n \t\tbreak;\n \tcase REQ_TYPE_PRE_DETACH:\n-\t\tret = 0;\n+\t\tret = process_lock_callbacks(req->port_id);\n \t\tbreak;\n \tcase REQ_TYPE_DETACH:\n \tcase REQ_TYPE_ATTACH_ROLLBACK:\ndiff --git a/lib/librte_ethdev/meson.build b/lib/librte_ethdev/meson.build\nindex b60256855..9bb0aec7f 100644\n--- a/lib/librte_ethdev/meson.build\n+++ b/lib/librte_ethdev/meson.build\n@@ -6,6 +6,7 @@ version = 9\n allow_experimental_apis = true\n sources = files('ethdev_profile.c',\n \t'ethdev_mp.c'\n+\t'ethdev_lock.c'\n \t'rte_ethdev.c',\n \t'rte_flow.c',\n \t'rte_mtr.c',\ndiff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 91d9f9a37..7d89d9f95 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -43,6 +43,7 @@\n #include \"ethdev_profile.h\"\n #include \"ethdev_mp.h\"\n #include \"ethdev_private.h\"\n+#include \"ethdev_lock.h\"\n \n int ethdev_logtype;\n \n@@ -735,6 +736,7 @@ do_eth_dev_detach(uint16_t port_id)\n \tif (ret < 0)\n \t\treturn ret;\n \n+\tclean_lock_callback(port_id);\n \tif (solid_release)\n \t\treturn rte_eth_dev_release_port(&rte_eth_devices[port_id]);\n \telse\n@@ -803,7 +805,6 @@ rte_eth_dev_attach(const char *devargs, uint16_t *port_id)\n int\n rte_eth_dev_attach_private(const char *devargs, uint16_t *port_id)\n {\n-\n \tif (rte_eal_process_type() == RTE_PROC_PRIMARY)\n \t\treturn -ENOTSUP;\n \n@@ -845,6 +846,10 @@ rte_eth_dev_detach(uint16_t port_id, char *name __rte_unused)\n \t\treturn req.result;\n \t}\n \n+\tret = process_lock_callbacks(port_id);\n+\tif (ret)\n+\t\treturn ret;\n+\n \t/* check pre_detach */\n \treq.t = REQ_TYPE_PRE_DETACH;\n \treq.port_id = port_id;\n@@ -891,6 +896,7 @@ int\n rte_eth_dev_detach_private(uint16_t port_id, char *name __rte_unused)\n {\n \tuint32_t dev_flags;\n+\tint ret;\n \n \tif (rte_eal_process_type() == RTE_PROC_PRIMARY)\n \t\treturn -ENOTSUP;\n@@ -904,6 +910,10 @@ rte_eth_dev_detach_private(uint16_t port_id, char *name __rte_unused)\n \t\treturn -ENOTSUP;\n \t}\n \n+\tret = process_lock_callbacks(port_id);\n+\tif (ret)\n+\t\treturn ret;\n+\n \treturn do_eth_dev_detach(port_id);\n }\n \n@@ -4706,6 +4716,54 @@ rte_eth_devargs_parse(const char *dargs, struct rte_eth_devargs *eth_da)\n \treturn result;\n }\n \n+static int\n+dev_is_busy(uint16_t port_id __rte_unused, void *user_args __rte_unused)\n+{\n+\treturn -EBUSY;\n+}\n+\n+int\n+rte_eth_dev_lock(uint16_t port_id)\n+{\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\n+\treturn register_lock_callback(port_id, dev_is_busy, NULL);\n+}\n+\n+int\n+rte_eth_dev_lock_with_callback(uint16_t port_id,\n+\t\t\t\trte_eth_dev_lock_callback_t callback,\n+\t\t\t\tvoid *user_args)\n+{\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\n+\tif (callback == NULL)\n+\t\treturn -EINVAL;\n+\n+\treturn register_lock_callback(port_id, callback, user_args);\n+}\n+\n+int\n+rte_eth_dev_unlock(uint16_t port_id)\n+{\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\n+\treturn unregister_lock_callback(port_id, dev_is_busy, NULL);\n+}\n+\n+int\n+rte_eth_dev_unlock_with_callback(uint16_t port_id,\n+\t\t\t\trte_eth_dev_lock_callback_t callback,\n+\t\t\t\tvoid *user_args)\n+{\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\n+\tif (callback == NULL)\n+\t\treturn -EINVAL;\n+\n+\treturn unregister_lock_callback(port_id, callback, user_args);\n+}\n+\n RTE_INIT(ethdev_init_log);\n static void\n ethdev_init_log(void)\ndiff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h\nindex 4d207e2fe..b2c2de600 100644\n--- a/lib/librte_ethdev/rte_ethdev.h\n+++ b/lib/librte_ethdev/rte_ethdev.h\n@@ -4364,6 +4364,130 @@ rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,\n \treturn rte_eth_tx_buffer_flush(port_id, queue_id, buffer);\n }\n \n+/**\n+ * Callback function before device is detached.\n+ *\n+ * This type of function will be added into a function list, and will be\n+ * invoked before device be detached. Application can register a callback\n+ * function so it can be notified and do some cleanup before detach happen.\n+ * Also, any callback function return !0 value will prevent device be\n+ * detached (ref. rte_eth_dev_lock_with_callback and\n+ * rte_eth_dev_unlock_with_callback).\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param user_args\n+ *   This is parameter \"user_args\" be saved when callback function is\n+ *   registered(rte_dev_eth_lock).\n+ *\n+ * @return\n+ *   0  device is allowed be detached.\n+ *   !0 device is not allowed be detached.\n+ */\n+typedef int (*rte_eth_dev_lock_callback_t)(uint16_t port_id, void *user_args);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Lock an Ethernet Device, this help application to prevent a device\n+ * be detached unexpectedly.\n+ *\n+ * @note\n+ *   In multi-process situation, any process lock a share device will\n+ *   prevent it be detached from all process. Also this is per-process\n+ *   lock, which means unlock a device from process A take no effect\n+ *   if the device is locked from process B.\n+ *\n+ * @note\n+ *   Lock a device multiple times will increase a ref_count, and\n+ *   corresponding unlock decrease the ref_count, the device will be\n+ *   unlocked when ref_count reach 0.\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ *\n+ * @return\n+ *   0 on success, negative on error.\n+ */\n+int __rte_experimental rte_eth_dev_lock(uint16_t port_id);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Lock an Ethernet device base on a callback function which can performs\n+ * condition check at the moment before device be detached. if the\n+ * condition check not pass, the device will not be detached, else,\n+ * continue to detach or not rely on return value of other callbacks\n+ * on the same port.\n+ *\n+ * @note\n+ *   Same as rte_eth_dev_lock, it is per-process lock.\n+ *\n+ * @note\n+ *   Lock a device with different callback or user_args will add different\n+ *   lock entries (<callback, user_args> pair) in a list. Lock a device\n+ *   multiple times with same callback and args will only increase a\n+ *   ref_count of specific lock entry, and corresponding unlock decrease\n+ *   the ref_count, an entry will be removed if its ref_count reach 0.\n+ *\n+ * @note\n+ *   All callbacks be attached to specific port will be removed\n+ *   automatically if the device is detached.\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param callback\n+ *   the callback function will be added into a pre-detach list,\n+ *   it will be invoked when a device is going to be detached. The\n+ *   return value will decide if continue detach the device or not.\n+ * @param user_args\n+ *   parameter will be parsed to callback function.\n+ *\n+ * @return\n+ *   0 on success, negative on error.\n+ */\n+int __rte_experimental\n+rte_eth_dev_lock_with_callback(uint16_t port_id,\n+\t\t\t\trte_eth_dev_lock_callback_t callback,\n+\t\t\t\tvoid *user_args);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Reverse operation of rte_eth_dev_lock.\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ *\n+ * @return\n+ *   0 on success, negative on error.\n+ */\n+int __rte_experimental rte_eth_dev_unlock(uint16_t port_id);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Reverse operation of rte_eth_dev_lock_with_callback.\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param callback\n+ *   parameter to match a lock entry.\n+ * @param user_args\n+ *   parameter to match a lock entry.\n+ *\n+ * @return\n+ *   0 on success, negative on error.\n+ */\n+int __rte_experimental\n+rte_eth_dev_unlock_with_callback(uint16_t port_id,\n+\t\t\t\trte_eth_dev_lock_callback_t callback,\n+\t\t\t\tvoid *user_args);\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map\nindex fbcc03925..1e270a387 100644\n--- a/lib/librte_ethdev/rte_ethdev_version.map\n+++ b/lib/librte_ethdev/rte_ethdev_version.map\n@@ -225,6 +225,7 @@ EXPERIMENTAL {\n \trte_eth_dev_get_module_eeprom;\n \trte_eth_dev_get_module_info;\n \trte_eth_dev_is_removed;\n+\trte_eth_dev_lock;\n \trte_eth_dev_owner_delete;\n \trte_eth_dev_owner_get;\n \trte_eth_dev_owner_new;\n@@ -232,6 +233,7 @@ EXPERIMENTAL {\n \trte_eth_dev_owner_unset;\n \trte_eth_dev_rx_offload_name;\n \trte_eth_dev_tx_offload_name;\n+\trte_eth_dev_unlock;\n \trte_eth_switch_domain_alloc;\n \trte_eth_switch_domain_free;\n \trte_mtr_capabilities_get;\n",
    "prefixes": [
        "v8",
        "04/19"
    ]
}