get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 21176,
    "url": "https://patches.dpdk.org/api/patches/21176/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1488516984-34702-3-git-send-email-wei.zhao1@intel.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": "<1488516984-34702-3-git-send-email-wei.zhao1@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1488516984-34702-3-git-send-email-wei.zhao1@intel.com",
    "date": "2017-03-03T04:56:23",
    "name": "[dpdk-dev,2/3] lib/librte_ether: add support for port reset",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "7099563b441a093ee9329cec2f5d0aa2193a7eda",
    "submitter": {
        "id": 495,
        "url": "https://patches.dpdk.org/api/people/495/?format=api",
        "name": "Zhao1, Wei",
        "email": "wei.zhao1@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1488516984-34702-3-git-send-email-wei.zhao1@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/21176/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/21176/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 84F86C304;\n\tFri,  3 Mar 2017 06:03:52 +0100 (CET)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id AEEEB2B9D\n\tfor <dev@dpdk.org>; Fri,  3 Mar 2017 06:03:14 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Mar 2017 21:03:13 -0800",
            "from dpdk1.bj.intel.com ([172.16.182.84])\n\tby FMSMGA003.fm.intel.com with ESMTP; 02 Mar 2017 21:03:12 -0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.35,235,1484035200\"; d=\"scan'208\";a=\"830405473\"",
        "From": "Wei Zhao <wei.zhao1@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Wei Zhao <wei.zhao1@intel.com>,\n\tWenzhuo Lu <wenzhuo.lu@intel.com>",
        "Date": "Fri,  3 Mar 2017 12:56:23 +0800",
        "Message-Id": "<1488516984-34702-3-git-send-email-wei.zhao1@intel.com>",
        "X-Mailer": "git-send-email 2.5.5",
        "In-Reply-To": "<1488516984-34702-1-git-send-email-wei.zhao1@intel.com>",
        "References": "<1488516984-34702-1-git-send-email-wei.zhao1@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 2/3] lib/librte_ether: add support for port reset",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <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": "Add support for vf port reset in rte layer.\nAdd an API to restart the device.\nIt's for VF device in this scenario, kernel PF + DPDK VF.\nWhen the PF port down->up, APP should call this API to\nrestart VF port. Most likely, APP should call it in its\nmanagement thread and guarantee the thread safe. It means\nAPP should stop the rx/tx and the device, then restart\nthe device, then recover the device and rx/tx.\nAlso, it's APP's responsibilty to release the occupied\nmemory.\n\nSigned-off-by: Wei Zhao <wei.zhao1@intel.com>\nSigned-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>\n---\n app/test-pmd/testpmd.c                 |  1 +\n lib/librte_ether/rte_ethdev.c          | 17 +++++++++++++++++\n lib/librte_ether/rte_ethdev.h          | 25 +++++++++++++++++++++++++\n lib/librte_ether/rte_ether_version.map |  6 ++++++\n 4 files changed, 49 insertions(+)",
    "diff": "diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex 12b7aaa..44fcc51 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -1615,6 +1615,7 @@ reset_port(portid_t pid)\n \t\t\tcontinue;\n \t\t}\n \n+\t\trte_eth_dev_reset(pi);\n \t\treset_ports[pi] = 0;\n \n \t\tif (rte_atomic16_cmpset(&(port->port_status),\ndiff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex eb0a94a..2e06dca 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -3273,3 +3273,20 @@ rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id,\n \t\t\t\t-ENOTSUP);\n \treturn (*dev->dev_ops->l2_tunnel_offload_set)(dev, l2_tunnel, mask, en);\n }\n+\n+int\n+rte_eth_dev_reset(uint8_t port_id)\n+{\n+\tstruct rte_eth_dev *dev;\n+\tint diag;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_reset, -ENOTSUP);\n+\n+\tdiag = (*dev->dev_ops->dev_reset)(dev);\n+\n+\treturn diag;\n+}\ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex 97f3e2d..77a5b79 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -1367,6 +1367,9 @@ typedef int (*eth_l2_tunnel_offload_set_t)\n \t uint8_t en);\n /**< @internal enable/disable the l2 tunnel offload functions */\n \n+typedef int  (*eth_dev_reset_t)(struct rte_eth_dev *dev);\n+/**< @internal Function used to reset a configured Ethernet device. */\n+\n #ifdef RTE_NIC_BYPASS\n \n enum {\n@@ -1508,6 +1511,9 @@ struct eth_dev_ops {\n \teth_l2_tunnel_offload_set_t   l2_tunnel_offload_set;\n \t/** Enable/disable l2 tunnel offload functions. */\n \n+\t/** Reset device. */\n+\teth_dev_reset_t dev_reset;\n+\n \teth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate limit. */\n \n \trss_hash_update_t          rss_hash_update; /** Configure RSS hash protocols. */\n@@ -4407,6 +4413,25 @@ int\n rte_eth_dev_get_name_by_port(uint8_t port_id, char *name);\n \n /**\n+ * Reset an ethernet device when it's not working. One scenario is, after PF\n+ * port is down and up, the related VF port should be reset.\n+ * The API will stop the port, clear the rx/tx queues, re-setup the rx/tx\n+ * queues, restart the port.\n+ * Before calling this API, APP should stop the rx/tx. When tx is being stopped,\n+ * APP can drop the packets and release the buffer instead of sending them.\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ *\n+ * @return\n+ *   - (0) if successful.\n+ *   - (-ENODEV) if port identifier is invalid.\n+ *   - (-ENOTSUP) if hardware doesn't support this function.\n+ */\n+int\n+rte_eth_dev_reset(uint8_t port_id);\n+\n+/**\n  * @internal\n  * Wrapper for use by pci drivers as a .probe function to attach to a ethdev\n  * interface.\ndiff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map\nindex c6c9d0d..529b27f 100644\n--- a/lib/librte_ether/rte_ether_version.map\n+++ b/lib/librte_ether/rte_ether_version.map\n@@ -154,3 +154,9 @@ DPDK_17.02 {\n \trte_flow_validate;\n \n } DPDK_16.11;\n+\n+DPDK_17.05 {\n+\tglobal:\n+\n+\trte_eth_dev_reset;\n+} DPDK_17.02;\n\\ No newline at end of file\n",
    "prefixes": [
        "dpdk-dev",
        "2/3"
    ]
}