get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 129007,
    "url": "http://patchwork.dpdk.org/api/patches/129007/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230626184223.155390-5-stephen@networkplumber.org/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20230626184223.155390-5-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230626184223.155390-5-stephen@networkplumber.org",
    "date": "2023-06-26T18:42:15",
    "name": "[v4,4/5] eal: move logging initialization earlier",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "57a05cc19aa96aa4ad8d4c4810e3dc3d6c069c83",
    "submitter": {
        "id": 27,
        "url": "http://patchwork.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230626184223.155390-5-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 28655,
            "url": "http://patchwork.dpdk.org/api/series/28655/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=28655",
            "date": "2023-06-26T18:42:11",
            "name": "Logging related patchs",
            "version": 4,
            "mbox": "http://patchwork.dpdk.org/series/28655/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/129007/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/129007/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 820D642D5F;\n\tMon, 26 Jun 2023 20:43:19 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C012B42D1D;\n\tMon, 26 Jun 2023 20:42:58 +0200 (CEST)",
            "from mail-pg1-f180.google.com (mail-pg1-f180.google.com\n [209.85.215.180])\n by mails.dpdk.org (Postfix) with ESMTP id 9952D42C4D\n for <dev@dpdk.org>; Mon, 26 Jun 2023 20:42:55 +0200 (CEST)",
            "by mail-pg1-f180.google.com with SMTP id\n 41be03b00d2f7-54f85f8b961so2840900a12.3\n for <dev@dpdk.org>; Mon, 26 Jun 2023 11:42:55 -0700 (PDT)",
            "from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218])\n by smtp.gmail.com with ESMTPSA id\n h17-20020a17090adb9100b0024e37e0a67dsm4846577pjv.20.2023.06.26.11.42.53\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 26 Jun 2023 11:42:54 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1687804974;\n x=1690396974;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=G3wxp+uVKXBcYiMtKKmQyWepL34iCxOs75msWyk+ksk=;\n b=z4kmpef8ME/v3cMQPod8ra85iuV+CAJD2XOORPyNUchRPkp6j5KSIrqLkr4Aj+aFUJ\n avy1+MCk9ChMDkbUaQ5D5t99zVqAaXhejL07Agb/G4Sz6nWlZ3v4BiMIpqOiOcKPfVP3\n jCBDwyTpzQywCGtuL2FmN0tQGthdkr70e1zVe4vw37efM6eUkxYzFhXbXKoT4AFujA9V\n wEtybrrYOPAZQZDzoBxmz4ZKEjCONn1Z9C8d/K3nCaURzrigvMp/zRpR8w37Q1ASC63i\n QsJgNe3QGLK/anWwTnji0lcSIlTinxr3lQZq1bSqvKyGhRGjiti3clAo7cRW27soSN8x\n +frw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20221208; t=1687804974; x=1690396974;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=G3wxp+uVKXBcYiMtKKmQyWepL34iCxOs75msWyk+ksk=;\n b=JZKLtGy2r2RF8csOmUgWtmjCISRWiXNBf0hwTj5MJ1RB7RwLctXyyIQpPu5gYXp1E8\n x+rl7JBmVSG15Ta7oZJC8yJXQotXbToxsNV6Fh6VDAPiSenv7SAjZQ00M2+wJGxqxVi1\n yIv3nl4CNQukWVworVo+rUQAzEkL9QHKrM73DheK3S0V8jLzkzW47SsTUv7l0WTrXoC7\n +0FXEt6JesoW/E7lUAwBRGWeb94cpfAfAmHGAtIFZPfDfowos5X/N1SBQTE4ucNGN3rc\n vXRHEwX7IB2ihhFixYkz4Ck5hpZxyaUm3R/7QYqXQeD0PBolnaULqgVIej4xHNURb4kk\n xw3A==",
        "X-Gm-Message-State": "AC+VfDwdkXyUHE0ERQTzl1HhU9q2cRHZuvyRyJIsj8eHICjMqAtiUVME\n f96y2J8XkeiYdkitR2n8eGp/tt76haac0uOkuigq5w==",
        "X-Google-Smtp-Source": "\n ACHHUZ7Xts+0xG/tmxgoblotXY3UuPnSUWSouyGu7W8AQclVOeHQams8VaXQ21IETKK8AXpQYqR1LQ==",
        "X-Received": "by 2002:a17:90a:190f:b0:258:9995:91cb with SMTP id\n 15-20020a17090a190f00b00258999591cbmr25158687pjg.49.1687804974487;\n Mon, 26 Jun 2023 11:42:54 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n Bruce Richardson <bruce.richardson@intel.com>",
        "Subject": "[PATCH v4 4/5] eal: move logging initialization earlier",
        "Date": "Mon, 26 Jun 2023 11:42:15 -0700",
        "Message-Id": "<20230626184223.155390-5-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.39.2",
        "In-Reply-To": "<20230626184223.155390-1-stephen@networkplumber.org>",
        "References": "<20200814173441.23086-1-stephen@networkplumber.org>\n <20230626184223.155390-1-stephen@networkplumber.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "The log stream should be setup before any messages.\nThis ensures that any startup problems are captured on the\nsyslog output, not only shown on the stderr.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n lib/eal/freebsd/eal.c | 40 +++++++++++++++++++--------------------\n lib/eal/linux/eal.c   | 44 +++++++++++++++++++++----------------------\n 2 files changed, 40 insertions(+), 44 deletions(-)",
    "diff": "diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c\nindex 70087837da18..d3aac3d628a8 100644\n--- a/lib/eal/freebsd/eal.c\n+++ b/lib/eal/freebsd/eal.c\n@@ -364,7 +364,7 @@ eal_get_hugepage_mem_size(void)\n \treturn (size < SIZE_MAX) ? (size_t)(size) : SIZE_MAX;\n }\n \n-/* Parse the arguments for --log-level only */\n+/* Parse the arguments for --log-level and --syslog */\n static void\n eal_log_level_parse(int argc, char **argv)\n {\n@@ -386,20 +386,18 @@ eal_log_level_parse(int argc, char **argv)\n \twhile ((opt = getopt_long(argc, argvopt, eal_short_options,\n \t\t\t\t  eal_long_options, &option_index)) != EOF) {\n \n-\t\tint ret;\n-\n-\t\t/* getopt is not happy, stop right now */\n-\t\tif (opt == '?')\n-\t\t\tbreak;\n-\n-\t\tret = (opt == OPT_LOG_LEVEL_NUM) ?\n-\t\t    eal_parse_common_option(opt, optarg, internal_conf) : 0;\n-\n-\t\t/* common parser is not happy */\n-\t\tif (ret < 0)\n+\t\tswitch (opt) {\n+\t\tcase OPT_SYSLOG_NUM:\t\t/* fallthrough */\n+\t\tcase OPT_LOG_LEVEL_NUM:\n+\t\t\tif (eal_parse_common_option(opt, optarg, internal_conf) < 0)\n+\t\t\t\tgoto error;\n \t\t\tbreak;\n+\t\tcase '?':\n+\t\t\t/* getopt is not happy, stop right now */\n+\t\t\tgoto error;\n+\t\t}\n \t}\n-\n+error:\n \t/* restore getopt lib */\n \toptind = old_optind;\n \toptopt = old_optopt;\n@@ -437,8 +435,8 @@ eal_parse_args(int argc, char **argv)\n \t\t\tgoto out;\n \t\t}\n \n-\t\t/* eal_log_level_parse() already handled this option */\n-\t\tif (opt == OPT_LOG_LEVEL_NUM)\n+\t\t/* eal_log_level_parse() already handled these */\n+\t\tif (opt == OPT_LOG_LEVEL_NUM || opt == OPT_SYSLOG_NUM)\n \t\t\tcontinue;\n \n \t\tret = eal_parse_common_option(opt, optarg, internal_conf);\n@@ -615,6 +613,12 @@ rte_eal_init(int argc, char **argv)\n \t/* set log level as early as possible */\n \teal_log_level_parse(argc, argv);\n \n+\tif (eal_log_init(getprogname(), internal_conf->syslog_facility) < 0) {\n+\t\trte_eal_init_alert(\"Cannot init logging.\");\n+\t\trte_errno = ENOMEM;\n+\t\treturn -1;\n+\t}\n+\n \tif (rte_eal_cpu_init() < 0) {\n \t\trte_eal_init_alert(\"Cannot detect lcores.\");\n \t\trte_errno = ENOTSUP;\n@@ -762,12 +766,6 @@ rte_eal_init(int argc, char **argv)\n #endif\n \t}\n \n-\tif (eal_log_init(getprogname(), internal_conf->syslog_facility) < 0) {\n-\t\trte_eal_init_alert(\"Cannot init logging.\");\n-\t\trte_errno = ENOMEM;\n-\t\treturn -1;\n-\t}\n-\n \t/* in secondary processes, memory init may allocate additional fbarrays\n \t * not present in primary processes, so to avoid any potential issues,\n \t * initialize memzones first.\ndiff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c\nindex 60bb130aea15..51c4ec75d57b 100644\n--- a/lib/eal/linux/eal.c\n+++ b/lib/eal/linux/eal.c\n@@ -546,7 +546,7 @@ eal_parse_vfio_vf_token(const char *vf_token)\n \treturn -1;\n }\n \n-/* Parse the arguments for --log-level only */\n+/* Parse the arguments for --log-level and --syslog */\n static void\n eal_log_level_parse(int argc, char **argv)\n {\n@@ -566,20 +566,18 @@ eal_log_level_parse(int argc, char **argv)\n \twhile ((opt = getopt_long(argc, argvopt, eal_short_options,\n \t\t\t\t  eal_long_options, &option_index)) != EOF) {\n \n-\t\tint ret;\n-\n-\t\t/* getopt is not happy, stop right now */\n-\t\tif (opt == '?')\n-\t\t\tbreak;\n-\n-\t\tret = (opt == OPT_LOG_LEVEL_NUM) ?\n-\t\t\teal_parse_common_option(opt, optarg, internal_conf) : 0;\n-\n-\t\t/* common parser is not happy */\n-\t\tif (ret < 0)\n+\t\tswitch (opt) {\n+\t\tcase OPT_SYSLOG_NUM:\t\t/* fallthrough */\n+\t\tcase OPT_LOG_LEVEL_NUM:\n+\t\t\tif (eal_parse_common_option(opt, optarg, internal_conf) < 0)\n+\t\t\t\tgoto error;\n \t\t\tbreak;\n+\t\tcase '?':\n+\t\t\t/* getopt is not happy, stop right now */\n+\t\t\tgoto error;\n+\t\t}\n \t}\n-\n+error:\n \t/* restore getopt lib */\n \toptind = old_optind;\n \toptopt = old_optopt;\n@@ -651,8 +649,8 @@ eal_parse_args(int argc, char **argv)\n \t\t\tgoto out;\n \t\t}\n \n-\t\t/* eal_log_level_parse() already handled this option */\n-\t\tif (opt == OPT_LOG_LEVEL_NUM)\n+\t\t/* eal_log_level_parse() already handled these */\n+\t\tif (opt == OPT_LOG_LEVEL_NUM || opt == OPT_SYSLOG_NUM)\n \t\t\tcontinue;\n \n \t\tret = eal_parse_common_option(opt, optarg, internal_conf);\n@@ -997,6 +995,14 @@ rte_eal_init(int argc, char **argv)\n \t/* set log level as early as possible */\n \teal_log_level_parse(argc, argv);\n \n+\tif (eal_log_init(program_invocation_short_name,\n+\t\t\t internal_conf->syslog_facility) < 0) {\n+\t\trte_eal_init_alert(\"Cannot init logging.\");\n+\t\trte_errno = ENOMEM;\n+\t\t__atomic_store_n(&run_once, 0, __ATOMIC_RELAXED);\n+\t\treturn -1;\n+\t}\n+\n \t/* clone argv to report out later in telemetry */\n \teal_save_args(argc, argv);\n \n@@ -1167,14 +1173,6 @@ rte_eal_init(int argc, char **argv)\n #endif\n \t}\n \n-\tif (eal_log_init(program_invocation_short_name,\n-\t\t\t internal_conf->syslog_facility) < 0) {\n-\t\trte_eal_init_alert(\"Cannot init logging.\");\n-\t\trte_errno = ENOMEM;\n-\t\t__atomic_store_n(&run_once, 0, __ATOMIC_RELAXED);\n-\t\treturn -1;\n-\t}\n-\n #ifdef VFIO_PRESENT\n \tif (rte_eal_vfio_setup() < 0) {\n \t\trte_eal_init_alert(\"Cannot init VFIO\");\n",
    "prefixes": [
        "v4",
        "4/5"
    ]
}