get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1370,
    "url": "https://patches.dpdk.org/api/patches/1370/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1416474399-16851-8-git-send-email-mukawa@igel.co.jp/",
    "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": "<1416474399-16851-8-git-send-email-mukawa@igel.co.jp>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1416474399-16851-8-git-send-email-mukawa@igel.co.jp",
    "date": "2014-11-20T09:06:21",
    "name": "[dpdk-dev,07/25] ethdev: Add functions to know which port is attached or detached",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ebb4e1f276ff69d734be055a92029d8433ab0b57",
    "submitter": {
        "id": 64,
        "url": "https://patches.dpdk.org/api/people/64/?format=api",
        "name": "Tetsuya Mukawa",
        "email": "mukawa@igel.co.jp"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1416474399-16851-8-git-send-email-mukawa@igel.co.jp/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1370/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1370/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 73B707FC6;\n\tThu, 20 Nov 2014 09:57:06 +0100 (CET)",
            "from mail-pa0-f52.google.com (mail-pa0-f52.google.com\n\t[209.85.220.52]) by dpdk.org (Postfix) with ESMTP id F23D07F7D\n\tfor <dev@dpdk.org>; Thu, 20 Nov 2014 09:57:03 +0100 (CET)",
            "by mail-pa0-f52.google.com with SMTP id eu11so2163374pac.39\n\tfor <dev@dpdk.org>; Thu, 20 Nov 2014 01:07:32 -0800 (PST)",
            "from localhost.localdomain (napt.igel.co.jp. [219.106.231.132])\n\tby mx.google.com with ESMTPSA id\n\ta6sm1432407pbu.64.2014.11.20.01.07.30 for <multiple recipients>\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tThu, 20 Nov 2014 01:07:32 -0800 (PST)"
        ],
        "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=9DXMXtbmpDgHkOOc22VCA+tAP/juW95QSTLeqoOhPdk=;\n\tb=CI0FdJ+fyPEs8pLEi30zqE4y1svobQAcibDjRcxsc95a3CWHYj6N+ff2Di+jXspTJr\n\tlNqrTzPD2rN6JyRds5yvbkIrr0x9HVhIZORQ/6orXtSBZoQRvX5RSBPxYXN+hLHEhfVz\n\t4/WnaZTBx++Mlpjs5/RPQLxgImtToqo1eqV4B2fRodV8kBrqNKAxrfphvv4fCCxZGjbb\n\tgNGCiIF7XqCS6mcEiMsw8sxdO3eg1nuldDhHotCBnzrsEoqH6UU988uCjihlbBDNij/p\n\tMnZtHw6LBXhGyxb0Ug4WQkt9Ktzz0Zfu+CGoIU9vIRMw7Gi8vCUJV4gC3y6IB5i+cQFj\n\teHsg==",
        "X-Gm-Message-State": "ALoCoQk9g+F4P0Nj8k4oxy7L4a81PcmNftU0grayIEeyM879IXd2QJEDbWNtsnGu+HQtK2w3ijNO",
        "X-Received": "by 10.70.140.225 with SMTP id rj1mr22375337pdb.48.1416474452777; \n\tThu, 20 Nov 2014 01:07:32 -0800 (PST)",
        "From": "Tetsuya Mukawa <mukawa@igel.co.jp>",
        "To": "dev@dpdk.org",
        "Date": "Thu, 20 Nov 2014 18:06:21 +0900",
        "Message-Id": "<1416474399-16851-8-git-send-email-mukawa@igel.co.jp>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1416474399-16851-1-git-send-email-mukawa@igel.co.jp>",
        "References": "<1414572576-21371-1-git-send-email-mukawa@igel.co.jp>\n\t<1416474399-16851-1-git-send-email-mukawa@igel.co.jp>",
        "Cc": "nakajima.yoshihiro@lab.ntt.co.jp, menrigh@brocade.com,\n\tmasutani.hitoshi@lab.ntt.co.jp",
        "Subject": "[dpdk-dev] [PATCH 07/25] ethdev: Add functions to know which port\n\tis attached or detached",
        "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": "The patch adds rte_eth_dev_save() and rte_eth_dev_get_changed_port().\nrte_eth_dev_save() is used for saving current rte_eth_dev structures.\nrte_eth_dev_get_changed_port() receives the rte_eth_dev structures, then\ncompare these with current values to know which port is actually\nattached or detached.\n\nSigned-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>\n---\n lib/librte_ether/rte_ethdev.c | 18 ++++++++++++++++++\n lib/librte_ether/rte_ethdev.h | 21 +++++++++++++++++++++\n 2 files changed, 39 insertions(+)",
    "diff": "diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex c9f82d9..5e1b6b9 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -402,6 +402,24 @@ rte_eth_dev_count(void)\n \treturn (nb_ports);\n }\n \n+void\n+rte_eth_dev_save(struct rte_eth_dev *devs)\n+{\n+\t/* save current rte_eth_devices */\n+\tmemcpy(devs, rte_eth_devices,\n+\t\t\tsizeof(struct rte_eth_dev) * RTE_MAX_ETHPORTS);\n+}\n+\n+int\n+rte_eth_dev_get_changed_port(struct rte_eth_dev *devs, uint8_t *port_id)\n+{\n+\t/* check which port was attached or detached */\n+\tfor (*port_id = 0; *port_id < RTE_MAX_ETHPORTS; (*port_id)++, devs++)\n+\t\tif (rte_eth_devices[*port_id].attached ^ devs->attached)\n+\t\t\treturn 0;\n+\treturn 1;\n+}\n+\n static int\n rte_eth_dev_rx_queue_config(struct rte_eth_dev *dev, uint16_t nb_queues)\n {\ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex 558d4d3..683b79c 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -1638,6 +1638,27 @@ extern struct rte_eth_dev rte_eth_devices[];\n extern uint8_t rte_eth_dev_count(void);\n \n /**\n+ * Function for internal use by port hotplug functions.\n+ * Copies current ethdev structures to the specified pointer.\n+ *\n+ * @param\tdevs\tThe pointer to the ethdev structures\n+ */\n+extern void rte_eth_dev_save(struct rte_eth_dev *devs);\n+\n+/**\n+ * Function for internal use by port hotplug functions.\n+ * Compare the specified ethdev structures with currrents. Then\n+ * if there is a port which status is changed, fill the specified pointer\n+ * with the port id of that port.\n+ * @param\tdevs\tThe pointer to the ethdev structures\n+ * @param\tport_id\tThe pointer to the port id\n+ * @return\n+ *   - 0 on success, negative on error\n+ */\n+extern int rte_eth_dev_get_changed_port(\n+\t\tstruct rte_eth_dev *devs, uint8_t *port_id);\n+\n+/**\n  * Function for internal use by dummy drivers primarily, e.g. ring-based\n  * driver.\n  * Allocates a new ethdev slot for an ethernet device and returns the pointer\n",
    "prefixes": [
        "dpdk-dev",
        "07/25"
    ]
}