get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 69026,
    "url": "http://patches.dpdk.org/api/patches/69026/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200421123949.38270-16-ciara.power@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": "<20200421123949.38270-16-ciara.power@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200421123949.38270-16-ciara.power@intel.com",
    "date": "2020-04-21T12:39:47",
    "name": "[v3,15/17] eal: remove rte-option infrastructure",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4baf4169c6c58231e52fcecb39b6c9e68cf3666a",
    "submitter": {
        "id": 978,
        "url": "http://patches.dpdk.org/api/people/978/?format=api",
        "name": "Power, Ciara",
        "email": "ciara.power@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/20200421123949.38270-16-ciara.power@intel.com/mbox/",
    "series": [
        {
            "id": 9543,
            "url": "http://patches.dpdk.org/api/series/9543/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=9543",
            "date": "2020-04-21T12:39:32",
            "name": "update and simplify telemetry library.",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/9543/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/69026/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/69026/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 3BDB5A0597;\n\tTue, 21 Apr 2020 15:03:37 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 4F5611D5A8;\n\tTue, 21 Apr 2020 15:00:08 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by dpdk.org (Postfix) with ESMTP id D23071D64E\n for <dev@dpdk.org>; Tue, 21 Apr 2020 15:00:01 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 21 Apr 2020 06:00:01 -0700",
            "from silpixa00399953.ir.intel.com (HELO\n silpixa00399953.ger.corp.intel.com) ([10.237.222.53])\n by fmsmga004.fm.intel.com with ESMTP; 21 Apr 2020 05:59:59 -0700"
        ],
        "IronPort-SDR": [
            "\n RdY6b+q/2Pgs+eB/vMogxWPj+nn6UqUYtdLomhRoVHmI7YumkOmi8s+C86GS93TYmkrgvW5kiF\n YEbalQDyzXUA==",
            "\n 8JGSwuDec53kowrqyyZyoM1Y6sOGJ6T7dM46HIf8Y0FwE42HZLqggjDZbKx8zT/uJ72AHWim5o\n vWdU7smrGIXA=="
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.72,410,1580803200\"; d=\"scan'208\";a=\"279629226\"",
        "From": "Ciara Power <ciara.power@intel.com>",
        "To": "dev@dpdk.org,\n\tkevin.laatz@intel.com",
        "Cc": "reshma.pattan@intel.com, jerinjacobk@gmail.com, david.marchand@redhat.com,\n keith.wiles@intel.com, mb@smartsharesystems.com, thomas@monjalon.net,\n Ciara Power <ciara.power@intel.com>",
        "Date": "Tue, 21 Apr 2020 13:39:47 +0100",
        "Message-Id": "<20200421123949.38270-16-ciara.power@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200421123949.38270-1-ciara.power@intel.com>",
        "References": "<20200319171907.60891-1-ciara.power@intel.com>\n <20200421123949.38270-1-ciara.power@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3 15/17] eal: remove rte-option infrastructure",
        "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "As Telemetry no longer uses rte_option, and was the only user of this\ninfrastructure, it can now be removed.\n\nSigned-off-by: Ciara Power <ciara.power@intel.com>\n---\n lib/librte_eal/common/eal_common_options.c |  1 -\n lib/librte_eal/common/eal_private.h        | 28 -------\n lib/librte_eal/common/meson.build          |  2 -\n lib/librte_eal/common/rte_option.c         | 95 ----------------------\n lib/librte_eal/freebsd/Makefile            |  1 -\n lib/librte_eal/freebsd/eal.c               | 14 +---\n lib/librte_eal/include/meson.build         |  1 -\n lib/librte_eal/include/rte_option.h        | 72 ----------------\n lib/librte_eal/linux/Makefile              |  1 -\n lib/librte_eal/linux/eal.c                 | 14 +---\n lib/librte_eal/rte_eal_version.map         |  1 -\n 11 files changed, 2 insertions(+), 228 deletions(-)\n delete mode 100644 lib/librte_eal/common/rte_option.c\n delete mode 100644 lib/librte_eal/include/rte_option.h",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex fa3298dcca..e722064c27 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -1714,5 +1714,4 @@ eal_common_usage(void)\n \t       \"  --\"OPT_NO_HPET\"           Disable HPET\\n\"\n \t       \"  --\"OPT_NO_SHCONF\"         No shared config (mmap'd files)\\n\"\n \t       \"\\n\", RTE_MAX_LCORE);\n-\trte_option_usage();\n }\ndiff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h\nindex 8536ed70bb..5550beaae3 100644\n--- a/lib/librte_eal/common/eal_private.h\n+++ b/lib/librte_eal/common/eal_private.h\n@@ -409,34 +409,6 @@ dev_sigbus_handler_register(void);\n int\n dev_sigbus_handler_unregister(void);\n \n-/**\n- * Check if the option is registered.\n- *\n- * @param option\n- *  The option to be parsed.\n- *\n- * @return\n- *  0 on success\n- * @return\n- *  -1 on fail\n- */\n-int\n-rte_option_parse(const char *opt);\n-\n-/**\n- * Iterate through the registered options and execute the associated\n- * callback if enabled.\n- */\n-void\n-rte_option_init(void);\n-\n-/**\n- * Iterate through the registered options and show the associated\n- * usage string.\n- */\n-void\n-rte_option_usage(void);\n-\n /**\n  * Get OS-specific EAL mapping base address.\n  */\ndiff --git a/lib/librte_eal/common/meson.build b/lib/librte_eal/common/meson.build\nindex 02d9280cc3..22b95d10e3 100644\n--- a/lib/librte_eal/common/meson.build\n+++ b/lib/librte_eal/common/meson.build\n@@ -14,7 +14,6 @@ if is_windows\n \t\t'eal_common_log.c',\n \t\t'eal_common_options.c',\n \t\t'eal_common_thread.c',\n-\t\t'rte_option.c',\n \t)\n \tsubdir_done()\n endif\n@@ -49,7 +48,6 @@ sources += files(\n \t'malloc_mp.c',\n \t'rte_keepalive.c',\n \t'rte_malloc.c',\n-\t'rte_option.c',\n \t'rte_random.c',\n \t'rte_reciprocal.c',\n \t'rte_service.c',\ndiff --git a/lib/librte_eal/common/rte_option.c b/lib/librte_eal/common/rte_option.c\ndeleted file mode 100644\nindex 6f8bd6e64c..0000000000\n--- a/lib/librte_eal/common/rte_option.c\n+++ /dev/null\n@@ -1,95 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2018 Intel Corporation.\n- */\n-\n-#include <getopt.h>\n-#include <unistd.h>\n-#include <string.h>\n-\n-#include <rte_eal.h>\n-#include <rte_option.h>\n-\n-#include \"eal_private.h\"\n-#include \"eal_internal_cfg.h\" /* Necessary for eal_options.h */\n-#include \"eal_options.h\"\n-\n-TAILQ_HEAD(rte_option_list, rte_option);\n-\n-struct rte_option_list rte_option_list =\n-\tTAILQ_HEAD_INITIALIZER(rte_option_list);\n-\n-int\n-rte_option_parse(const char *opt)\n-{\n-\tstruct rte_option *option;\n-\n-\tif (strlen(opt) <= 2 ||\n-\t    strncmp(opt, \"--\", 2))\n-\t\treturn -1;\n-\n-\t/* Check if the option is registered */\n-\tTAILQ_FOREACH(option, &rte_option_list, next) {\n-\t\tif (strcmp(&opt[2], option->name) == 0) {\n-\t\t\toption->enabled = 1;\n-\t\t\treturn 0;\n-\t\t}\n-\t}\n-\n-\treturn -1;\n-}\n-\n-int\n-rte_option_register(struct rte_option *opt)\n-{\n-\tstruct rte_option *option;\n-\tconst struct option *gopt;\n-\n-\tgopt = &eal_long_options[0];\n-\twhile (gopt->name != NULL) {\n-\t\tif (strcmp(gopt->name, opt->name) == 0) {\n-\t\t\tRTE_LOG(ERR, EAL, \"Option %s is already a common EAL option.\\n\",\n-\t\t\t\t\topt->name);\n-\t\t\treturn -1;\n-\t\t}\n-\t\tgopt++;\n-\t}\n-\n-\tTAILQ_FOREACH(option, &rte_option_list, next) {\n-\t\tif (strcmp(opt->name, option->name) == 0) {\n-\t\t\tRTE_LOG(ERR, EAL, \"Option %s has already been registered.\\n\",\n-\t\t\t\t\topt->name);\n-\t\t\treturn -1;\n-\t\t}\n-\t}\n-\n-\tTAILQ_INSERT_HEAD(&rte_option_list, opt, next);\n-\treturn 0;\n-}\n-\n-void\n-rte_option_init(void)\n-{\n-\tstruct rte_option *option;\n-\n-\tTAILQ_FOREACH(option, &rte_option_list, next) {\n-\t\tif (option->enabled)\n-\t\t\toption->cb();\n-\t}\n-}\n-\n-void\n-rte_option_usage(void)\n-{\n-\tstruct rte_option *option;\n-\tint opt_count = 0;\n-\n-\tTAILQ_FOREACH(option, &rte_option_list, next)\n-\t\topt_count += 1;\n-\tif (opt_count == 0)\n-\t\treturn;\n-\n-\tprintf(\"EAL dynamic options:\\n\");\n-\tTAILQ_FOREACH(option, &rte_option_list, next)\n-\t\tprintf(\"  --%-*s %s\\n\", 17, option->name, option->usage);\n-\tprintf(\"\\n\");\n-}\ndiff --git a/lib/librte_eal/freebsd/Makefile b/lib/librte_eal/freebsd/Makefile\nindex 9ca7141cdb..729c9c32e4 100644\n--- a/lib/librte_eal/freebsd/Makefile\n+++ b/lib/librte_eal/freebsd/Makefile\n@@ -66,7 +66,6 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += malloc_elem.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += malloc_heap.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += malloc_mp.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += rte_keepalive.c\n-SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += rte_option.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += rte_service.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += rte_random.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_FREEBSD) += rte_reciprocal.c\ndiff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c\nindex 73f9a15770..2397bdfd50 100644\n--- a/lib/librte_eal/freebsd/eal.c\n+++ b/lib/librte_eal/freebsd/eal.c\n@@ -41,7 +41,6 @@\n #include <rte_devargs.h>\n #include <rte_version.h>\n #include <rte_vfio.h>\n-#include <rte_option.h>\n #include <rte_atomic.h>\n #include <malloc_heap.h>\n #include <rte_telemetry.h>\n@@ -536,20 +535,12 @@ eal_parse_args(int argc, char **argv)\n \targvopt = argv;\n \toptind = 1;\n \toptreset = 1;\n-\topterr = 0;\n \n \twhile ((opt = getopt_long(argc, argvopt, eal_short_options,\n \t\t\t\t  eal_long_options, &option_index)) != EOF) {\n \n-\t\t/*\n-\t\t * getopt didn't recognise the option, lets parse the\n-\t\t * registered options to see if the flag is valid\n-\t\t */\n+\t\t/* getopt didn't recognise the option */\n \t\tif (opt == '?') {\n-\t\t\tret = rte_option_parse(argv[optind-1]);\n-\t\t\tif (ret == 0)\n-\t\t\t\tcontinue;\n-\n \t\t\teal_usage(prgname);\n \t\t\tret = -1;\n \t\t\tgoto out;\n@@ -964,9 +955,6 @@ rte_eal_init(int argc, char **argv)\n \n \teal_mcfg_complete();\n \n-\t/* Call each registered callback, if enabled */\n-\trte_option_init();\n-\n \treturn fctret;\n }\n \ndiff --git a/lib/librte_eal/include/meson.build b/lib/librte_eal/include/meson.build\nindex 6fd4274941..603ace8f7a 100644\n--- a/lib/librte_eal/include/meson.build\n+++ b/lib/librte_eal/include/meson.build\n@@ -29,7 +29,6 @@ headers += files(\n \t'rte_malloc.h',\n \t'rte_memory.h',\n \t'rte_memzone.h',\n-\t'rte_option.h',\n \t'rte_pci_dev_feature_defs.h',\n \t'rte_pci_dev_features.h',\n \t'rte_per_lcore.h',\ndiff --git a/lib/librte_eal/include/rte_option.h b/lib/librte_eal/include/rte_option.h\ndeleted file mode 100644\nindex 7ad65a4eb4..0000000000\n--- a/lib/librte_eal/include/rte_option.h\n+++ /dev/null\n@@ -1,72 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2018 Intel Corporation.\n- */\n-\n-#ifndef __INCLUDE_RTE_OPTION_H__\n-#define __INCLUDE_RTE_OPTION_H__\n-\n-/**\n- * @file\n- *\n- * This API offers the ability to register options to the EAL command line and\n- * map those options to functions that will be executed at the end of EAL\n- * initialization. These options will be available as part of the EAL command\n- * line of applications and are dynamically managed.\n- *\n- * This is used primarily by DPDK libraries offering command line options.\n- * Currently, this API is limited to registering options without argument.\n- *\n- * The register API can be used to resolve circular dependency issues\n- * between EAL and the library. The library uses EAL, but is also initialized\n- * by EAL. Hence, EAL depends on the init function of the library. The API\n- * introduced in rte_option allows us to register the library init with EAL\n- * (passing a function pointer) and avoid the circular dependency.\n- */\n-\n-#ifdef __cplusplus\n-extern \"C\" {\n-#endif\n-\n-typedef int (*rte_option_cb)(void);\n-\n-/**\n- * Structure describing an EAL command line option dynamically registered.\n- *\n- * Common EAL options are mostly statically defined.\n- * Some libraries need additional options to be dynamically added.\n- * This structure describes such options.\n- */\n-struct rte_option {\n-\tTAILQ_ENTRY(rte_option) next; /**< Next entry in the list. */\n-\tconst char *name; /**< The option name. */\n-\tconst char *usage; /**< Option summary string. */\n-\trte_option_cb cb;          /**< Function called when option is used. */\n-\tint enabled;               /**< Set when the option is used. */\n-};\n-\n-/**\n- * @warning\n- * @b EXPERIMENTAL: this API may change without prior notice\n- *\n- * Register an option to the EAL command line.\n- * When recognized, the associated function will be executed at the end of EAL\n- * initialization.\n- *\n- * The associated structure must be available the whole time this option is\n- * registered (i.e. not stack memory).\n- *\n- * @param opt\n- *  Structure describing the option to parse.\n- *\n- * @return\n- *  0 on success, <0 otherwise.\n- */\n-__rte_experimental\n-int\n-rte_option_register(struct rte_option *opt);\n-\n-#ifdef __cplusplus\n-}\n-#endif\n-\n-#endif\ndiff --git a/lib/librte_eal/linux/Makefile b/lib/librte_eal/linux/Makefile\nindex 9c3ccdf5bd..93d1e63a55 100644\n--- a/lib/librte_eal/linux/Makefile\n+++ b/lib/librte_eal/linux/Makefile\n@@ -73,7 +73,6 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += malloc_elem.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += malloc_heap.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += malloc_mp.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += rte_keepalive.c\n-SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += rte_option.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += rte_service.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += rte_random.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUX) += rte_reciprocal.c\ndiff --git a/lib/librte_eal/linux/eal.c b/lib/librte_eal/linux/eal.c\nindex 7c89389b9d..4be885e8a5 100644\n--- a/lib/librte_eal/linux/eal.c\n+++ b/lib/librte_eal/linux/eal.c\n@@ -50,7 +50,6 @@\n #include <rte_atomic.h>\n #include <malloc_heap.h>\n #include <rte_vfio.h>\n-#include <rte_option.h>\n #include <rte_telemetry.h>\n \n #include \"eal_private.h\"\n@@ -700,20 +699,12 @@ eal_parse_args(int argc, char **argv)\n \n \targvopt = argv;\n \toptind = 1;\n-\topterr = 0;\n \n \twhile ((opt = getopt_long(argc, argvopt, eal_short_options,\n \t\t\t\t  eal_long_options, &option_index)) != EOF) {\n \n-\t\t/*\n-\t\t * getopt didn't recognise the option, lets parse the\n-\t\t * registered options to see if the flag is valid\n-\t\t */\n+\t\t/* getopt didn't recognise the option */\n \t\tif (opt == '?') {\n-\t\t\tret = rte_option_parse(argv[optind-1]);\n-\t\t\tif (ret == 0)\n-\t\t\t\tcontinue;\n-\n \t\t\teal_usage(prgname);\n \t\t\tret = -1;\n \t\t\tgoto out;\n@@ -1303,9 +1294,6 @@ rte_eal_init(int argc, char **argv)\n \n \teal_mcfg_complete();\n \n-\t/* Call each registered callback, if enabled */\n-\trte_option_init();\n-\n \treturn fctret;\n }\n \ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex f9ede5b41c..d0104a6084 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -303,7 +303,6 @@ EXPERIMENTAL {\n \trte_memseg_get_fd_offset;\n \trte_memseg_get_fd_offset_thread_unsafe;\n \trte_memseg_get_fd_thread_unsafe;\n-\trte_option_register;\n \n \t# added in 19.02\n \trte_extmem_attach;\n",
    "prefixes": [
        "v3",
        "15/17"
    ]
}