get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 12134,
    "url": "http://patches.dpdk.org/api/patches/12134/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1461152657-19969-13-git-send-email-david.marchand@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": "<1461152657-19969-13-git-send-email-david.marchand@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1461152657-19969-13-git-send-email-david.marchand@6wind.com",
    "date": "2016-04-20T11:44:12",
    "name": "[dpdk-dev,v2,12/17] pci: add a helper for device name",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "6083295dd471dac8e7f014c7e836b4341837ad7c",
    "submitter": {
        "id": 3,
        "url": "http://patches.dpdk.org/api/people/3/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@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/1461152657-19969-13-git-send-email-david.marchand@6wind.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/12134/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/12134/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 7CB25590B;\n\tWed, 20 Apr 2016 13:44:41 +0200 (CEST)",
            "from mail-wm0-f52.google.com (mail-wm0-f52.google.com\n\t[74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 6FF4537A8\n\tfor <dev@dpdk.org>; Wed, 20 Apr 2016 13:44:35 +0200 (CEST)",
            "by mail-wm0-f52.google.com with SMTP id u206so76783948wme.1\n\tfor <dev@dpdk.org>; Wed, 20 Apr 2016 04:44:35 -0700 (PDT)",
            "from gloops.dev.6wind.com (144.77.126.78.rev.sfr.net.\n\t[78.126.77.144]) by smtp.gmail.com with ESMTPSA id\n\tm6sm5195708wje.21.2016.04.20.04.44.34\n\t(version=TLSv1/SSLv3 cipher=OTHER);\n\tWed, 20 Apr 2016 04:44:34 -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=nq3D5hc5hPqDWSIuEBX3zaXMFoAdgPzwoF3eiV8to3E=;\n\tb=X2K1T5D4O3B9fHEP9E80wHZaSVwh1bDjlFNiHZ9ztsui7+KktQed5E/exBWEkcquLc\n\tCKKhd4qIpG7DE740tPSL2mCDwkByKRifWSBOW3ymtM3s0UWxuMJn8jGuwRja9WgUMtBU\n\tmG9OHWTqWIz8kya/F0Rn/sOFPU6Uz3darxO1FNnc49VkJaKiHfmsAmtBsq9isFvSIOQz\n\tHJi3T5V+iiEPD9dHgsuSmkeDBF08O7VT0zaSq+Zi+4qFUUyynZx81b1mvr7M8ILPDRZx\n\t05m/XgeQiviFpnFS2ijEb9dfY23VCIbK0IlPV59xll1Kib7jwkx0Ym+AXNEe9NvOlJyW\n\tq4fA==",
        "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:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=nq3D5hc5hPqDWSIuEBX3zaXMFoAdgPzwoF3eiV8to3E=;\n\tb=k0yynCK12RflwBAzGSJ+he6VfNgXOqpKplvRGRMWl/FDkzzp9sV0FwlSdPsE6i+yn6\n\t79JECsvthTOToJuXSHan2ep+nMwNPnoG2tJNlrQDOIYOE3VPgxXhHK2ZqIvljd1nr9Uf\n\tpfDPD5bgRjXwDXcR44KhBERdB9XzMUjF3UVPa/NH1LjpWL5SLs4Ph/7+SC2lTfc+zyZO\n\tLoGYMCT97E24TzxVCh94ccpN71QSV0t/phAM7QxA+YcpbeCwIXaRRKPEtbZoihq1aWjr\n\tOpjAcUwqY98yApBCdRvCOIzYxipWqq8Z7ybwZSwQNWLrlq4QR/hNqP6itk3Z1mJQk/U4\n\t5fEg==",
        "X-Gm-Message-State": "AOPr4FXx+7zQmJOU76naFV+usH5JBrge98xUPytXczjYlphYEQrurh/5xyqEQMgod/n9HZ/5",
        "X-Received": "by 10.194.95.198 with SMTP id dm6mr8672043wjb.136.1461152675277; \n\tWed, 20 Apr 2016 04:44:35 -0700 (PDT)",
        "From": "David Marchand <david.marchand@6wind.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas.monjalon@6wind.com,\n\tviktorin@rehivetech.com",
        "Date": "Wed, 20 Apr 2016 13:44:12 +0200",
        "Message-Id": "<1461152657-19969-13-git-send-email-david.marchand@6wind.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1461152657-19969-1-git-send-email-david.marchand@6wind.com>",
        "References": "<1454076516-21591-1-git-send-email-david.marchand@6wind.com>\n\t<1461152657-19969-1-git-send-email-david.marchand@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH v2 12/17] pci: add a helper for device name",
        "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": "eal is a better place than crypto / ethdev for naming resources.\nAdd a helper in eal and make use of it in crypto / ethdev.\n\nSigned-off-by: David Marchand <david.marchand@6wind.com>\n---\n lib/librte_cryptodev/rte_cryptodev.c    | 27 ++++-----------------------\n lib/librte_eal/common/include/rte_pci.h | 25 +++++++++++++++++++++++++\n lib/librte_ether/rte_ethdev.c           | 24 ++++--------------------\n 3 files changed, 33 insertions(+), 43 deletions(-)",
    "diff": "diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c\nindex d9648a2..6f4d1c4 100644\n--- a/lib/librte_cryptodev/rte_cryptodev.c\n+++ b/lib/librte_cryptodev/rte_cryptodev.c\n@@ -276,23 +276,6 @@ rte_cryptodev_pmd_allocate(const char *name, int socket_id)\n \treturn cryptodev;\n }\n \n-static inline int\n-rte_cryptodev_create_unique_device_name(char *name, size_t size,\n-\t\tstruct rte_pci_device *pci_dev)\n-{\n-\tint ret;\n-\n-\tif ((name == NULL) || (pci_dev == NULL))\n-\t\treturn -EINVAL;\n-\n-\tret = snprintf(name, size, \"%d:%d.%d\",\n-\t\t\tpci_dev->addr.bus, pci_dev->addr.devid,\n-\t\t\tpci_dev->addr.function);\n-\tif (ret < 0)\n-\t\treturn ret;\n-\treturn 0;\n-}\n-\n int\n rte_cryptodev_pmd_release_device(struct rte_cryptodev *cryptodev)\n {\n@@ -355,9 +338,8 @@ rte_cryptodev_pci_probe(struct rte_pci_driver *pci_drv,\n \tif (cryptodrv == NULL)\n \t\treturn -ENODEV;\n \n-\t/* Create unique Crypto device name using PCI address */\n-\trte_cryptodev_create_unique_device_name(cryptodev_name,\n-\t\t\tsizeof(cryptodev_name), pci_dev);\n+\trte_eal_pci_device_name(&pci_dev->addr, cryptodev_name,\n+\t\t\tsizeof(cryptodev_name));\n \n \tcryptodev = rte_cryptodev_pmd_allocate(cryptodev_name, rte_socket_id());\n \tif (cryptodev == NULL)\n@@ -412,9 +394,8 @@ rte_cryptodev_pci_remove(struct rte_pci_device *pci_dev)\n \tif (pci_dev == NULL)\n \t\treturn -EINVAL;\n \n-\t/* Create unique device name using PCI address */\n-\trte_cryptodev_create_unique_device_name(cryptodev_name,\n-\t\t\tsizeof(cryptodev_name), pci_dev);\n+\trte_eal_pci_device_name(&pci_dev->addr, cryptodev_name,\n+\t\t\tsizeof(cryptodev_name));\n \n \tcryptodev = rte_cryptodev_pmd_get_named_dev(cryptodev_name);\n \tif (cryptodev == NULL)\ndiff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h\nindex f99b33a..3bb1833 100644\n--- a/lib/librte_eal/common/include/rte_pci.h\n+++ b/lib/librte_eal/common/include/rte_pci.h\n@@ -82,6 +82,7 @@ extern \"C\" {\n #include <stdint.h>\n #include <inttypes.h>\n \n+#include <rte_debug.h>\n #include <rte_interrupts.h>\n \n TAILQ_HEAD(pci_device_list, rte_pci_device); /**< PCI devices in D-linked Q. */\n@@ -95,6 +96,7 @@ extern struct pci_device_list pci_device_list; /**< Global list of PCI devices.\n \n /** Formatting string for PCI device identifier: Ex: 0000:00:01.0 */\n #define PCI_PRI_FMT \"%.4\" PRIx16 \":%.2\" PRIx8 \":%.2\" PRIx8 \".%\" PRIx8\n+#define PCI_PRI_STR_SIZE sizeof(\"XXXX:XX:XX.X\")\n \n /** Short formatting string, without domain, for PCI device: Ex: 00:01.0 */\n #define PCI_SHORT_PRI_FMT \"%.2\" PRIx8 \":%.2\" PRIx8 \".%\" PRIx8\n@@ -309,6 +311,29 @@ eal_parse_pci_DomBDF(const char *input, struct rte_pci_addr *dev_addr)\n }\n #undef GET_PCIADDR_FIELD\n \n+/**\n+ * Utility function to write a pci device name, this device name can later be\n+ * used to retrieve the corresponding rte_pci_addr using above functions.\n+ *\n+ * @param addr\n+ *\tThe PCI Bus-Device-Function address\n+ * @param output\n+ *\tThe output buffer string\n+ * @param size\n+ *\tThe output buffer size\n+ * @return\n+ *  0 on success, negative on error.\n+ */\n+static inline void\n+rte_eal_pci_device_name(const struct rte_pci_addr *addr,\n+\t\t    char *output, size_t size)\n+{\n+\tRTE_VERIFY(size >= PCI_PRI_STR_SIZE);\n+\tRTE_VERIFY(snprintf(output, size, PCI_PRI_FMT,\n+\t\t\t    addr->domain, addr->bus,\n+\t\t\t    addr->devid, addr->function) >= 0);\n+}\n+\n /* Compare two PCI device addresses. */\n /**\n  * Utility function to compare two PCI device addresses.\ndiff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex 7ec8cdb..9d5827b 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -214,20 +214,6 @@ rte_eth_dev_allocate(const char *name, enum rte_eth_dev_type type)\n \treturn eth_dev;\n }\n \n-static int\n-rte_eth_dev_create_unique_device_name(char *name, size_t size,\n-\t\tstruct rte_pci_device *pci_dev)\n-{\n-\tint ret;\n-\n-\tret = snprintf(name, size, \"%d:%d.%d\",\n-\t\t\tpci_dev->addr.bus, pci_dev->addr.devid,\n-\t\t\tpci_dev->addr.function);\n-\tif (ret < 0)\n-\t\treturn ret;\n-\treturn 0;\n-}\n-\n int\n rte_eth_dev_release_port(struct rte_eth_dev *eth_dev)\n {\n@@ -251,9 +237,8 @@ rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv,\n \n \teth_drv = (struct eth_driver *)pci_drv;\n \n-\t/* Create unique Ethernet device name using PCI address */\n-\trte_eth_dev_create_unique_device_name(ethdev_name,\n-\t\t\tsizeof(ethdev_name), pci_dev);\n+\trte_eal_pci_device_name(&pci_dev->addr, ethdev_name,\n+\t\t\tsizeof(ethdev_name));\n \n \teth_dev = rte_eth_dev_allocate(ethdev_name, RTE_ETH_DEV_PCI);\n \tif (eth_dev == NULL)\n@@ -304,9 +289,8 @@ rte_eth_dev_pci_remove(struct rte_pci_device *pci_dev)\n \tif (pci_dev == NULL)\n \t\treturn -EINVAL;\n \n-\t/* Create unique Ethernet device name using PCI address */\n-\trte_eth_dev_create_unique_device_name(ethdev_name,\n-\t\t\tsizeof(ethdev_name), pci_dev);\n+\trte_eal_pci_device_name(&pci_dev->addr, ethdev_name,\n+\t\t\tsizeof(ethdev_name));\n \n \teth_dev = rte_eth_dev_allocated(ethdev_name);\n \tif (eth_dev == NULL)\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "12/17"
    ]
}