Show a patch.

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

{
    "id": 40766,
    "url": "http://patches.dpdk.org/api/patches/40766/",
    "web_url": "http://patches.dpdk.org/patch/40766/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20180607123849.14439-23-qi.z.zhang@intel.com>",
    "date": "2018-06-07T12:38:49",
    "name": "[dpdk-dev,22/22] examples/devmgm_mp: add simple device management sample",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2f910c7355994066dc3c0a961263ee9003a36318",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/",
        "name": "Zhang, Qi Z",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/patch/40766/mbox/",
    "series": [
        {
            "id": 30,
            "url": "http://patches.dpdk.org/api/series/30/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30",
            "date": "2018-06-07T12:38:27",
            "name": "enable hotplug on multi-process",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/30/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/40766/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/40766/checks/",
    "tags": {},
    "headers": {
        "X-Mailman-Version": "2.1.15",
        "X-ExtLoop1": "1",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Mailer": "git-send-email 2.13.6",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 405AC1B685;\n\tThu,  7 Jun 2018 14:39:08 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 4B5911B66E\n\tfor <dev@dpdk.org>; Thu,  7 Jun 2018 14:39:04 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t07 Jun 2018 05:39:03 -0700",
            "from dpdk51.sh.intel.com ([10.67.110.184])\n\tby orsmga001.jf.intel.com with ESMTP; 07 Jun 2018 05:39:02 -0700"
        ],
        "References": "<20180607123849.14439-1-qi.z.zhang@intel.com>",
        "X-Amp-File-Uploaded": "False",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<20180607123849.14439-23-qi.z.zhang@intel.com>",
        "X-IronPort-AV": "E=Sophos;i=\"5.49,486,1520924400\"; d=\"scan'208\";a=\"62605697\"",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Precedence": "list",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "In-Reply-To": "<20180607123849.14439-1-qi.z.zhang@intel.com>",
        "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "To": "thomas@monjalon.net,\n\tanatoly.burakov@intel.com",
        "Delivered-To": "patchwork@dpdk.org",
        "List-Unsubscribe": "<https://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Date": "Thu,  7 Jun 2018 20:38:49 +0800",
        "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>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "Subject": "[dpdk-dev] [PATCH 22/22] examples/devmgm_mp: add simple device\n\tmanagement sample"
    },
    "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  | 383 +++++++++++++++++++++++++++++++++++++++++\n examples/devmgm_mp/commands.h  |  10 ++\n examples/devmgm_mp/main.c      |  41 +++++\n examples/devmgm_mp/meson.build |  11 ++\n 5 files changed, 509 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..e6c0cb0c5\n--- /dev/null\n+++ b/examples/devmgm_mp/Makefile\n@@ -0,0 +1,64 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2010-2014 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..145cb766e\n--- /dev/null\n+++ b/examples/devmgm_mp/commands.c\n@@ -0,0 +1,383 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2010-2014 Intel Corporation.\n+ * Copyright (c) 2009, Olivier MATZ <zer0@droids-corp.org>\n+ * All rights reserved.\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, NULL, NULL);\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, NULL, NULL);\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..791204547\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) 2010-2014 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..f2f2e5a2f\n--- /dev/null\n+++ b/examples/devmgm_mp/main.c\n@@ -0,0 +1,41 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2010-2014 Intel Corporation.\n+ * Copyright (c) 2009, Olivier MATZ <zer0@droids-corp.org>\n+ * All rights reserved.\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..f916eb9af\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) 2017 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": [
        "dpdk-dev",
        "22/22"
    ]
}