get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 91233,
    "url": "http://patches.dpdk.org/api/patches/91233/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1618314611-47978-4-git-send-email-humin29@huawei.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": "<1618314611-47978-4-git-send-email-humin29@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1618314611-47978-4-git-send-email-humin29@huawei.com",
    "date": "2021-04-13T11:50:02",
    "name": "[03/12] net/hns3: fix VF may report LSC event in secondary process",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "ec7b938a122dfdd0185c78deb93f2ea33d12f85d",
    "submitter": {
        "id": 1944,
        "url": "http://patches.dpdk.org/api/people/1944/?format=api",
        "name": "humin (Q)",
        "email": "humin29@huawei.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1618314611-47978-4-git-send-email-humin29@huawei.com/mbox/",
    "series": [
        {
            "id": 16331,
            "url": "http://patches.dpdk.org/api/series/16331/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=16331",
            "date": "2021-04-13T11:50:10",
            "name": "Bugfix for hns3 PMD",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/16331/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/91233/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/91233/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C3226A0524;\n\tTue, 13 Apr 2021 13:50:12 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id DA8AD160E93;\n\tTue, 13 Apr 2021 13:50:04 +0200 (CEST)",
            "from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35])\n by mails.dpdk.org (Postfix) with ESMTP id 865FE160E81\n for <dev@dpdk.org>; Tue, 13 Apr 2021 13:50:01 +0200 (CEST)",
            "from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59])\n by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FKP3z3tBNzB04K\n for <dev@dpdk.org>; Tue, 13 Apr 2021 19:47:43 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id\n 14.3.498.0; Tue, 13 Apr 2021 19:49:55 +0800"
        ],
        "From": "\"Min Hu (Connor)\" <humin29@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@intel.com>",
        "Date": "Tue, 13 Apr 2021 19:50:02 +0800",
        "Message-ID": "<1618314611-47978-4-git-send-email-humin29@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1618314611-47978-1-git-send-email-humin29@huawei.com>",
        "References": "<1618314611-47978-1-git-send-email-humin29@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.69.192.56]",
        "X-CFilter-Loop": "Reflected",
        "Subject": "[dpdk-dev] [PATCH 03/12] net/hns3: fix VF may report LSC event in\n secondary process",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Chengwen Feng <fengchengwen@huawei.com>\n\nVF will build two queues (csq: command send queue, crq: command receive\nqueue) with firmware, the crq may contain the following messages:\n1) mailbox response message which was the ack of mailbox sync request.\n2) PF's link status change message which may send by PF at anytime;\n\nCurrently, any threads in the primary and secondary processes could\nsend mailbox sync request, so it will need to process the crq messages\nin there own thread context.\n\nIf the crq hold two messages: a) PF's link status change message, b)\nmailbox response message when secondary process deals with the crq\nmessages, it will lead to report lsc event in secondary process\nbecause it uses the policy of processing all pending messages at once.\n\nWe use the following scheme to solve it:\n1) threads in secondary process could only process specifics messages\n(eg. mailbox response message) in crq, if the message processed, its\nopcode will rewrite with zero, then the intr thread in primary process\nwill not process again.\n2) threads other than intr thread in the primary process use the same\nprocessing logic as the threads in secondary process.\n3) intr thread in the primary process could process all messages.\n\nFixes: 76a3836b98c4 (\"net/hns3: fix setting default MAC address in bonding of VF\")\nFixes: 463e748964f5 (\"net/hns3: support mailbox\")\nCc: stable@dpdk.org\n\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\n---\n drivers/net/hns3/hns3_mbx.c | 68 +++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 68 insertions(+)",
    "diff": "diff --git a/drivers/net/hns3/hns3_mbx.c b/drivers/net/hns3/hns3_mbx.c\nindex 8e38649..c5b0856 100644\n--- a/drivers/net/hns3/hns3_mbx.c\n+++ b/drivers/net/hns3/hns3_mbx.c\n@@ -400,6 +400,44 @@ hns3_handle_promisc_info(struct hns3_hw *hw, uint16_t promisc_en)\n \t}\n }\n \n+static void\n+hns3_handle_mbx_msg_out_intr(struct hns3_hw *hw)\n+{\n+\tstruct hns3_cmq_ring *crq = &hw->cmq.crq;\n+\tstruct hns3_mbx_pf_to_vf_cmd *req;\n+\tstruct hns3_cmd_desc *desc;\n+\tuint32_t tail, next_to_use;\n+\tuint8_t opcode;\n+\tuint16_t flag;\n+\n+\ttail = hns3_read_dev(hw, HNS3_CMDQ_RX_TAIL_REG);\n+\tnext_to_use = crq->next_to_use;\n+\twhile (next_to_use != tail) {\n+\t\tdesc = &crq->desc[next_to_use];\n+\t\treq = (struct hns3_mbx_pf_to_vf_cmd *)desc->data;\n+\t\topcode = req->msg[0] & 0xff;\n+\n+\t\tflag = rte_le_to_cpu_16(crq->desc[next_to_use].flag);\n+\t\tif (!hns3_get_bit(flag, HNS3_CMDQ_RX_OUTVLD_B))\n+\t\t\tgoto scan_next;\n+\n+\t\tif (crq->desc[next_to_use].opcode == 0)\n+\t\t\tgoto scan_next;\n+\n+\t\tif (opcode == HNS3_MBX_PF_VF_RESP) {\n+\t\t\thns3_handle_mbx_response(hw, req);\n+\t\t\t/*\n+\t\t\t * Clear opcode to inform intr thread don't process\n+\t\t\t * again.\n+\t\t\t */\n+\t\t\tcrq->desc[crq->next_to_use].opcode = 0;\n+\t\t}\n+\n+scan_next:\n+\t\tnext_to_use = (next_to_use + 1) % hw->cmq.crq.desc_num;\n+\t}\n+}\n+\n void\n hns3_dev_handle_mbx_msg(struct hns3_hw *hw)\n {\n@@ -411,6 +449,29 @@ hns3_dev_handle_mbx_msg(struct hns3_hw *hw)\n \n \trte_spinlock_lock(&hw->cmq.crq.lock);\n \n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY ||\n+\t    !rte_thread_is_intr()) {\n+\t\t/*\n+\t\t * Currently, any threads in the primary and secondary processes\n+\t\t * could send mailbox sync request, so it will need to process\n+\t\t * the crq message (which is the HNS3_MBX_PF_VF_RESP) in there\n+\t\t * own thread context. It may also process other messages\n+\t\t * because it uses the policy of processing all pending messages\n+\t\t * at once.\n+\t\t * But some messages such as HNS3_MBX_PUSH_LINK_STATUS could\n+\t\t * only process within the intr thread in primary process,\n+\t\t * otherwise it may lead to report lsc event in secondary\n+\t\t * process.\n+\t\t * So the threads other than intr thread in primary process\n+\t\t * could only process HNS3_MBX_PF_VF_RESP message, if the\n+\t\t * message processed, its opcode will rewrite with zero, then\n+\t\t * the intr thread in primary process will not process again.\n+\t\t */\n+\t\thns3_handle_mbx_msg_out_intr(hw);\n+\t\trte_spinlock_unlock(&hw->cmq.crq.lock);\n+\t\treturn;\n+\t}\n+\n \twhile (!hns3_cmd_crq_empty(hw)) {\n \t\tif (__atomic_load_n(&hw->reset.disable_cmd, __ATOMIC_RELAXED)) {\n \t\t\trte_spinlock_unlock(&hw->cmq.crq.lock);\n@@ -433,6 +494,13 @@ hns3_dev_handle_mbx_msg(struct hns3_hw *hw)\n \t\t\tcontinue;\n \t\t}\n \n+\t\tif (desc->opcode == 0) {\n+\t\t\t/* Message already processed by other thread */\n+\t\t\tcrq->desc[crq->next_to_use].flag = 0;\n+\t\t\thns3_mbx_ring_ptr_move_crq(crq);\n+\t\t\tcontinue;\n+\t\t}\n+\n \t\tswitch (opcode) {\n \t\tcase HNS3_MBX_PF_VF_RESP:\n \t\t\thns3_handle_mbx_response(hw, req);\n",
    "prefixes": [
        "03/12"
    ]
}