get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 23259,
    "url": "http://patches.dpdk.org/api/patches/23259/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1491460427-38765-2-git-send-email-wei.zhao1@intel.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": "<1491460427-38765-2-git-send-email-wei.zhao1@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1491460427-38765-2-git-send-email-wei.zhao1@intel.com",
    "date": "2017-04-06T06:33:45",
    "name": "[dpdk-dev,v5,1/3] lib/librte_ether: add support for port reset",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "79872a263dcf2d8086adb0b1b7e2d6fbef8fc4b0",
    "submitter": {
        "id": 495,
        "url": "http://patches.dpdk.org/api/people/495/?format=api",
        "name": "Zhao1, Wei",
        "email": "wei.zhao1@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1491460427-38765-2-git-send-email-wei.zhao1@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/23259/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/23259/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 6589CD003;\n\tThu,  6 Apr 2017 08:40:18 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 077DE69EC\n\tfor <dev@dpdk.org>; Thu,  6 Apr 2017 08:40:12 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t05 Apr 2017 23:40:11 -0700",
            "from dpdk1.bj.intel.com ([172.16.182.84])\n\tby fmsmga004.fm.intel.com with ESMTP; 05 Apr 2017 23:40:10 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=simple/simple;\n\td=intel.com; i=@intel.com; q=dns/txt; s=intel;\n\tt=1491460813; x=1522996813;\n\th=from:to:cc:subject:date:message-id:in-reply-to: references;\n\tbh=DbNVyehKYj+8TMzzzkLssfYigNCiYB5eg+6ejgwpLSY=;\n\tb=CmA5ObrLmEWVDveL144RDApmP/emkJLWQ/gyHOlOFM5b4XxNssioewwF\n\tspD/l5xIeyfSAIyFGv4vB40vYY9fag==;",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.37,283,1488873600\"; d=\"scan'208\";a=\"244894937\"",
        "From": "Wei Zhao <wei.zhao1@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Wenzhuo Lu <wenzhuo.lu@intel.com>,\n\tWei Zhao <wei.zhao1@intel.com>",
        "Date": "Thu,  6 Apr 2017 14:33:45 +0800",
        "Message-Id": "<1491460427-38765-2-git-send-email-wei.zhao1@intel.com>",
        "X-Mailer": "git-send-email 2.5.5",
        "In-Reply-To": "<1491460427-38765-1-git-send-email-wei.zhao1@intel.com>",
        "References": "<1490866456-52241-1-git-send-email-wei.zhao1@intel.com>\n\t<1491460427-38765-1-git-send-email-wei.zhao1@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v5 1/3] lib/librte_ether: add support for port\n\treset",
        "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 port reset in rte layer.This reset\nfeature can not only used in vf port reset in later code\ndevelop, but alsopf port.But in this patch set, we only\nlimit the discussion scope to vf reset.\nThis patch Add 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.This API can\nalso do some restore work for the port.\n\nSigned-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>\nSigned-off-by: Wei Zhao <wei.zhao1@intel.com>\n---\n lib/librte_ether/rte_ethdev.c          | 17 +++++++++++++++++\n lib/librte_ether/rte_ethdev.h          | 28 ++++++++++++++++++++++++++++\n lib/librte_ether/rte_ether_version.map |  6 ++++++\n 3 files changed, 51 insertions(+)",
    "diff": "diff --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 4be217c..48c0d0b 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@@ -1509,6 +1512,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@@ -4413,6 +4419,28 @@ 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+ * This function can also do some restore work for the port, for example, it can \n+ * restore the added parameters of vlan,  mac_addrs, promisc_unicast_enabled flag\n+ * and promisc_multicast_enabled flag.\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",
        "v5",
        "1/3"
    ]
}