get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 54430,
    "url": "http://patches.dpdk.org/api/patches/54430/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190605180948.22414-7-stephen@networkplumber.org/",
    "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": "<20190605180948.22414-7-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190605180948.22414-7-stephen@networkplumber.org",
    "date": "2019-06-05T18:09:46",
    "name": "[v4,6/8] cmdline: use rte_ether_unformat_addr",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "fe622c923ee65e1f7bfacfa9c649a3ba9e913342",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190605180948.22414-7-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 4912,
            "url": "http://patches.dpdk.org/api/series/4912/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4912",
            "date": "2019-06-05T18:09:40",
            "name": "net/ether: enhancements and optimizations",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/4912/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/54430/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/54430/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 4BC101B9DF;\n\tWed,  5 Jun 2019 20:10:06 +0200 (CEST)",
            "from mail-pl1-f194.google.com (mail-pl1-f194.google.com\n\t[209.85.214.194]) by dpdk.org (Postfix) with ESMTP id C77511B9C1\n\tfor <dev@dpdk.org>; Wed,  5 Jun 2019 20:10:00 +0200 (CEST)",
            "by mail-pl1-f194.google.com with SMTP id s24so9837537plr.8\n\tfor <dev@dpdk.org>; Wed, 05 Jun 2019 11:10:00 -0700 (PDT)",
            "from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\ta7sm19081888pgj.42.2019.06.05.11.09.57\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 05 Jun 2019 11:09:58 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=RgUUuxMckAV5y0zFZFrtB+KkjwKo7Fjy96+Uqx7Le3U=;\n\tb=IdFfX8k1/qGT80LiJWtpG4pavgQifjui+9p3wd+7ryaicm7QPMmm6w19Zs1Om8amk2\n\tpnW7XVZgrAlKqqN255P9G/4VQ5JE9h2S7/YEJ5wgBw9MCKfDE8LaHmAqcyrl7tys/YcL\n\tk5tOQH/NuebrwGgamps/ijKJhSuybki7QOAKeqUMT/VWb2SjcrypurLnP/9kDsTRopHt\n\telyA6EhqJqksGotPkwp1w4JFjthfKoyQinlctiV2ew0aIxghq8BB0HB2Zo3zT+oidBME\n\t/6ydwGI7+Zxfp32xrTFZ1I/V09KRTqKSPPR/kNiUe6v9sYK+aFqnjqUx/m/B/YDKokeI\n\tC7Aw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=RgUUuxMckAV5y0zFZFrtB+KkjwKo7Fjy96+Uqx7Le3U=;\n\tb=MGf3Bw+b6vmoN4YwiENfo/gzOWKsNv20vQkASlSGQOvRZtoXMxRlrNEkR08mfJmczR\n\tuNcFkCFx4OxItmb4jPHYP4EFkKfjH0n9xS50XU8KL5EdmW6cDXP4bCI2ZfIBCzT2Wju/\n\txPHGYUVwGtF8D42/+qu5swd2eeIQJY+eenUM6bBXpCzsOFCZY6iHVZnDesNe1kHtCzWW\n\te1sdYUOLom2pi0KKJWPE8TEMg1ZyPYHIxs/Lgm6PLNKdn5rD0xCcOrGr7tPLHdLE/gf8\n\tp7PKYkemJpEg3P/9rcODd3hBLz2z8x+gyVIiqklQChQd2VYC3jrmsDNlYZoSy738qPL3\n\tSOkw==",
        "X-Gm-Message-State": "APjAAAXCVLfE1uSdUNVwMTPI6v/ENtGnYeNYbRemjMfKIEe+60g6LSer\n\tbi8BQhnJkpK2TB2IGEDUeqN+VYFO55Y=",
        "X-Google-Smtp-Source": "APXvYqxwwaaD1F/p0V4BxTpjNC3+xsCzf61nGLHDbDYbCBs3YITZKgU6G9pn94z38c+HZr0IrEAgBA==",
        "X-Received": "by 2002:a17:902:8f87:: with SMTP id\n\tz7mr19678261plo.65.1559758199683; \n\tWed, 05 Jun 2019 11:09:59 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Date": "Wed,  5 Jun 2019 11:09:46 -0700",
        "Message-Id": "<20190605180948.22414-7-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190605180948.22414-1-stephen@networkplumber.org>",
        "References": "<20190516180427.17270-1-stephen@networkplumber.org>\n\t<20190605180948.22414-1-stephen@networkplumber.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v4 6/8] cmdline: use rte_ether_unformat_addr",
        "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": "Now that there is a version of ether_aton in rte_ether, it can\nbe used by the cmdline ethernet address parser.\n\nNote: ether_aton_r can not be used in cmdline because\nthe old code would accept either bytes XX:XX:XX:XX:XX:XX\nor words XXXX:XXXX:XXXX and we need to keep compatiablity.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n lib/Makefile                                 |  2 +-\n lib/librte_cmdline/Makefile                  |  3 +-\n lib/librte_cmdline/cmdline_parse_etheraddr.c | 71 +++-----------------\n lib/librte_cmdline/meson.build               |  6 +-\n lib/meson.build                              |  2 +-\n 5 files changed, 15 insertions(+), 69 deletions(-)",
    "diff": "diff --git a/lib/Makefile b/lib/Makefile\nindex 82b2c4bfa8ea..cc36fe7591f0 100644\n--- a/lib/Makefile\n+++ b/lib/Makefile\n@@ -20,7 +20,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_TIMER) += librte_timer\n DEPDIRS-librte_timer := librte_eal\n DIRS-$(CONFIG_RTE_LIBRTE_CFGFILE) += librte_cfgfile\n DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += librte_cmdline\n-DEPDIRS-librte_cmdline := librte_eal\n+DEPDIRS-librte_cmdline := librte_eal librte_net\n DIRS-$(CONFIG_RTE_LIBRTE_ETHER) += librte_ethdev\n DEPDIRS-librte_ethdev := librte_net librte_eal librte_mempool librte_ring\n DEPDIRS-librte_ethdev += librte_mbuf\ndiff --git a/lib/librte_cmdline/Makefile b/lib/librte_cmdline/Makefile\nindex c64142b8d5a0..04057d7c671f 100644\n--- a/lib/librte_cmdline/Makefile\n+++ b/lib/librte_cmdline/Makefile\n@@ -7,6 +7,7 @@ include $(RTE_SDK)/mk/rte.vars.mk\n LIB = librte_cmdline.a\n \n CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3\n+CFLAGS += -DALLOW_EXPERIMENTAL_API\n \n EXPORT_MAP := rte_cmdline_version.map\n \n@@ -25,7 +26,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_vt100.c\n SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_socket.c\n SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_parse_portlist.c\n \n-LDLIBS += -lrte_eal\n+LDLIBS += -lrte_net -lrte_eal\n \n # install includes\n INCS := cmdline.h cmdline_parse.h cmdline_parse_num.h cmdline_parse_ipaddr.h\ndiff --git a/lib/librte_cmdline/cmdline_parse_etheraddr.c b/lib/librte_cmdline/cmdline_parse_etheraddr.c\nindex 24e04755cd9e..2cb8dd2a1267 100644\n--- a/lib/librte_cmdline/cmdline_parse_etheraddr.c\n+++ b/lib/librte_cmdline/cmdline_parse_etheraddr.c\n@@ -12,9 +12,9 @@\n #include <ctype.h>\n #include <string.h>\n #include <sys/types.h>\n-#include <net/ethernet.h>\n \n #include <rte_string_fns.h>\n+#include <rte_ether.h>\n \n #include \"cmdline_parse.h\"\n #include \"cmdline_parse_etheraddr.h\"\n@@ -26,69 +26,15 @@ struct cmdline_token_ops cmdline_token_etheraddr_ops = {\n \t.get_help = cmdline_get_help_etheraddr,\n };\n \n-/* the format can be either XX:XX:XX:XX:XX:XX or XXXX:XXXX:XXXX */\n-#define ETHER_ADDRSTRLENLONG 18\n-#define ETHER_ADDRSTRLENSHORT 15\n-\n-#ifdef __linux__\n-#define ea_oct ether_addr_octet\n-#else\n-#define ea_oct octet\n-#endif\n-\n-\n-static struct ether_addr *\n-my_ether_aton(const char *a)\n-{\n-\tint i;\n-\tchar *end;\n-\tunsigned long o[ETHER_ADDR_LEN];\n-\tstatic struct ether_addr ether_addr;\n-\n-\ti = 0;\n-\tdo {\n-\t\terrno = 0;\n-\t\to[i] = strtoul(a, &end, 16);\n-\t\tif (errno != 0 || end == a || (end[0] != ':' && end[0] != 0))\n-\t\t\treturn NULL;\n-\t\ta = end + 1;\n-\t} while (++i != sizeof (o) / sizeof (o[0]) && end[0] != 0);\n-\n-\t/* Junk at the end of line */\n-\tif (end[0] != 0)\n-\t\treturn NULL;\n-\n-\t/* Support the format XX:XX:XX:XX:XX:XX */\n-\tif (i == ETHER_ADDR_LEN) {\n-\t\twhile (i-- != 0) {\n-\t\t\tif (o[i] > UINT8_MAX)\n-\t\t\t\treturn NULL;\n-\t\t\tether_addr.ea_oct[i] = (uint8_t)o[i];\n-\t\t}\n-\t/* Support the format XXXX:XXXX:XXXX */\n-\t} else if (i == ETHER_ADDR_LEN / 2) {\n-\t\twhile (i-- != 0) {\n-\t\t\tif (o[i] > UINT16_MAX)\n-\t\t\t\treturn NULL;\n-\t\t\tether_addr.ea_oct[i * 2] = (uint8_t)(o[i] >> 8);\n-\t\t\tether_addr.ea_oct[i * 2 + 1] = (uint8_t)(o[i] & 0xff);\n-\t\t}\n-\t/* unknown format */\n-\t} else\n-\t\treturn NULL;\n-\n-\treturn (struct ether_addr *)&ether_addr;\n-}\n-\n int\n cmdline_parse_etheraddr(__attribute__((unused)) cmdline_parse_token_hdr_t *tk,\n \tconst char *buf, void *res, unsigned ressize)\n {\n \tunsigned int token_len = 0;\n-\tchar ether_str[ETHER_ADDRSTRLENLONG+1];\n-\tstruct ether_addr *tmp;\n+\tchar ether_str[RTE_ETHER_ADDR_FMT_SIZE];\n+\tstruct rte_ether_addr tmp;\n \n-\tif (res && ressize < sizeof(struct ether_addr))\n+\tif (res && ressize < sizeof(tmp))\n \t\treturn -1;\n \n \tif (!buf || ! *buf)\n@@ -98,17 +44,16 @@ cmdline_parse_etheraddr(__attribute__((unused)) cmdline_parse_token_hdr_t *tk,\n \t\ttoken_len++;\n \n \t/* if token doesn't match possible string lengths... */\n-\tif ((token_len != ETHER_ADDRSTRLENLONG - 1) &&\n-\t\t\t(token_len != ETHER_ADDRSTRLENSHORT - 1))\n+\tif (token_len >= RTE_ETHER_ADDR_FMT_SIZE)\n \t\treturn -1;\n \n \tstrlcpy(ether_str, buf, token_len + 1);\n \n-\ttmp = my_ether_aton(ether_str);\n-\tif (tmp == NULL)\n+\tif (rte_ether_unformat_addr(ether_str, &tmp) < 0)\n \t\treturn -1;\n+\n \tif (res)\n-\t\tmemcpy(res, tmp, sizeof(struct ether_addr));\n+\t\tmemcpy(res, &tmp, sizeof(tmp));\n \treturn token_len;\n }\n \ndiff --git a/lib/librte_cmdline/meson.build b/lib/librte_cmdline/meson.build\nindex 0fa61385fccf..07334c1b0956 100644\n--- a/lib/librte_cmdline/meson.build\n+++ b/lib/librte_cmdline/meson.build\n@@ -1,10 +1,8 @@\n # SPDX-License-Identifier: BSD-3-Clause\n # Copyright(c) 2017 Intel Corporation\n \n-# This library is processed before EAL\n-includes = [global_inc]\n-\n version = 2\n+allow_experimental_apis = true\n sources = files('cmdline.c',\n \t'cmdline_cirbuf.c',\n \t'cmdline_parse.c',\n@@ -28,3 +26,5 @@ headers = files('cmdline.h',\n \t'cmdline_socket.h',\n \t'cmdline_cirbuf.h',\n \t'cmdline_parse_portlist.h')\n+\n+deps += ['net']\ndiff --git a/lib/meson.build b/lib/meson.build\nindex e067ce5ea349..fc57fec1908a 100644\n--- a/lib/meson.build\n+++ b/lib/meson.build\n@@ -11,8 +11,8 @@\n libraries = [\n \t'kvargs', # eal depends on kvargs\n \t'eal', # everything depends on eal\n-\t'cmdline', # ethdev depends on cmdline for parsing functions\n \t'ring', 'mempool', 'mbuf', 'net', 'meter', 'ethdev', 'pci', # core\n+\t'cmdline',\n \t'metrics', # bitrate/latency stats depends on this\n \t'hash',    # efd depends on this\n \t'timer',   # eventdev depends on this\n",
    "prefixes": [
        "v4",
        "6/8"
    ]
}