get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 42918,
    "url": "http://patches.dpdk.org/api/patches/42918/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/a1dbb4c3fc0df757c6604d77b8e4c9e901606a88.1531345404.git.gaetan.rivet@6wind.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": "<a1dbb4c3fc0df757c6604d77b8e4c9e901606a88.1531345404.git.gaetan.rivet@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/a1dbb4c3fc0df757c6604d77b8e4c9e901606a88.1531345404.git.gaetan.rivet@6wind.com",
    "date": "2018-07-11T21:45:15",
    "name": "[v11,25/25] eal: add generic dev parameter",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8a70587f611dcd25d611fa056cd4b6df4de6465e",
    "submitter": {
        "id": 269,
        "url": "http://patches.dpdk.org/api/people/269/?format=api",
        "name": "Gaëtan Rivet",
        "email": "gaetan.rivet@6wind.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/a1dbb4c3fc0df757c6604d77b8e4c9e901606a88.1531345404.git.gaetan.rivet@6wind.com/mbox/",
    "series": [
        {
            "id": 533,
            "url": "http://patches.dpdk.org/api/series/533/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=533",
            "date": "2018-07-11T21:44:50",
            "name": "Device querying",
            "version": 11,
            "mbox": "http://patches.dpdk.org/series/533/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/42918/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/42918/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 2FE0D1B7F2;\n\tWed, 11 Jul 2018 23:46:45 +0200 (CEST)",
            "from mail-wr1-f65.google.com (mail-wr1-f65.google.com\n\t[209.85.221.65]) by dpdk.org (Postfix) with ESMTP id 483E91B54B\n\tfor <dev@dpdk.org>; Wed, 11 Jul 2018 23:46:09 +0200 (CEST)",
            "by mail-wr1-f65.google.com with SMTP id c4-v6so6929349wrs.12\n\tfor <dev@dpdk.org>; Wed, 11 Jul 2018 14:46:09 -0700 (PDT)",
            "from bidouze.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com.\n\t[62.23.145.78]) by smtp.gmail.com with ESMTPSA id\n\th5-v6sm10550936wrr.19.2018.07.11.14.46.07\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 11 Jul 2018 14:46:07 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=nCa7nVY2FNW5vFx1jeE7Leb1PIhUCyVTjw98wAhjztc=;\n\tb=Bs3i1v6YKkayiQaHAZsq23bLsnxowluLMEd6oD0IYgytGnH0Ufwk0O6VKz6DCX06uy\n\tllgh6d7n69lUAK1nkVASSPgrD2V5nbJbyM7PopznDsJk84ayGwGxKWefrHfXSbpfayc/\n\tvqY1gtnaJLBTbGsN9NPe/QnRLp3H28v1v4zW8yf/rM60ns3Ia7l9LR2vTA9n3TXlGhXu\n\tSdcZUWtafIe5F4FGvLXnAZ/lVn6osr5wGszhKWYYPczSLXqTUpl/boBlLMNnzIhYOTiT\n\tNlQ8sT/8QcjVGXB7LbHHPrugnKvz2CctY/IvJFDkV9bdmlhuOejBsLko2q+M9gbNpeQn\n\tFAYg==",
        "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;\n\tbh=nCa7nVY2FNW5vFx1jeE7Leb1PIhUCyVTjw98wAhjztc=;\n\tb=WEALIAbrp5Fu8ztjD73DBMwxMzSgOnfyz9xhqfYAcvfqEYCjRNRPyKMa2+IN1tMia2\n\t5B/Uqy6KE8JQuepwpyL4YDPHVJX2Z70ssIjcY9pVoMW5332BkYY3v37uwLDuS71Mcm8g\n\tkc7GrQl7ZNK93G923kW/yzL3ThdFHeVkxVdqZ5SvTm8xfrM7pr/NuD/ehcDbVtGTNRx+\n\tKyFRr91e4lMyYnRp4Kxirc2UFZS0AkdIh9bTqy0bl/b1DU7ATUpt8X5kodahLjJJks43\n\t9vsfFJDf1HAqKVWe6vvdB2PLpDuZ9yXH2o4sed/daxzXSoNsGZOSR6nrLk6qMjpBvLxb\n\t6/dg==",
        "X-Gm-Message-State": "AOUpUlEag7eEcifWtOYWITeEh4diVTLwZ4ZFujGrDC3h4SLP2zpzyWsO\n\tkgVXKry7ly1lyf3u+gbeoKcQO2/j",
        "X-Google-Smtp-Source": "AAOMgpea4mhMoRVcpvcV/gqXYUNwEJfbKBxvGG2XxPoKEk4OlCrJTHiEhq2I07DJpaye8smoacHSwA==",
        "X-Received": "by 2002:adf:f850:: with SMTP id\n\td16-v6mr209657wrq.172.1531345568677; \n\tWed, 11 Jul 2018 14:46:08 -0700 (PDT)",
        "From": "Gaetan Rivet <gaetan.rivet@6wind.com>",
        "To": "dev@dpdk.org",
        "Cc": "Gaetan Rivet <gaetan.rivet@6wind.com>",
        "Date": "Wed, 11 Jul 2018 23:45:15 +0200",
        "Message-Id": "<a1dbb4c3fc0df757c6604d77b8e4c9e901606a88.1531345404.git.gaetan.rivet@6wind.com>",
        "X-Mailer": "git-send-email 2.18.0",
        "In-Reply-To": "<cover.1531345404.git.gaetan.rivet@6wind.com>",
        "References": "<cover.1531345404.git.gaetan.rivet@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH v11 25/25] eal: add generic dev parameter",
        "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": "Add the --dev parameter to the EAL.\nThis new parameter takes a generic device declaration as argument.\n\nIt uses the new devargs parsing API.\n\nSigned-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>\n---\n lib/librte_eal/common/eal_common_devargs.c |  4 +++\n lib/librte_eal/common/eal_common_options.c | 36 +++++++++++++++++++---\n lib/librte_eal/common/eal_options.h        |  2 ++\n 3 files changed, 37 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c\nindex a22a2002e..22913b408 100644\n--- a/lib/librte_eal/common/eal_common_devargs.c\n+++ b/lib/librte_eal/common/eal_common_devargs.c\n@@ -219,6 +219,10 @@ rte_devargs_parse(struct rte_devargs *da, const char *dev)\n \tif (da == NULL)\n \t\treturn -EINVAL;\n \n+\tif (strncmp(dev, \"bus=\", 4) == 0 ||\n+\t    strncmp(dev, \"class=\", 6) == 0)\n+\t\treturn rte_devargs_layers_parse(da, dev);\n+\n \t/* Retrieve eventual bus info */\n \tdo {\n \t\tdevname = dev;\ndiff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex ecebb2923..89d608180 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -54,6 +54,7 @@ const struct option\n eal_long_options[] = {\n \t{OPT_BASE_VIRTADDR,     1, NULL, OPT_BASE_VIRTADDR_NUM    },\n \t{OPT_CREATE_UIO_DEV,    0, NULL, OPT_CREATE_UIO_DEV_NUM   },\n+\t{OPT_DEV,               1, NULL, OPT_DEV_NUM              },\n \t{OPT_FILE_PREFIX,       1, NULL, OPT_FILE_PREFIX_NUM      },\n \t{OPT_HELP,              0, NULL, OPT_HELP_NUM             },\n \t{OPT_HUGE_DIR,          1, NULL, OPT_HUGE_DIR_NUM         },\n@@ -109,6 +110,7 @@ TAILQ_HEAD(device_option_list, device_option);\n struct device_option {\n \tTAILQ_ENTRY(device_option) next;\n \n+\tint new;\n \tenum rte_devtype type;\n \tchar arg[];\n };\n@@ -121,7 +123,8 @@ static int mem_parsed;\n static int core_parsed;\n \n static int\n-eal_option_device_add(enum rte_devtype type, const char *optarg)\n+eal_option_device_add(enum rte_devtype type, const char *optarg,\n+\t\t      int new)\n {\n \tstruct device_option *devopt;\n \tsize_t optlen;\n@@ -135,6 +138,7 @@ eal_option_device_add(enum rte_devtype type, const char *optarg)\n \t}\n \n \tdevopt->type = type;\n+\tdevopt->new = new;\n \tret = snprintf(devopt->arg, optlen, \"%s\", optarg);\n \tif (ret < 0) {\n \t\tRTE_LOG(ERR, EAL, \"Unable to copy device option\\n\");\n@@ -154,7 +158,22 @@ eal_option_device_parse(void)\n \n \tTAILQ_FOREACH_SAFE(devopt, &devopt_list, next, tmp) {\n \t\tif (ret == 0) {\n-\t\t\tret = rte_devargs_add(devopt->type, devopt->arg);\n+\t\t\tif (devopt->new) {\n+\t\t\t\tstruct rte_devargs *da;\n+\n+\t\t\t\tda = calloc(1, sizeof(*da));\n+\t\t\t\tret = rte_devargs_parse(da, devopt->arg);\n+\t\t\t\tif (ret) {\n+\t\t\t\t\tfree(da);\n+\t\t\t\t} else {\n+\t\t\t\t\tret = rte_devargs_insert(da);\n+\t\t\t\t\tif (ret)\n+\t\t\t\t\t\tfree(da);\n+\t\t\t\t}\n+\t\t\t} else {\n+\t\t\t\tret = rte_devargs_add(devopt->type,\n+\t\t\t\t\t\t      devopt->arg);\n+\t\t\t}\n \t\t\tif (ret)\n \t\t\t\tRTE_LOG(ERR, EAL, \"Unable to parse device '%s'\\n\",\n \t\t\t\t\tdevopt->arg);\n@@ -1038,7 +1057,7 @@ eal_parse_common_option(int opt, const char *optarg,\n \t\tif (w_used)\n \t\t\tgoto bw_used;\n \t\tif (eal_option_device_add(RTE_DEVTYPE_BLACKLISTED_PCI,\n-\t\t\t\toptarg) < 0) {\n+\t\t\t\toptarg, 0) < 0) {\n \t\t\treturn -1;\n \t\t}\n \t\tb_used = 1;\n@@ -1048,7 +1067,7 @@ eal_parse_common_option(int opt, const char *optarg,\n \t\tif (b_used)\n \t\t\tgoto bw_used;\n \t\tif (eal_option_device_add(RTE_DEVTYPE_WHITELISTED_PCI,\n-\t\t\t\toptarg) < 0) {\n+\t\t\t\toptarg, 0) < 0) {\n \t\t\treturn -1;\n \t\t}\n \t\tw_used = 1;\n@@ -1177,9 +1196,16 @@ eal_parse_common_option(int opt, const char *optarg,\n \t\t}\n \t\tbreak;\n \n+\tcase OPT_DEV_NUM:\n+\t\tif (eal_option_device_add(RTE_DEVTYPE_VIRTUAL,\n+\t\t\t\toptarg, 1) < 0) {\n+\t\t\treturn -1;\n+\t\t}\n+\t\tbreak;\n+\n \tcase OPT_VDEV_NUM:\n \t\tif (eal_option_device_add(RTE_DEVTYPE_VIRTUAL,\n-\t\t\t\toptarg) < 0) {\n+\t\t\t\toptarg, 0) < 0) {\n \t\t\treturn -1;\n \t\t}\n \t\tbreak;\ndiff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h\nindex 211ae06ae..b1851864f 100644\n--- a/lib/librte_eal/common/eal_options.h\n+++ b/lib/librte_eal/common/eal_options.h\n@@ -21,6 +21,8 @@ enum {\n \tOPT_BASE_VIRTADDR_NUM,\n #define OPT_CREATE_UIO_DEV    \"create-uio-dev\"\n \tOPT_CREATE_UIO_DEV_NUM,\n+#define OPT_DEV               \"dev\"\n+\tOPT_DEV_NUM,\n #define OPT_FILE_PREFIX       \"file-prefix\"\n \tOPT_FILE_PREFIX_NUM,\n #define OPT_HUGE_DIR          \"huge-dir\"\n",
    "prefixes": [
        "v11",
        "25/25"
    ]
}