get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 84415,
    "url": "https://patches.dpdk.org/api/patches/84415/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1605871656-51819-3-git-send-email-oulijun@huawei.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": "<1605871656-51819-3-git-send-email-oulijun@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1605871656-51819-3-git-send-email-oulijun@huawei.com",
    "date": "2020-11-20T11:27:34",
    "name": "[2/4] net/hns3: fix unused queues with not disabled",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c45f6c7861c915fe95a468c5eb0e9c7279dc715d",
    "submitter": {
        "id": 1675,
        "url": "https://patches.dpdk.org/api/people/1675/?format=api",
        "name": "Lijun Ou",
        "email": "oulijun@huawei.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1605871656-51819-3-git-send-email-oulijun@huawei.com/mbox/",
    "series": [
        {
            "id": 14002,
            "url": "https://patches.dpdk.org/api/series/14002/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14002",
            "date": "2020-11-20T11:27:34",
            "name": "hns3 fixes",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/14002/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/84415/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/84415/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C5C06A04DD;\n\tFri, 20 Nov 2020 12:27:28 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 1A0ADC884;\n\tFri, 20 Nov 2020 12:27:27 +0100 (CET)",
            "from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35])\n by dpdk.org (Postfix) with ESMTP id 7AC07DED\n for <dev@dpdk.org>; Fri, 20 Nov 2020 12:27:25 +0100 (CET)",
            "from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60])\n by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CcvQg24zrz705n\n for <dev@dpdk.org>; Fri, 20 Nov 2020 19:27:07 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id\n 14.3.487.0; Fri, 20 Nov 2020 19:27:15 +0800"
        ],
        "From": "Lijun Ou <oulijun@huawei.com>",
        "To": "<ferruh.yigit@intel.com>",
        "CC": "<dev@dpdk.org>, <linuxarm@huawei.com>",
        "Date": "Fri, 20 Nov 2020 19:27:34 +0800",
        "Message-ID": "<1605871656-51819-3-git-send-email-oulijun@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1605871656-51819-1-git-send-email-oulijun@huawei.com>",
        "References": "<1605871656-51819-1-git-send-email-oulijun@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 2/4] net/hns3: fix unused queues with not disabled",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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: Chengchang Tang <tangchengchang@huawei.com>\n\nFor kupeng 930, there are 3 registers to control the enable\nstatus of a TQP(i.e. task queue pair, include a txq and a rxq).\nOne of them controls whether the TQP is enabled, and the other\ntwo controls whether the rxq and txq are enabled. The registers\nused to control the enabled status of the rxq and txq are enabled\nby default. Therefore, after the TQP is enabled, the rxq and txq\nare enabled by default. Currently, when the number of rxq is not\nequal to the number of txq, the unused rxqs or txqs are not disabled\nby driver, so these unused queues will be enabled in this situation.\nAnd the related HW rings have not been initialized which could\nlead to a hardware exception.\n\nThis patch fix it by disable these unused queues during enable the TQPs.\n\nFixes: fa29fe45a7b4 (\"net/hns3: support queue start and stop\")\nCc: stable@dpdk.org\n\nSigned-off-by: Chengchang Tang <tangchengchang@huawei.com>\nSigned-off-by: Lijun Ou <oulijun@huawei.com>\n---\n drivers/net/hns3/hns3_rxtx.c | 35 +++++++++++++++++++++++++++--------\n 1 file changed, 27 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c\nindex c76e635..88d3bab 100644\n--- a/drivers/net/hns3/hns3_rxtx.c\n+++ b/drivers/net/hns3/hns3_rxtx.c\n@@ -353,6 +353,19 @@ hns3_update_all_queues_pvid_proc_en(struct hns3_hw *hw)\n \t}\n }\n \n+static void\n+hns3_stop_unused_queue(void *tqp_base, enum hns3_ring_type queue_type)\n+{\n+\tuint32_t reg_offset;\n+\tuint32_t reg;\n+\n+\treg_offset = queue_type == HNS3_RING_TYPE_TX ?\n+\t\t\t\t   HNS3_RING_TX_EN_REG : HNS3_RING_RX_EN_REG;\n+\treg = hns3_read_reg(tqp_base, reg_offset);\n+\treg &= ~BIT(HNS3_RING_EN_B);\n+\thns3_write_reg(tqp_base, reg_offset, reg);\n+}\n+\n void\n hns3_enable_all_queues(struct hns3_hw *hw, bool en)\n {\n@@ -368,16 +381,22 @@ hns3_enable_all_queues(struct hns3_hw *hw, bool en)\n \t\tif (hns3_dev_indep_txrx_supported(hw)) {\n \t\t\trxq = i < nb_rx_q ? hw->data->rx_queues[i] : NULL;\n \t\t\ttxq = i < nb_tx_q ? hw->data->tx_queues[i] : NULL;\n+\n+\t\t\ttqp_base = (void *)((char *)hw->io_base +\n+\t\t\t\t\thns3_get_tqp_reg_offset(i));\n \t\t\t/*\n-\t\t\t * After initialization, rxq and txq won't be NULL at\n-\t\t\t * the same time.\n+\t\t\t * If queue struct is not initialized, it means the\n+\t\t\t * related HW ring has not been initialized yet.\n+\t\t\t * So, these queues should be disabled before enable\n+\t\t\t * the tqps to avoid a HW exception since the queues\n+\t\t\t * are enabled by default.\n \t\t\t */\n-\t\t\tif (rxq != NULL)\n-\t\t\t\ttqp_base = rxq->io_base;\n-\t\t\telse if (txq != NULL)\n-\t\t\t\ttqp_base = txq->io_base;\n-\t\t\telse\n-\t\t\t\treturn;\n+\t\t\tif (rxq == NULL)\n+\t\t\t\thns3_stop_unused_queue(tqp_base,\n+\t\t\t\t\t\t\tHNS3_RING_TYPE_RX);\n+\t\t\tif (txq == NULL)\n+\t\t\t\thns3_stop_unused_queue(tqp_base,\n+\t\t\t\t\t\t\tHNS3_RING_TYPE_TX);\n \t\t} else {\n \t\t\trxq = i < nb_rx_q ? hw->data->rx_queues[i] :\n \t\t\t      hw->fkq_data.rx_queues[i - nb_rx_q];\n",
    "prefixes": [
        "2/4"
    ]
}