get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 7424,
    "url": "https://patches.dpdk.org/api/patches/7424/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1444058768-9208-1-git-send-email-3chas3@gmail.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": "<1444058768-9208-1-git-send-email-3chas3@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1444058768-9208-1-git-send-email-3chas3@gmail.com",
    "date": "2015-10-05T15:26:08",
    "name": "[dpdk-dev,v2] devargs: add blacklisting by linux interface name",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "62f34181b89f6c1227e2496e6b061080d0f368b0",
    "submitter": {
        "id": 341,
        "url": "https://patches.dpdk.org/api/people/341/?format=api",
        "name": "Chas Williams",
        "email": "3chas3@gmail.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1444058768-9208-1-git-send-email-3chas3@gmail.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/7424/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/7424/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 575FE91C8;\n\tMon,  5 Oct 2015 17:26:18 +0200 (CEST)",
            "from mail-qk0-f180.google.com (mail-qk0-f180.google.com\n\t[209.85.220.180]) by dpdk.org (Postfix) with ESMTP id 95FC791B7\n\tfor <dev@dpdk.org>; Mon,  5 Oct 2015 17:26:16 +0200 (CEST)",
            "by qkas79 with SMTP id s79so70055942qka.0\n\tfor <dev@dpdk.org>; Mon, 05 Oct 2015 08:26:16 -0700 (PDT)",
            "from foobar.home (pool-71-163-182-126.washdc.fios.verizon.net.\n\t[71.163.182.126]) by smtp.gmail.com with ESMTPSA id\n\tz2sm11584409qkz.20.2015.10.05.08.26.14\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 05 Oct 2015 08:26:15 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=ssBHsXAgeVTF6In3QjIOjEhIDvAGuaBmVFIdNs9GtQA=;\n\tb=H13Wh3ihJAq1dGdx71s01T8obhdy4kTWYfmHJixgd3gxKRfNdbxQl8bxo8vorxqRq2\n\toJxRj5vSaTMqBMSTIU9WC2Xu4xsM8AAVzKjKcoM2o6bGR3yWKeRu4ELoVjVIOApNw6h4\n\tMmw8LoOg8p4MjHwBE+IVJzT8GnrlFLPT/Tjz19qB5T8tx6gKu5jw61IDBclTVDh2lbxF\n\tJ2vXdCCALqIvfW0z7XUG+O46GcqYzmy5cA1e3a5Ocyybe78bUPPoHOvcMtDOpE/yHavc\n\tNrFaOT8uySe2vw88gR2Fls2wiGNrtxAELEkw4WdLAIjOhfvJduN3T/ct3ybMAo1WQ5Wh\n\tkhuQ==",
        "X-Received": "by 10.55.214.80 with SMTP id t77mr11054268qki.101.1444058775657; \n\tMon, 05 Oct 2015 08:26:15 -0700 (PDT)",
        "From": "Chas Williams <3chas3@gmail.com>",
        "To": "dev@dpdk.org",
        "Date": "Mon,  5 Oct 2015 11:26:08 -0400",
        "Message-Id": "<1444058768-9208-1-git-send-email-3chas3@gmail.com>",
        "X-Mailer": "git-send-email 2.1.0",
        "In-Reply-To": "<1443798007-20122-1-git-send-email-3chas3@gmail.com>",
        "References": "<1443798007-20122-1-git-send-email-3chas3@gmail.com>",
        "Subject": "[dpdk-dev] [PATCH v2] devargs: add blacklisting by linux interface\n\tname",
        "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": "If a system is using deterministic interface names, it may be easier in\nsome cases to use the interface name to blacklist an interface.\n\nSigned-off-by: Chas Williams <3chas3@gmail.com>\n---\n app/test/test_devargs.c                     |  2 ++\n lib/librte_eal/common/eal_common_devargs.c  |  9 +++++++--\n lib/librte_eal/common/eal_common_options.c  |  2 +-\n lib/librte_eal/common/eal_common_pci.c      | 10 ++++++++--\n lib/librte_eal/common/include/rte_devargs.h |  2 ++\n lib/librte_eal/common/include/rte_pci.h     |  1 +\n lib/librte_eal/linuxapp/eal/eal_pci.c       | 15 +++++++++++++++\n 7 files changed, 36 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/app/test/test_devargs.c b/app/test/test_devargs.c\nindex f7fc59c..27855ff 100644\n--- a/app/test/test_devargs.c\n+++ b/app/test/test_devargs.c\n@@ -73,6 +73,8 @@ test_devargs(void)\n \t\tgoto fail;\n \tif (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI, \"0000:01:00.1\") < 0)\n \t\tgoto fail;\n+\tif (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI, \"eth0\") < 0)\n+\t\tgoto fail;\n \tif (rte_eal_devargs_type_count(RTE_DEVTYPE_WHITELISTED_PCI) != 2)\n \t\tgoto fail;\n \tif (rte_eal_devargs_type_count(RTE_DEVTYPE_BLACKLISTED_PCI) != 2)\ndiff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c\nindex ec56165..1fb8bad 100644\n--- a/lib/librte_eal/common/eal_common_devargs.c\n+++ b/lib/librte_eal/common/eal_common_devargs.c\n@@ -101,8 +101,13 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)\n \tcase RTE_DEVTYPE_BLACKLISTED_PCI:\n \t\t/* try to parse pci identifier */\n \t\tif (eal_parse_pci_BDF(buf, &devargs->pci.addr) != 0 &&\n-\t\t    eal_parse_pci_DomBDF(buf, &devargs->pci.addr) != 0)\n-\t\t\tgoto fail;\n+\t\t    eal_parse_pci_DomBDF(buf, &devargs->pci.addr) != 0) {\n+\t\t\t/* save as interface name instead */\n+\t\t\tret = snprintf(devargs->pci.name,\n+\t\t\t\t       sizeof(devargs->pci.name), \"%s\", buf);\n+\t\t\tif (ret < 0 || ret >= (int)sizeof(devargs->pci.name))\n+\t\t\t\tgoto fail;\n+\t\t}\n \n \t\tbreak;\n \tcase RTE_DEVTYPE_VIRTUAL:\ndiff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex 1f459ac..6920088 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -889,7 +889,7 @@ eal_common_usage(void)\n \t       \"  -r RANKS            Force number of memory ranks (don't detect)\\n\"\n \t       \"  -b, --\"OPT_PCI_BLACKLIST\" Add a PCI device in black list.\\n\"\n \t       \"                      Prevent EAL from using this PCI device. The argument\\n\"\n-\t       \"                      format is <domain:bus:devid.func>.\\n\"\n+\t       \"                      format is <domain:bus:devid.func> or <name>.\\n\"\n \t       \"  -w, --\"OPT_PCI_WHITELIST\" Add a PCI device in white list.\\n\"\n \t       \"                      Only use the specified PCI devices. The argument format\\n\"\n \t       \"                      is <[domain:]bus:devid.func>. This option can be present\\n\"\ndiff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c\nindex dcfe947..288c8bd 100644\n--- a/lib/librte_eal/common/eal_common_pci.c\n+++ b/lib/librte_eal/common/eal_common_pci.c\n@@ -93,8 +93,14 @@ static struct rte_devargs *pci_devargs_lookup(struct rte_pci_device *dev)\n \t\tif (devargs->type != RTE_DEVTYPE_BLACKLISTED_PCI &&\n \t\t\tdevargs->type != RTE_DEVTYPE_WHITELISTED_PCI)\n \t\t\tcontinue;\n-\t\tif (!rte_eal_compare_pci_addr(&dev->addr, &devargs->pci.addr))\n-\t\t\treturn devargs;\n+\n+\t\tif (devargs->pci.name[0] == '\\0') {\n+\t\t\tif (!rte_eal_compare_pci_addr(&dev->addr, &devargs->pci.addr))\n+\t\t\t\treturn devargs;\n+\t\t} else {\n+\t\t\tif (strcmp(dev->name, devargs->pci.name) == 0)\n+\t\t\t\treturn devargs;\n+\t\t}\n \t}\n \treturn NULL;\n }\ndiff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h\nindex 7084ae2..bc436ec 100644\n--- a/lib/librte_eal/common/include/rte_devargs.h\n+++ b/lib/librte_eal/common/include/rte_devargs.h\n@@ -81,6 +81,8 @@ struct rte_devargs {\n \t\tstruct {\n \t\t\t/** PCI location. */\n \t\t\tstruct rte_pci_addr addr;\n+\t\t\t/** Interface name. */\n+\t\t\tchar name[32];\n \t\t} pci;\n \t\t/** Used if type is RTE_DEVTYPE_VIRTUAL. */\n \t\tstruct {\ndiff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h\nindex 83e3c28..852c149 100644\n--- a/lib/librte_eal/common/include/rte_pci.h\n+++ b/lib/librte_eal/common/include/rte_pci.h\n@@ -161,6 +161,7 @@ struct rte_pci_device {\n \tstruct rte_pci_resource mem_resource[PCI_MAX_RESOURCE];   /**< PCI Memory Resource */\n \tstruct rte_intr_handle intr_handle;     /**< Interrupt handle */\n \tstruct rte_pci_driver *driver;          /**< Associated driver */\n+\tchar name[32];\t\t\t\t/**< Interface name (if any) */\n \tuint16_t max_vfs;                       /**< sriov enable if not zero */\n \tint numa_node;                          /**< NUMA node connection */\n \tstruct rte_devargs *devargs;            /**< Device user arguments */\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c\nindex bc5b5be..befb71f 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_pci.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c\n@@ -260,6 +260,8 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus,\n \tunsigned long tmp;\n \tstruct rte_pci_device *dev;\n \tchar driver[PATH_MAX];\n+\tstruct dirent *e;\n+\tDIR *dir;\n \tint ret;\n \n \tdev = malloc(sizeof(*dev));\n@@ -352,6 +354,19 @@ pci_scan_one(const char *dirname, uint16_t domain, uint8_t bus,\n \t\treturn -1;\n \t}\n \n+\t/* get network interface name */\n+\tsnprintf(filename, sizeof(filename), \"%s/net\", dirname);\n+\tdir = opendir(filename);\n+\tif (dir) {\n+\t\twhile ((e = readdir(dir)) != NULL) {\n+\t\t\tif (e->d_name[0] == '.')\n+\t\t\t\tcontinue;\n+\n+\t\t\tstrncpy(dev->name, e->d_name, sizeof(dev->name));\n+\t\t}\n+\t\tclosedir(dir);\n+\t}\n+\n \tif (!ret) {\n \t\tif (!strcmp(driver, \"vfio-pci\"))\n \t\t\tdev->kdrv = RTE_KDRV_VFIO;\n",
    "prefixes": [
        "dpdk-dev",
        "v2"
    ]
}