get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 832957,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/832957/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1509547642-51110-8-git-send-email-lipeng321@huawei.com/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/1.2/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1509547642-51110-8-git-send-email-lipeng321@huawei.com>",
    "list_archive_url": null,
    "date": "2017-11-01T14:47:20",
    "name": "[net-next,7/9] net: hns3: Add reset interface implementation in client",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "2fd89d2d4438c5e628579b2c3b28900cd6652ae2",
    "submitter": {
        "id": 71468,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/71468/?format=api",
        "name": "lipeng (Y)",
        "email": "lipeng321@huawei.com"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/1.2/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/1509547642-51110-8-git-send-email-lipeng321@huawei.com/mbox/",
    "series": [
        {
            "id": 11334,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/11334/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=11334",
            "date": "2017-11-01T14:47:14",
            "name": "net: hns3: add support for reset",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/11334/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/832957/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/832957/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3yRr580KvFz9sRq\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu,  2 Nov 2017 01:22:04 +1100 (AEDT)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1754781AbdKAOVv (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 1 Nov 2017 10:21:51 -0400",
            "from szxga06-in.huawei.com ([45.249.212.32]:38454 \"EHLO huawei.com\"\n\trhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP\n\tid S1754589AbdKAOVO (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tWed, 1 Nov 2017 10:21:14 -0400",
            "from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59])\n\tby Forcepoint Email with ESMTP id 34D796ED5D07B;\n\tWed,  1 Nov 2017 22:20:59 +0800 (CST)",
            "from linux-ioko.site (10.71.200.31) by\n\tDGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP\n\tServer id 14.3.361.1; Wed, 1 Nov 2017 22:19:51 +0800"
        ],
        "From": "Lipeng <lipeng321@huawei.com>",
        "To": "<davem@davemloft.net>",
        "CC": "<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,\n\t<linuxarm@huawei.com>, <yisen.zhuang@huawei.com>,\n\t<salil.mehta@huawei.com>, <lipeng321@huawei.com>",
        "Subject": "[PATCH net-next 7/9] net: hns3: Add reset interface implementation\n\tin client",
        "Date": "Wed, 1 Nov 2017 22:47:20 +0800",
        "Message-ID": "<1509547642-51110-8-git-send-email-lipeng321@huawei.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1509547642-51110-1-git-send-email-lipeng321@huawei.com>",
        "References": "<1509547642-51110-1-git-send-email-lipeng321@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.71.200.31]",
        "X-CFilter-Loop": "Reflected",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "This patch implement the interface of reset notification in hns3_enet\nit will do resetting business which include shutdown nic device,\nfree and initialize client side resource.\n\nSigned-off-by: qumingguang <qumingguang@huawei.com>\nSigned-off-by: Lipeng <lipeng321@huawei.com>\n---\n .../net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c | 153 +++++++++++++++++++++\n 1 file changed, 153 insertions(+)",
    "diff": "diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c\nindex aed6611..681a043 100644\n--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c\n+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_enet.c\n@@ -3009,11 +3009,164 @@ static int hns3_client_setup_tc(struct hnae3_handle *handle, u8 tc)\n \treturn ret;\n }\n \n+static void hns3_recover_hw_addr(struct net_device *ndev)\n+{\n+\tstruct netdev_hw_addr_list *list;\n+\tstruct netdev_hw_addr *ha, *tmp;\n+\n+\t/* go through and sync uc_addr entries to the device */\n+\tlist = &ndev->uc;\n+\tlist_for_each_entry_safe(ha, tmp, &list->list, list)\n+\t\thns3_nic_uc_sync(ndev, ha->addr);\n+\n+\t/* go through and sync mc_addr entries to the device */\n+\tlist = &ndev->mc;\n+\tlist_for_each_entry_safe(ha, tmp, &list->list, list)\n+\t\thns3_nic_mc_sync(ndev, ha->addr);\n+}\n+\n+static void hns3_drop_skb_data(struct hns3_enet_ring *ring, struct sk_buff *skb)\n+{\n+\tdev_kfree_skb_any(skb);\n+}\n+\n+static void hns3_clear_all_ring(struct hnae3_handle *h)\n+{\n+\tstruct net_device *ndev = h->kinfo.netdev;\n+\tstruct hns3_nic_priv *priv = netdev_priv(ndev);\n+\tu32 i;\n+\n+\tfor (i = 0; i < h->kinfo.num_tqps; i++) {\n+\t\tstruct netdev_queue *dev_queue;\n+\t\tstruct hns3_enet_ring *ring;\n+\n+\t\tring = priv->ring_data[i].ring;\n+\t\thns3_clean_tx_ring(ring, ring->desc_num);\n+\t\tdev_queue = netdev_get_tx_queue(ndev,\n+\t\t\t\t\t\tpriv->ring_data[i].queue_index);\n+\t\tnetdev_tx_reset_queue(dev_queue);\n+\n+\t\tring = priv->ring_data[i + h->kinfo.num_tqps].ring;\n+\t\thns3_clean_rx_ring(ring, ring->desc_num, hns3_drop_skb_data);\n+\t}\n+}\n+\n+static int hns3_reset_notify_down_enet(struct hnae3_handle *handle)\n+{\n+\tstruct hnae3_knic_private_info *kinfo = &handle->kinfo;\n+\tstruct net_device *ndev = kinfo->netdev;\n+\n+\tif (!netif_running(ndev))\n+\t\treturn -EIO;\n+\n+\treturn hns3_nic_net_stop(ndev);\n+}\n+\n+static int hns3_reset_notify_up_enet(struct hnae3_handle *handle)\n+{\n+\tstruct hnae3_knic_private_info *kinfo = &handle->kinfo;\n+\tstruct hns3_nic_priv *priv = netdev_priv(kinfo->netdev);\n+\tint ret = 0;\n+\n+\tif (netif_running(kinfo->netdev)) {\n+\t\tret = hns3_nic_net_up(kinfo->netdev);\n+\t\tif (ret) {\n+\t\t\tnetdev_err(kinfo->netdev,\n+\t\t\t\t   \"hns net up fail, ret=%d!\\n\", ret);\n+\t\t\treturn ret;\n+\t\t}\n+\n+\t\tpriv->last_reset_time = jiffies;\n+\t}\n+\n+\treturn ret;\n+}\n+\n+static int hns3_reset_notify_init_enet(struct hnae3_handle *handle)\n+{\n+\tstruct net_device *netdev = handle->kinfo.netdev;\n+\tstruct hns3_nic_priv *priv = netdev_priv(netdev);\n+\tint ret;\n+\n+\tpriv->reset_level = 1;\n+\thns3_init_mac_addr(netdev);\n+\thns3_nic_set_rx_mode(netdev);\n+\thns3_recover_hw_addr(netdev);\n+\n+\t/* Carrier off reporting is important to ethtool even BEFORE open */\n+\tnetif_carrier_off(netdev);\n+\n+\tret = hns3_get_ring_config(priv);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tret = hns3_nic_init_vector_data(priv);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tret = hns3_init_all_ring(priv);\n+\tif (ret) {\n+\t\thns3_nic_uninit_vector_data(priv);\n+\t\tpriv->ring_data = NULL;\n+\t}\n+\n+\treturn ret;\n+}\n+\n+static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle)\n+{\n+\tstruct net_device *netdev = handle->kinfo.netdev;\n+\tstruct hns3_nic_priv *priv = netdev_priv(netdev);\n+\tint ret;\n+\n+\thns3_clear_all_ring(handle);\n+\n+\tret = hns3_nic_uninit_vector_data(priv);\n+\tif (ret) {\n+\t\tnetdev_err(netdev, \"uninit vector error\\n\");\n+\t\treturn ret;\n+\t}\n+\n+\tret = hns3_uninit_all_ring(priv);\n+\tif (ret)\n+\t\tnetdev_err(netdev, \"uninit ring error\\n\");\n+\n+\tpriv->ring_data = NULL;\n+\n+\treturn ret;\n+}\n+\n+static int hns3_reset_notify(struct hnae3_handle *handle,\n+\t\t\t     enum hnae3_reset_notify_type type)\n+{\n+\tint ret = 0;\n+\n+\tswitch (type) {\n+\tcase HNAE3_DOWN_CLIENT:\n+\t\tret = hns3_reset_notify_down_enet(handle);\n+\t\tbreak;\n+\tcase HNAE3_INIT_CLIENT:\n+\t\tret = hns3_reset_notify_init_enet(handle);\n+\t\tbreak;\n+\tcase HNAE3_UNINIT_CLIENT:\n+\t\tret = hns3_reset_notify_uninit_enet(handle);\n+\t\tbreak;\n+\tcase HNAE3_UP_CLIENT:\n+\t\tret = hns3_reset_notify_up_enet(handle);\n+\t\tbreak;\n+\tdefault:\n+\t\tbreak;\n+\t}\n+\n+\treturn ret;\n+}\n+\n static const struct hnae3_client_ops client_ops = {\n \t.init_instance = hns3_client_init,\n \t.uninit_instance = hns3_client_uninit,\n \t.link_status_change = hns3_link_status_change,\n \t.setup_tc = hns3_client_setup_tc,\n+\t.reset_notify = hns3_reset_notify,\n };\n \n /* hns3_init_module - Driver registration routine\n",
    "prefixes": [
        "net-next",
        "7/9"
    ]
}