get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 41326,
    "url": "https://patches.dpdk.org/api/patches/41326/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20180621020059.1198-23-qi.z.zhang@intel.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": "<20180621020059.1198-23-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180621020059.1198-23-qi.z.zhang@intel.com",
    "date": "2018-06-21T02:00:59",
    "name": "[v2,22/22] examples/devmgm_mp: add simple device management sample",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8e0d205251748dff76f1c6f30c0ae8d3ec34298c",
    "submitter": {
        "id": 504,
        "url": "https://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20180621020059.1198-23-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 184,
            "url": "https://patches.dpdk.org/api/series/184/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=184",
            "date": "2018-06-21T02:00:39",
            "name": "enable hotplug on multi-process",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/184/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/41326/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/41326/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 A48CE1B902;\n\tThu, 21 Jun 2018 04:02:16 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id DAC471B8C6\n\tfor <dev@dpdk.org>; Thu, 21 Jun 2018 04:02:04 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t20 Jun 2018 19:01:02 -0700",
            "from dpdk51.sh.intel.com ([10.67.110.190])\n\tby fmsmga004.fm.intel.com with ESMTP; 20 Jun 2018 19:01:00 -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,249,1526367600\"; d=\"scan'208\";a=\"64994023\"",
        "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": "Thu, 21 Jun 2018 10:00:59 +0800",
        "Message-Id": "<20180621020059.1198-23-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20180621020059.1198-1-qi.z.zhang@intel.com>",
        "References": "<20180607123849.14439-1-qi.z.zhang@intel.com>\n\t<20180621020059.1198-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 22/22] examples/devmgm_mp: add simple device\n\tmanagement sample",
        "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": "The sample code demonstrate device (ethdev only) management\nat multi-process envrionment. User can attach/detach a device\non primary process and see it is synced on secondary process\nautomatically, also user can lock a device to prevent it be\ndetached or unlock it to go back to default behaviour.\n\nHow to start?\n./devmgm_mp --proc-type=auto\n\nCommand Line Example:\n\n>help\n>list\n\n/* attach a af_packet vdev */\n>attach net_af_packet,iface=eth0\n\n/* detach port 0 */\n>detach 0\n\n/* attach a private af_packet vdev (secondary process only)*/\n>attachp net_af_packet,iface=eth0\n\n/* detach a private device (secondary process only) */\n>detachp 0\n\n/* lock port 0 */\n>lock 0\n\n/* unlock port 0 */\n>unlock 0\n\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n examples/devmgm_mp/Makefile    |  64 +++++++\n examples/devmgm_mp/commands.c  | 381 +++++++++++++++++++++++++++++++++++++++++\n examples/devmgm_mp/commands.h  |  10 ++\n examples/devmgm_mp/main.c      |  39 +++++\n examples/devmgm_mp/meson.build |  11 ++\n 5 files changed, 505 insertions(+)\n create mode 100644 examples/devmgm_mp/Makefile\n create mode 100644 examples/devmgm_mp/commands.c\n create mode 100644 examples/devmgm_mp/commands.h\n create mode 100644 examples/devmgm_mp/main.c\n create mode 100644 examples/devmgm_mp/meson.build",
    "diff": "diff --git a/examples/devmgm_mp/Makefile b/examples/devmgm_mp/Makefile\nnew file mode 100644\nindex 000000000..0ad3ec80e\n--- /dev/null\n+++ b/examples/devmgm_mp/Makefile\n@@ -0,0 +1,64 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2018 Intel Corporation\n+\n+# binary name\n+APP = devmgm_mp\n+\n+# all source are stored in SRCS-y\n+SRCS-y := main.c commands.c\n+\n+# Build using pkg-config variables if possible\n+$(shell pkg-config --exists libdpdk)\n+ifeq ($(.SHELLSTATUS),0)\n+\n+all: shared\n+.PHONY: shared static\n+shared: build/$(APP)-shared\n+\tln -sf $(APP)-shared build/$(APP)\n+static: build/$(APP)-static\n+\tln -sf $(APP)-static build/$(APP)\n+\n+PC_FILE := $(shell pkg-config --path libdpdk)\n+CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)\n+LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)\n+LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)\n+\n+build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build\n+\t$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)\n+\n+build/$(APP)-static: $(SRCS-y) Makefile $(PC_FILE) | build\n+\t$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_STATIC)\n+\n+build:\n+\t@mkdir -p $@\n+\n+.PHONY: clean\n+clean:\n+\trm -f build/$(APP) build/$(APP)-static build/$(APP)-shared\n+\trmdir --ignore-fail-on-non-empty build\n+\n+else\n+\n+ifeq ($(RTE_SDK),)\n+$(error \"Please define RTE_SDK environment variable\")\n+endif\n+\n+# Default target, can be overridden by command line or environment\n+RTE_TARGET ?= x86_64-native-linuxapp-gcc\n+\n+include $(RTE_SDK)/mk/rte.vars.mk\n+\n+# binary name\n+APP = devmgm_mp\n+\n+# all source are stored in SRCS-y\n+SRCS-y := main.c commands.c\n+\n+CFLAGS += -O3\n+CFLAGS += -DALLOW_EXPERIMENTAL_API\n+CFLAGS += $(WERROR_FLAGS)\n+CFLAGS_parse_obj_list.o := -D_GNU_SOURCE\n+\n+include $(RTE_SDK)/mk/rte.extapp.mk\n+\n+endif\ndiff --git a/examples/devmgm_mp/commands.c b/examples/devmgm_mp/commands.c\nnew file mode 100644\nindex 000000000..11eb66730\n--- /dev/null\n+++ b/examples/devmgm_mp/commands.c\n@@ -0,0 +1,381 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018 Intel Corporation.\n+ */\n+\n+#include <stdio.h>\n+#include <stdint.h>\n+#include <string.h>\n+#include <stdlib.h>\n+#include <stdarg.h>\n+#include <errno.h>\n+#include <netinet/in.h>\n+#include <termios.h>\n+#ifndef __linux__\n+\t#ifdef __FreeBSD__\n+\t\t#include <sys/socket.h>\n+\t#else\n+\t\t#include <net/socket.h>\n+\t#endif\n+#endif\n+\n+#include <cmdline_rdline.h>\n+#include <cmdline_parse.h>\n+#include <cmdline_parse_ipaddr.h>\n+#include <cmdline_parse_num.h>\n+#include <cmdline_parse_string.h>\n+#include <cmdline.h>\n+#include <rte_ethdev.h>\n+\n+/**********************************************************/\n+\n+struct cmd_help_result {\n+\tcmdline_fixed_string_t help;\n+};\n+\n+static void cmd_help_parsed(__attribute__((unused)) void *parsed_result,\n+\t\t\t    struct cmdline *cl,\n+\t\t\t    __attribute__((unused)) void *data)\n+{\n+\tcmdline_printf(cl,\n+\t\t       \"commands:\\n\"\n+\t\t       \"- attach <devargs>\\n\"\n+\t\t       \"- detach <port_id>\\n\"\n+\t\t       \"- attachp <devargs>\\n\"\n+\t\t       \"- detachp <port_id>\\n\"\n+\t\t       \"- lock <port_id>\\n\"\n+\t\t       \"- unlock <port_id>\\n\"\n+\t\t       \"- list\\n\\n\");\n+}\n+\n+cmdline_parse_token_string_t cmd_help_help =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_help_result, help, \"help\");\n+\n+cmdline_parse_inst_t cmd_help = {\n+\t.f = cmd_help_parsed,  /* function to call */\n+\t.data = NULL,      /* 2nd arg of func */\n+\t.help_str = \"show help\",\n+\t.tokens = {        /* token list, NULL terminated */\n+\t\t(void *)&cmd_help_help,\n+\t\tNULL,\n+\t},\n+};\n+\n+/**********************************************************/\n+\n+struct cmd_quit_result {\n+\tcmdline_fixed_string_t quit;\n+};\n+\n+static void cmd_quit_parsed(__attribute__((unused)) void *parsed_result,\n+\t\t\t    struct cmdline *cl,\n+\t\t\t    __attribute__((unused)) void *data)\n+{\n+\tcmdline_quit(cl);\n+}\n+\n+cmdline_parse_token_string_t cmd_quit_quit =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_quit_result, quit, \"quit\");\n+\n+cmdline_parse_inst_t cmd_quit = {\n+\t.f = cmd_quit_parsed,  /* function to call */\n+\t.data = NULL,      /* 2nd arg of func */\n+\t.help_str = \"quit\",\n+\t.tokens = {        /* token list, NULL terminated */\n+\t\t(void *)&cmd_quit_quit,\n+\t\tNULL,\n+\t},\n+};\n+\n+/**********************************************************/\n+\n+struct cmd_list_result {\n+\tcmdline_fixed_string_t list;\n+};\n+\n+static void cmd_list_parsed(__attribute__((unused)) void *parsed_result,\n+\t\t\t    struct cmdline *cl,\n+\t\t\t    __attribute__((unused)) void *data)\n+{\n+\tuint16_t port_id;\n+\tchar dev_name[RTE_DEV_NAME_MAX_LEN];\n+\n+\tcmdline_printf(cl, \"list all etherdev\\n\");\n+\n+\tRTE_ETH_FOREACH_DEV(port_id) {\n+\t\trte_eth_dev_get_name_by_port(port_id, dev_name);\n+\t\t/* Secondary process's ethdev->state may not be\n+\t\t * updated after detach on primary process,  but\n+\t\t * ethdev->data should already be reset, so\n+\t\t * use strlen(dev_name) == 0 to know the port is\n+\t\t * not used.\n+\t\t *\n+\t\t * TODO: Secondary process should be informed when a\n+\t\t * port is released on primary through mp channel.\n+\t\t */\n+\t\tif (strlen(dev_name) > 0)\n+\t\t\tcmdline_printf(cl, \"%d\\t%s\\n\", port_id, dev_name);\n+\t\telse\n+\t\t\tprintf(\"empty dev_name is not expected!\\n\");\n+\t}\n+}\n+\n+cmdline_parse_token_string_t cmd_list_list =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_list_result, list, \"list\");\n+\n+cmdline_parse_inst_t cmd_list = {\n+\t.f = cmd_list_parsed,  /* function to call */\n+\t.data = NULL,      /* 2nd arg of func */\n+\t.help_str = \"list all devices\",\n+\t.tokens = {        /* token list, NULL terminated */\n+\t\t(void *)&cmd_list_list,\n+\t\tNULL,\n+\t},\n+};\n+\n+/**********************************************************/\n+\n+struct cmd_dev_attach_result {\n+\tcmdline_fixed_string_t attach;\n+\tcmdline_fixed_string_t device;\n+};\n+\n+static void cmd_dev_attach_parsed(void *parsed_result,\n+\t\t\t\t  struct cmdline *cl,\n+\t\t\t\t  __attribute__((unused)) void *data)\n+{\n+\tstruct cmd_dev_attach_result *res = parsed_result;\n+\tuint16_t port_id;\n+\n+\tif (!rte_eth_dev_attach(res->device, &port_id))\n+\t\tcmdline_printf(cl, \"attached device %s at port %d\\n\",\n+\t\t\tres->device, port_id);\n+\telse\n+\t\tcmdline_printf(cl, \"failed to attached device %s\\n\",\n+\t\t\tres->device);\n+}\n+\n+cmdline_parse_token_string_t cmd_dev_attach_attach =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_dev_attach_result, attach,\n+\t\t\t\t \"attach\");\n+cmdline_parse_token_string_t cmd_dev_attach_device =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_dev_attach_result, device, NULL);\n+\n+cmdline_parse_inst_t cmd_attach_device = {\n+\t.f = cmd_dev_attach_parsed,  /* function to call */\n+\t.data = NULL,      /* 2nd arg of func */\n+\t.help_str = \"attach a device\",\n+\t.tokens = {        /* token list, NULL terminated */\n+\t\t(void *)&cmd_dev_attach_attach,\n+\t\t(void *)&cmd_dev_attach_device,\n+\t\tNULL,\n+\t},\n+};\n+\n+/**********************************************************/\n+\n+struct cmd_dev_attachp_result {\n+\tcmdline_fixed_string_t attachp;\n+\tcmdline_fixed_string_t device;\n+};\n+\n+static void cmd_dev_attachp_parsed(void *parsed_result,\n+\t\t\t\t   struct cmdline *cl,\n+\t\t\t\t   __attribute__((unused)) void *data)\n+{\n+\tstruct cmd_dev_attachp_result *res = parsed_result;\n+\tuint16_t port_id;\n+\n+\tif (!rte_eth_dev_attach_private(res->device, &port_id))\n+\t\tcmdline_printf(cl, \"attached prviate device %s at port %d\\n\",\n+\t\t\tres->device, port_id);\n+\telse\n+\t\tcmdline_printf(cl, \"failed to attached private device %s\\n\",\n+\t\t\tres->device);\n+}\n+\n+cmdline_parse_token_string_t cmd_dev_attachp_attachp =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_dev_attachp_result, attachp,\n+\t\t\t\t \"attachp\");\n+cmdline_parse_token_string_t cmd_dev_attachp_device =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_dev_attachp_result, device, NULL);\n+\n+cmdline_parse_inst_t cmd_attachp_device = {\n+\t.f = cmd_dev_attachp_parsed,  /* function to call */\n+\t.data = NULL,      /* 2nd arg of func */\n+\t.help_str = \"attach a private device\",\n+\t.tokens = {        /* token list, NULL terminated */\n+\t\t(void *)&cmd_dev_attachp_attachp,\n+\t\t(void *)&cmd_dev_attachp_device,\n+\t\tNULL,\n+\t},\n+};\n+\n+/**********************************************************/\n+\n+struct cmd_dev_detach_result {\n+\tcmdline_fixed_string_t detach;\n+\tuint16_t port_id;\n+};\n+\n+static void cmd_dev_detach_parsed(void *parsed_result,\n+\t\t\t\t   struct cmdline *cl,\n+\t\t\t\t   __attribute__((unused)) void *data)\n+{\n+\tstruct cmd_dev_detach_result *res = parsed_result;\n+\tuint16_t port_id = res->port_id;\n+\tchar dev_name[RTE_DEV_NAME_MAX_LEN];\n+\n+\tprintf(\"detaching...\\n\");\n+\tif (!rte_eth_dev_detach(port_id, dev_name))\n+\t\tcmdline_printf(cl, \"detached device at port %d\\n\",\n+\t\t\tport_id);\n+\telse\n+\t\tcmdline_printf(cl, \"failed to dettached at port %d\\n\",\n+\t\t\tport_id);\n+}\n+\n+cmdline_parse_token_string_t cmd_dev_detach_detach =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_dev_detach_result, detach,\n+\t\t\t\t \"detach\");\n+cmdline_parse_token_num_t cmd_dev_detach_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_dev_detach_result, port_id, UINT16);\n+\n+cmdline_parse_inst_t cmd_detach_device = {\n+\t.f = cmd_dev_detach_parsed,  /* function to call */\n+\t.data = NULL,      /* 2nd arg of func */\n+\t.help_str = \"detach a device\",\n+\t.tokens = {        /* token list, NULL terminated */\n+\t\t(void *)&cmd_dev_detach_detach,\n+\t\t(void *)&cmd_dev_detach_port_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/**********************************************************/\n+\n+struct cmd_dev_detachp_result {\n+\tcmdline_fixed_string_t detachp;\n+\tuint16_t port_id;\n+};\n+\n+static void cmd_dev_detachp_parsed(void *parsed_result,\n+\t\t\t\t   struct cmdline *cl,\n+\t\t\t\t   __attribute__((unused)) void *data)\n+{\n+\tstruct cmd_dev_detachp_result *res = parsed_result;\n+\tuint16_t port_id = res->port_id;\n+\tchar dev_name[RTE_DEV_NAME_MAX_LEN];\n+\n+\tprintf(\"detaching...\\n\");\n+\tif (!rte_eth_dev_detach_private(port_id, dev_name))\n+\t\tcmdline_printf(cl, \"detached private device at port %d\\n\",\n+\t\t\tport_id);\n+\telse\n+\t\tcmdline_printf(cl, \"failed to detach private device at port %d\\n\",\n+\t\t\tport_id);\n+}\n+\n+cmdline_parse_token_string_t cmd_dev_detachp_detachp =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_dev_detachp_result, detachp,\n+\t\t\t\t \"detachp\");\n+cmdline_parse_token_num_t cmd_dev_detachp_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_dev_detachp_result, port_id, UINT16);\n+\n+cmdline_parse_inst_t cmd_detachp_device = {\n+\t.f = cmd_dev_detachp_parsed,  /* function to call */\n+\t.data = NULL,      /* 2nd arg of func */\n+\t.help_str = \"detach a private device\",\n+\t.tokens = {        /* token list, NULL terminated */\n+\t\t(void *)&cmd_dev_detachp_detachp,\n+\t\t(void *)&cmd_dev_detachp_port_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/**********************************************************/\n+\n+struct cmd_dev_lock_result {\n+\tcmdline_fixed_string_t lock;\n+\tuint16_t port_id;\n+};\n+\n+static void cmd_dev_lock_parsed(void *parsed_result,\n+\t\t\t\tstruct cmdline *cl,\n+\t\t\t\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_dev_lock_result *res = parsed_result;\n+\tuint16_t port_id = res->port_id;\n+\tint ret = 0;\n+\n+\tret = rte_eth_dev_lock(res->port_id);\n+\tcmdline_printf(cl, \"lock port %d, ret = %d\\n\", port_id, ret);\n+}\n+\n+cmdline_parse_token_string_t cmd_dev_lock_lock =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_dev_lock_result, lock, \"lock\");\n+cmdline_parse_token_num_t cmd_dev_lock_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_dev_lock_result, port_id, UINT16);\n+\n+cmdline_parse_inst_t cmd_lock_device = {\n+\t.f = cmd_dev_lock_parsed,  /* function to call */\n+\t.data = NULL,      /* 2nd arg of func */\n+\t.help_str = \"lock a device\",\n+\t.tokens = {        /* token list, NULL terminated */\n+\t\t(void *)&cmd_dev_lock_lock,\n+\t\t(void *)&cmd_dev_lock_port_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/**********************************************************/\n+\n+struct cmd_dev_unlock_result {\n+\tcmdline_fixed_string_t unlock;\n+\tuint16_t port_id;\n+};\n+\n+static void cmd_dev_unlock_parsed(void *parsed_result,\n+\t\t\t\t  struct cmdline *cl,\n+\t\t\t\t  __attribute__((unused)) void *data)\n+{\n+\tstruct cmd_dev_unlock_result *res = parsed_result;\n+\tuint16_t port_id = res->port_id;\n+\tint ret = 0;\n+\n+\tret = rte_eth_dev_unlock(res->port_id);\n+\tcmdline_printf(cl, \"unlock port %d, ret = %d\\n\", port_id, ret);\n+}\n+\n+cmdline_parse_token_string_t cmd_dev_unlock_unlock =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_dev_unlock_result, unlock,\n+\t\t\t\t \"unlock\");\n+cmdline_parse_token_num_t cmd_dev_unlock_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_dev_unlock_result, port_id, UINT16);\n+\n+cmdline_parse_inst_t cmd_unlock_device = {\n+\t.f = cmd_dev_unlock_parsed,  /* function to call */\n+\t.data = NULL,      /* 2nd arg of func */\n+\t.help_str = \"unlock a device\",\n+\t.tokens = {        /* token list, NULL terminated */\n+\t\t(void *)&cmd_dev_unlock_unlock,\n+\t\t(void *)&cmd_dev_unlock_port_id,\n+\t\tNULL,\n+\t},\n+};\n+\n+/**********************************************************/\n+/**********************************************************/\n+/****** CONTEXT (list of instruction) */\n+\n+cmdline_parse_ctx_t main_ctx[] = {\n+\t(cmdline_parse_inst_t *)&cmd_help,\n+\t(cmdline_parse_inst_t *)&cmd_quit,\n+\t(cmdline_parse_inst_t *)&cmd_list,\n+\t(cmdline_parse_inst_t *)&cmd_attach_device,\n+\t(cmdline_parse_inst_t *)&cmd_detach_device,\n+\t(cmdline_parse_inst_t *)&cmd_attachp_device,\n+\t(cmdline_parse_inst_t *)&cmd_detachp_device,\n+\t(cmdline_parse_inst_t *)&cmd_lock_device,\n+\t(cmdline_parse_inst_t *)&cmd_unlock_device,\n+\tNULL,\n+};\ndiff --git a/examples/devmgm_mp/commands.h b/examples/devmgm_mp/commands.h\nnew file mode 100644\nindex 000000000..afcf177db\n--- /dev/null\n+++ b/examples/devmgm_mp/commands.h\n@@ -0,0 +1,10 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018 Intel Corporation\n+ */\n+\n+#ifndef _COMMANDS_H_\n+#define _COMMANDS_H_\n+\n+extern cmdline_parse_ctx_t main_ctx[];\n+\n+#endif /* _COMMANDS_H_ */\ndiff --git a/examples/devmgm_mp/main.c b/examples/devmgm_mp/main.c\nnew file mode 100644\nindex 000000000..9bf0c9962\n--- /dev/null\n+++ b/examples/devmgm_mp/main.c\n@@ -0,0 +1,39 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018 Intel Corporation\n+ */\n+\n+#include <stdio.h>\n+#include <string.h>\n+#include <stdint.h>\n+#include <errno.h>\n+#include <termios.h>\n+#include <sys/queue.h>\n+\n+#include <cmdline_rdline.h>\n+#include <cmdline_parse.h>\n+#include <cmdline_socket.h>\n+#include <cmdline.h>\n+\n+#include <rte_memory.h>\n+#include <rte_eal.h>\n+#include <rte_debug.h>\n+\n+#include \"commands.h\"\n+\n+int main(int argc, char **argv)\n+{\n+\tint ret;\n+\tstruct cmdline *cl;\n+\n+\tret = rte_eal_init(argc, argv);\n+\tif (ret < 0)\n+\t\trte_panic(\"Cannot init EAL\\n\");\n+\n+\tcl = cmdline_stdin_new(main_ctx, \"example> \");\n+\tif (cl == NULL)\n+\t\trte_panic(\"Cannot create cmdline instance\\n\");\n+\tcmdline_interact(cl);\n+\tcmdline_stdin_exit(cl);\n+\n+\treturn 0;\n+}\ndiff --git a/examples/devmgm_mp/meson.build b/examples/devmgm_mp/meson.build\nnew file mode 100644\nindex 000000000..cec7be717\n--- /dev/null\n+++ b/examples/devmgm_mp/meson.build\n@@ -0,0 +1,11 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2018 Intel Corporation\n+\n+# meson file, for building this example as part of a main DPDK build.\n+#\n+# To build this example as a standalone application with an already-installed\n+# DPDK instance, use 'make'\n+\n+sources = files(\n+\t'commands.c', 'main.c'\n+)\n",
    "prefixes": [
        "v2",
        "22/22"
    ]
}