get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1370213,
    "url": "http://patchwork.ozlabs.org/api/patches/1370213/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20200924013151.25754-1-luobin9@huawei.com/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/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": "<20200924013151.25754-1-luobin9@huawei.com>",
    "list_archive_url": null,
    "date": "2020-09-24T01:31:51",
    "name": "[net] hinic: fix wrong return value of mac-set cmd",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "9e9cbbf6286acbf2a747e4122e6b697d61f8c07a",
    "submitter": {
        "id": 78517,
        "url": "http://patchwork.ozlabs.org/api/people/78517/?format=api",
        "name": "Luo bin",
        "email": "luobin9@huawei.com"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20200924013151.25754-1-luobin9@huawei.com/mbox/",
    "series": [
        {
            "id": 203819,
            "url": "http://patchwork.ozlabs.org/api/series/203819/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=203819",
            "date": "2020-09-24T01:31:51",
            "name": "[net] hinic: fix wrong return value of mac-set cmd",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/203819/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1370213/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1370213/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming-netdev@ozlabs.org",
        "Delivered-To": "patchwork-incoming-netdev@ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=23.128.96.18; helo=vger.kernel.org;\n envelope-from=netdev-owner@vger.kernel.org; receiver=<UNKNOWN>)",
            "ozlabs.org;\n dmarc=none (p=none dis=none) header.from=huawei.com"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [23.128.96.18])\n\tby ozlabs.org (Postfix) with ESMTP id 4Bxcth0MtWz9sSt\n\tfor <patchwork-incoming-netdev@ozlabs.org>;\n Thu, 24 Sep 2020 11:30:36 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n        id S1726448AbgIXBac (ORCPT\n        <rfc822;patchwork-incoming-netdev@ozlabs.org>);\n        Wed, 23 Sep 2020 21:30:32 -0400",
            "from szxga04-in.huawei.com ([45.249.212.190]:14266 \"EHLO huawei.com\"\n        rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP\n        id S1725273AbgIXBac (ORCPT <rfc822;netdev@vger.kernel.org>);\n        Wed, 23 Sep 2020 21:30:32 -0400",
            "from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60])\n        by Forcepoint Email with ESMTP id A5CBDF4800612618B408;\n        Thu, 24 Sep 2020 09:30:29 +0800 (CST)",
            "from localhost.localdomain (10.175.118.36) by\n DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id\n 14.3.487.0; Thu, 24 Sep 2020 09:30:23 +0800"
        ],
        "From": "Luo bin <luobin9@huawei.com>",
        "To": "<davem@davemloft.net>",
        "CC": "<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,\n        <yin.yinshi@huawei.com>, <cloud.wangxiaoyun@huawei.com>,\n        <chiqijun@huawei.com>, <zengweiliang.zengweiliang@huawei.com>",
        "Subject": "[PATCH net] hinic: fix wrong return value of mac-set cmd",
        "Date": "Thu, 24 Sep 2020 09:31:51 +0800",
        "Message-ID": "<20200924013151.25754-1-luobin9@huawei.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.175.118.36]",
        "X-CFilter-Loop": "Reflected",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "It should also be regarded as an error when hw return status=4 for PF's\nsetting mac cmd. Only if PF return status=4 to VF should this cmd be\ntaken special treatment.\n\nFixes: 7dd29ee12865 (\"hinic: add sriov feature support\")\nSigned-off-by: Luo bin <luobin9@huawei.com>\n---\n drivers/net/ethernet/huawei/hinic/hinic_port.c  |  6 +++---\n drivers/net/ethernet/huawei/hinic/hinic_sriov.c | 12 ++----------\n 2 files changed, 5 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/huawei/hinic/hinic_port.c b/drivers/net/ethernet/huawei/hinic/hinic_port.c\nindex 02cd635d6914..eb97f2d6b1ad 100644\n--- a/drivers/net/ethernet/huawei/hinic/hinic_port.c\n+++ b/drivers/net/ethernet/huawei/hinic/hinic_port.c\n@@ -58,9 +58,9 @@ static int change_mac(struct hinic_dev *nic_dev, const u8 *addr,\n \t\t\t\t sizeof(port_mac_cmd),\n \t\t\t\t &port_mac_cmd, &out_size);\n \tif (err || out_size != sizeof(port_mac_cmd) ||\n-\t    (port_mac_cmd.status  &&\n-\t    port_mac_cmd.status != HINIC_PF_SET_VF_ALREADY &&\n-\t    port_mac_cmd.status != HINIC_MGMT_STATUS_EXIST)) {\n+\t    (port_mac_cmd.status &&\n+\t     (port_mac_cmd.status != HINIC_PF_SET_VF_ALREADY || !HINIC_IS_VF(hwif)) &&\n+\t     port_mac_cmd.status != HINIC_MGMT_STATUS_EXIST)) {\n \t\tdev_err(&pdev->dev, \"Failed to change MAC, err: %d, status: 0x%x, out size: 0x%x\\n\",\n \t\t\terr, port_mac_cmd.status, out_size);\n \t\treturn -EFAULT;\ndiff --git a/drivers/net/ethernet/huawei/hinic/hinic_sriov.c b/drivers/net/ethernet/huawei/hinic/hinic_sriov.c\nindex 4d63680f2143..f8a26459ff65 100644\n--- a/drivers/net/ethernet/huawei/hinic/hinic_sriov.c\n+++ b/drivers/net/ethernet/huawei/hinic/hinic_sriov.c\n@@ -38,8 +38,7 @@ static int hinic_set_mac(struct hinic_hwdev *hwdev, const u8 *mac_addr,\n \terr = hinic_port_msg_cmd(hwdev, HINIC_PORT_CMD_SET_MAC, &mac_info,\n \t\t\t\t sizeof(mac_info), &mac_info, &out_size);\n \tif (err || out_size != sizeof(mac_info) ||\n-\t    (mac_info.status && mac_info.status != HINIC_PF_SET_VF_ALREADY &&\n-\t    mac_info.status != HINIC_MGMT_STATUS_EXIST)) {\n+\t    (mac_info.status && mac_info.status != HINIC_MGMT_STATUS_EXIST)) {\n \t\tdev_err(&hwdev->func_to_io.hwif->pdev->dev, \"Failed to set MAC, err: %d, status: 0x%x, out size: 0x%x\\n\",\n \t\t\terr, mac_info.status, out_size);\n \t\treturn -EIO;\n@@ -503,8 +502,7 @@ struct hinic_sriov_info *hinic_get_sriov_info_by_pcidev(struct pci_dev *pdev)\n \n static int hinic_check_mac_info(u8 status, u16 vlan_id)\n {\n-\tif ((status && status != HINIC_MGMT_STATUS_EXIST &&\n-\t     status != HINIC_PF_SET_VF_ALREADY) ||\n+\tif ((status && status != HINIC_MGMT_STATUS_EXIST) ||\n \t    (vlan_id & CHECK_IPSU_15BIT &&\n \t     status == HINIC_MGMT_STATUS_EXIST))\n \t\treturn -EINVAL;\n@@ -546,12 +544,6 @@ static int hinic_update_mac(struct hinic_hwdev *hwdev, u8 *old_mac,\n \t\treturn -EINVAL;\n \t}\n \n-\tif (mac_info.status == HINIC_PF_SET_VF_ALREADY) {\n-\t\tdev_warn(&hwdev->hwif->pdev->dev,\n-\t\t\t \"PF has already set VF MAC. Ignore update operation\\n\");\n-\t\treturn HINIC_PF_SET_VF_ALREADY;\n-\t}\n-\n \tif (mac_info.status == HINIC_MGMT_STATUS_EXIST)\n \t\tdev_warn(&hwdev->hwif->pdev->dev, \"MAC is repeated. Ignore update operation\\n\");\n \n",
    "prefixes": [
        "net"
    ]
}