get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1454,
    "url": "https://patches.dpdk.org/api/patches/1454/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1416692622-28886-7-git-send-email-thomas.monjalon@6wind.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": "<1416692622-28886-7-git-send-email-thomas.monjalon@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1416692622-28886-7-git-send-email-thomas.monjalon@6wind.com",
    "date": "2014-11-22T21:43:38",
    "name": "[dpdk-dev,06/10] eal: factorize configuration adjustment",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "017a41ecb9bef9b250c3d39842f9025e856963d4",
    "submitter": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/people/1/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas.monjalon@6wind.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1416692622-28886-7-git-send-email-thomas.monjalon@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1454/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1454/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 055137FCF;\n\tSat, 22 Nov 2014 22:33:49 +0100 (CET)",
            "from mail-wi0-f172.google.com (mail-wi0-f172.google.com\n\t[209.85.212.172]) by dpdk.org (Postfix) with ESMTP id 352F17FAC\n\tfor <dev@dpdk.org>; Sat, 22 Nov 2014 22:33:45 +0100 (CET)",
            "by mail-wi0-f172.google.com with SMTP id n3so2378993wiv.5\n\tfor <dev@dpdk.org>; Sat, 22 Nov 2014 13:44:25 -0800 (PST)",
            "from localhost.localdomain (136-92-190-109.dsl.ovh.fr.\n\t[109.190.92.136]) by mx.google.com with ESMTPSA id\n\tcz3sm13724087wjb.23.2014.11.22.13.44.24 for <dev@dpdk.org>\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tSat, 22 Nov 2014 13:44:25 -0800 (PST)"
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=Dp4qvkQGNHpR7CrTdVJysuhAdUQHe5XDlcc6QNaB6w0=;\n\tb=bLjEBXIyLDNLEXW7yAwAbkP5AZq8W9CogO8v5iT7MlbjE7KHox2lq70yvAcXsakYKS\n\t7NQQzny/0cM2/Q4tytax99tf6NKocf4cE4OgTD4xbsp3PlUJOij5iRdakDRQ3S6l++RN\n\tczTMC8N9RmhMRHcR/5rSqyxrC3kYSfAbBaoKoAfmPFLrO42wus/LQSEBklkkLSYkm+HS\n\teGIXKNYynXpXd4/GJtZc65KIXRdWkOyUN4qOwYwtKh9oo8uhmZdurp/cKD+/VObTJMWn\n\t9HARZcBljeahJTvd8tzjzaO0M1g4mCwLmqaPAxY0nIzqIrADiwPhC91PeMedi5cp6Sbs\n\tRDcw==",
        "X-Gm-Message-State": "ALoCoQlbBJLjKxxsX7E7dlE5iRkB8aHMJYKxwYpVEUZC7aB6fbWjDRvIwxLTRLr/Py+wjuTSBp83",
        "X-Received": "by 10.180.11.8 with SMTP id m8mr8262983wib.11.1416692665775;\n\tSat, 22 Nov 2014 13:44:25 -0800 (PST)",
        "From": "Thomas Monjalon <thomas.monjalon@6wind.com>",
        "To": "dev@dpdk.org",
        "Date": "Sat, 22 Nov 2014 22:43:38 +0100",
        "Message-Id": "<1416692622-28886-7-git-send-email-thomas.monjalon@6wind.com>",
        "X-Mailer": "git-send-email 2.1.3",
        "In-Reply-To": "<1416692622-28886-1-git-send-email-thomas.monjalon@6wind.com>",
        "References": "<1416692622-28886-1-git-send-email-thomas.monjalon@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH 06/10] eal: factorize configuration adjustment",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Some adjustments are done after options parsing and are common\nto Linux and BSD.\n\nRemove process_type adjustment in rte_config_init() because\nit is already done in eal_parse_args().\neal_proc_type_detect() is kept duplicated because it open a\nfile descriptor which is used later in each eal.c.\n\nSigned-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>\n---\n lib/librte_eal/bsdapp/eal/eal.c            | 18 +++++-------------\n lib/librte_eal/common/eal_common_options.c | 16 ++++++++++++++++\n lib/librte_eal/common/eal_options.h        |  2 ++\n lib/librte_eal/linuxapp/eal/eal.c          | 18 +++++-------------\n 4 files changed, 28 insertions(+), 26 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c\nindex 20a9c5f..69f3c03 100644\n--- a/lib/librte_eal/bsdapp/eal/eal.c\n+++ b/lib/librte_eal/bsdapp/eal/eal.c\n@@ -224,7 +224,7 @@ rte_eal_config_attach(void)\n }\n \n /* Detect if we are a primary or a secondary process */\n-static enum rte_proc_type_t\n+enum rte_proc_type_t\n eal_proc_type_detect(void)\n {\n \tenum rte_proc_type_t ptype = RTE_PROC_PRIMARY;\n@@ -247,9 +247,7 @@ eal_proc_type_detect(void)\n static void\n rte_config_init(void)\n {\n-\trte_config.process_type = (internal_config.process_type == RTE_PROC_AUTO) ?\n-\t\t\teal_proc_type_detect() : /* for auto, detect the type */\n-\t\t\tinternal_config.process_type; /* otherwise use what's already set */\n+\trte_config.process_type = internal_config.process_type;\n \n \tswitch (rte_config.process_type){\n \tcase RTE_PROC_PRIMARY:\n@@ -313,7 +311,7 @@ eal_get_hugepage_mem_size(void)\n static int\n eal_parse_args(int argc, char **argv)\n {\n-\tint opt, ret, i;\n+\tint opt, ret;\n \tchar **argvopt;\n \tint option_index;\n \tchar *prgname = argv[0];\n@@ -360,8 +358,8 @@ eal_parse_args(int argc, char **argv)\n \t\t}\n \t}\n \n-\tif (internal_config.process_type == RTE_PROC_AUTO)\n-\t\tinternal_config.process_type = eal_proc_type_detect();\n+\tif (eal_adjust_config(&internal_config) != 0)\n+\t\treturn -1;\n \n \t/* sanity checks */\n \tif (eal_check_common_options(&internal_config) != 0) {\n@@ -371,12 +369,6 @@ eal_parse_args(int argc, char **argv)\n \n \tif (optind >= 0)\n \t\targv[optind-1] = prgname;\n-\n-\t/* if no memory amounts were requested, this will result in 0 and\n-\t * will be overriden later, right after eal_hugepage_info_init() */\n-\tfor (i = 0; i < RTE_MAX_NUMA_NODES; i++)\n-\t\tinternal_config.memory += internal_config.socket_mem[i];\n-\n \tret = optind-1;\n \toptind = 0; /* reset getopt lib */\n \treturn ret;\ndiff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex 630dfe0..63710b0 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -400,6 +400,22 @@ eal_parse_common_option(int opt, const char *optarg,\n }\n \n int\n+eal_adjust_config(struct internal_config *internal_cfg)\n+{\n+\tint i;\n+\n+\tif (internal_config.process_type == RTE_PROC_AUTO)\n+\t\tinternal_config.process_type = eal_proc_type_detect();\n+\n+\t/* if no memory amounts were requested, this will result in 0 and\n+\t * will be overridden later, right after eal_hugepage_info_init() */\n+\tfor (i = 0; i < RTE_MAX_NUMA_NODES; i++)\n+\t\tinternal_cfg->memory += internal_cfg->socket_mem[i];\n+\n+\treturn 0;\n+}\n+\n+int\n eal_check_common_options(struct internal_config *internal_cfg)\n {\n \tstruct rte_config *cfg = rte_eal_get_configuration();\ndiff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h\nindex 75351c0..f58965c 100644\n--- a/lib/librte_eal/common/eal_options.h\n+++ b/lib/librte_eal/common/eal_options.h\n@@ -83,7 +83,9 @@ extern const struct option eal_long_options[];\n \n int eal_parse_common_option(int opt, const char *argv,\n \t\t\t    struct internal_config *conf);\n+int eal_adjust_config(struct internal_config *internal_cfg);\n int eal_check_common_options(struct internal_config *internal_cfg);\n void eal_common_usage(void);\n+enum rte_proc_type_t eal_proc_type_detect(void);\n \n #endif /* EAL_OPTIONS_H */\ndiff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c\nindex f5de277..5e5a7a0 100644\n--- a/lib/librte_eal/linuxapp/eal/eal.c\n+++ b/lib/librte_eal/linuxapp/eal/eal.c\n@@ -284,7 +284,7 @@ rte_eal_config_reattach(void)\n }\n \n /* Detect if we are a primary or a secondary process */\n-static enum rte_proc_type_t\n+enum rte_proc_type_t\n eal_proc_type_detect(void)\n {\n \tenum rte_proc_type_t ptype = RTE_PROC_PRIMARY;\n@@ -307,9 +307,7 @@ eal_proc_type_detect(void)\n static void\n rte_config_init(void)\n {\n-\trte_config.process_type = (internal_config.process_type == RTE_PROC_AUTO) ?\n-\t\t\teal_proc_type_detect() : /* for auto, detect the type */\n-\t\t\tinternal_config.process_type; /* otherwise use what's already set */\n+\trte_config.process_type = internal_config.process_type;\n \n \tswitch (rte_config.process_type){\n \tcase RTE_PROC_PRIMARY:\n@@ -504,7 +502,7 @@ eal_get_hugepage_mem_size(void)\n static int\n eal_parse_args(int argc, char **argv)\n {\n-\tint opt, ret, i;\n+\tint opt, ret;\n \tchar **argvopt;\n \tint option_index;\n \tchar *prgname = argv[0];\n@@ -616,8 +614,8 @@ eal_parse_args(int argc, char **argv)\n \t\t}\n \t}\n \n-\tif (internal_config.process_type == RTE_PROC_AUTO)\n-\t\tinternal_config.process_type = eal_proc_type_detect();\n+\tif (eal_adjust_config(&internal_config) != 0)\n+\t\treturn -1;\n \n \t/* sanity checks */\n \tif (eal_check_common_options(&internal_config) != 0) {\n@@ -635,12 +633,6 @@ eal_parse_args(int argc, char **argv)\n \n \tif (optind >= 0)\n \t\targv[optind-1] = prgname;\n-\n-\t/* if no memory amounts were requested, this will result in 0 and\n-\t * will be overriden later, right after eal_hugepage_info_init() */\n-\tfor (i = 0; i < RTE_MAX_NUMA_NODES; i++)\n-\t\tinternal_config.memory += internal_config.socket_mem[i];\n-\n \tret = optind-1;\n \toptind = 0; /* reset getopt lib */\n \treturn ret;\n",
    "prefixes": [
        "dpdk-dev",
        "06/10"
    ]
}