get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 94156,
    "url": "https://patches.dpdk.org/api/patches/94156/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1623553508-5478-5-git-send-email-humin29@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": "<1623553508-5478-5-git-send-email-humin29@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1623553508-5478-5-git-send-email-humin29@huawei.com",
    "date": "2021-06-13T03:05:08",
    "name": "[4/4] net/hns3: supports disabling PFC by dev configure API",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "775eb3643da6ce407f9c61091b65eb49208153a6",
    "submitter": {
        "id": 1944,
        "url": "https://patches.dpdk.org/api/people/1944/?format=api",
        "name": "humin (Q)",
        "email": "humin29@huawei.com"
    },
    "delegate": {
        "id": 3961,
        "url": "https://patches.dpdk.org/api/users/3961/?format=api",
        "username": "arybchenko",
        "first_name": "Andrew",
        "last_name": "Rybchenko",
        "email": "andrew.rybchenko@oktetlabs.ru"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1623553508-5478-5-git-send-email-humin29@huawei.com/mbox/",
    "series": [
        {
            "id": 17309,
            "url": "https://patches.dpdk.org/api/series/17309/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=17309",
            "date": "2021-06-13T03:05:07",
            "name": "features for hns3 PMD",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/17309/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/94156/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/94156/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 4E9E1A0C40;\n\tSun, 13 Jun 2021 05:05:53 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5E9D941102;\n\tSun, 13 Jun 2021 05:05:38 +0200 (CEST)",
            "from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188])\n by mails.dpdk.org (Postfix) with ESMTP id 44E504003F\n for <dev@dpdk.org>; Sun, 13 Jun 2021 05:05:33 +0200 (CEST)",
            "from dggeme756-chm.china.huawei.com (unknown [172.30.72.56])\n by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4G2fWy4v4jzZgXY\n for <dev@dpdk.org>; Sun, 13 Jun 2021 11:02:38 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id\n 15.1.2176.2; Sun, 13 Jun 2021 11:05:31 +0800"
        ],
        "From": "\"Min Hu (Connor)\" <humin29@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@intel.com>",
        "Date": "Sun, 13 Jun 2021 11:05:08 +0800",
        "Message-ID": "<1623553508-5478-5-git-send-email-humin29@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1623553508-5478-1-git-send-email-humin29@huawei.com>",
        "References": "<1623553508-5478-1-git-send-email-humin29@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.69.192.56]",
        "X-ClientProxiedBy": "dggems703-chm.china.huawei.com (10.3.19.180) To\n dggeme756-chm.china.huawei.com (10.3.19.102)",
        "X-CFilter-Loop": "Reflected",
        "Subject": "[dpdk-dev] [PATCH 4/4] net/hns3: supports disabling PFC by dev\n configure API",
        "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: Huisong Li <lihuisong@huawei.com>\n\nIf \"dcb_capability_en\" in \"data->dev_conf\" delivered from the dev_configure\ndoes not have the ETH_DCB_PFC_SUPPORT flag, the user wants to disable PFC,\nand only enable ETS. Therefore, this patch supports the function of\ndisabling PFC by the field. In addition, this patch updates\n\"current_fc_status\" of the driver based on the flow control mode requested\nby user so as to enable the flow control mode in multi-TC scenarios.\n\nSigned-off-by: Huisong Li <lihuisong@huawei.com>\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\n---\n drivers/net/hns3/hns3_dcb.c    | 61 +++++++++++++++++++++++-------------------\n drivers/net/hns3/hns3_ethdev.h |  1 +\n 2 files changed, 34 insertions(+), 28 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_dcb.c b/drivers/net/hns3/hns3_dcb.c\nindex 90c0d04..234a3e8 100644\n--- a/drivers/net/hns3/hns3_dcb.c\n+++ b/drivers/net/hns3/hns3_dcb.c\n@@ -1427,10 +1427,12 @@ hns3_dcb_cfg_validate(struct hns3_adapter *hns, uint8_t *tc, bool *changed)\n \t * We ensure that dcb information can be reconfigured\n \t * after the hns3_priority_flow_ctrl_set function called.\n \t */\n-\tif (hw->requested_fc_mode != HNS3_FC_FULL)\n+\tif (hw->requested_fc_mode != HNS3_FC_FULL ||\n+\t\thw->requested_fc_mode != HNS3_FC_NONE)\n \t\t*changed = true;\n \tpfc_en = RTE_LEN2MASK((uint8_t)dcb_rx_conf->nb_tcs, uint8_t);\n-\tif (hw->dcb_info.pfc_en != pfc_en)\n+\tif (hw->dcb_info.pfc_en != pfc_en || hw->dcb_info.dcb_capability_en !=\n+\t\thw->data->dev_conf.dcb_capability_en)\n \t\t*changed = true;\n \n \t/* tx/rx queue number is reconfigured. */\n@@ -1567,36 +1569,32 @@ hns3_dcb_hw_configure(struct hns3_adapter *hns)\n \t\thw->dcb_info.hw_pfc_map =\n \t\t\t\thns3_dcb_undrop_tc_map(hw, hw->dcb_info.pfc_en);\n \n-\t\tret = hns3_buffer_alloc(hw);\n-\t\tif (ret)\n-\t\t\tgoto buffer_alloc_fail;\n-\n \t\thw->current_fc_status = HNS3_FC_STATUS_PFC;\n \t\thw->requested_fc_mode = HNS3_FC_FULL;\n-\t\tret = hns3_dcb_pause_setup_hw(hw);\n-\t\tif (ret) {\n-\t\t\thns3_err(hw, \"setup pfc failed! ret = %d\", ret);\n-\t\t\tgoto pfc_setup_fail;\n-\t\t}\n \t} else {\n-\t\t/*\n-\t\t * Although dcb_capability_en is lack of ETH_DCB_PFC_SUPPORT\n-\t\t * flag, the DCB information is configured, such as tc numbers.\n-\t\t * Therefore, refreshing the allocation of packet buffer is\n-\t\t * necessary.\n-\t\t */\n-\t\tret = hns3_buffer_alloc(hw);\n-\t\tif (ret)\n-\t\t\treturn ret;\n+\t\thw->current_fc_status = HNS3_FC_STATUS_NONE;\n+\t\thw->requested_fc_mode = HNS3_FC_NONE;\n+\t\thw->dcb_info.pfc_en = 0;\n+\t\thw->dcb_info.hw_pfc_map = 0;\n \t}\n \n+\tret = hns3_buffer_alloc(hw);\n+\tif (ret)\n+\t\tgoto cfg_fail;\n+\n+\tret = hns3_dcb_pause_setup_hw(hw);\n+\tif (ret) {\n+\t\thns3_err(hw, \"setup pfc failed! ret = %d\", ret);\n+\t\tgoto cfg_fail;\n+\t}\n+\n+\thw->dcb_info.dcb_capability_en = hw->data->dev_conf.dcb_capability_en;\n+\n \treturn 0;\n \n-pfc_setup_fail:\n+cfg_fail:\n \thw->requested_fc_mode = requested_fc_mode;\n \thw->current_fc_status = fc_status;\n-\n-buffer_alloc_fail:\n \thw->dcb_info.pfc_en = pfc_en;\n \thw->dcb_info.hw_pfc_map = hw_pfc_map;\n \n@@ -1781,15 +1779,21 @@ hns3_dcb_pfc_enable(struct rte_eth_dev *dev, struct rte_eth_pfc_conf *pfc_conf)\n \tuint16_t pause_time = pf->pause_time;\n \tint ret;\n \n-\tpf->pause_time = pfc_conf->fc.pause_time;\n-\thns3_get_fc_mode(hw, pfc_conf->fc.mode);\n-\thw->current_fc_status = HNS3_FC_STATUS_PFC;\n \thw->dcb_info.pfc_en |= BIT(priority);\n \thw->dcb_info.hw_pfc_map =\n \t\t\thns3_dcb_undrop_tc_map(hw, hw->dcb_info.pfc_en);\n \tret = hns3_buffer_alloc(hw);\n-\tif (ret)\n-\t\tgoto pfc_setup_fail;\n+\tif (ret) {\n+\t\thns3_err(hw, \"update packet buffer failed, ret = %d\", ret);\n+\t\tgoto buffer_alloc_fail;\n+\t}\n+\n+\tpf->pause_time = pfc_conf->fc.pause_time;\n+\thns3_get_fc_mode(hw, pfc_conf->fc.mode);\n+\tif (hw->requested_fc_mode == HNS3_FC_NONE)\n+\t\thw->current_fc_status = HNS3_FC_STATUS_NONE;\n+\telse\n+\t\thw->current_fc_status = HNS3_FC_STATUS_PFC;\n \n \t/*\n \t * The flow control mode of all UPs will be changed based on\n@@ -1807,6 +1811,7 @@ hns3_dcb_pfc_enable(struct rte_eth_dev *dev, struct rte_eth_pfc_conf *pfc_conf)\n \thw->requested_fc_mode = old_fc_mode;\n \thw->current_fc_status = fc_status;\n \tpf->pause_time = pause_time;\n+buffer_alloc_fail:\n \thw->dcb_info.pfc_en = pfc_en;\n \thw->dcb_info.hw_pfc_map = hw_pfc_map;\n \ndiff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h\nindex 5f448af..7ff8762 100644\n--- a/drivers/net/hns3/hns3_ethdev.h\n+++ b/drivers/net/hns3/hns3_ethdev.h\n@@ -139,6 +139,7 @@ struct hns3_dcb_info {\n \tstruct hns3_tc_info tc_info[HNS3_MAX_TC_NUM];\n \tuint8_t hw_pfc_map; /* Allow for packet drop or not on this TC */\n \tuint8_t pfc_en; /* Pfc enabled or not for user priority */\n+\tuint32_t dcb_capability_en;\n };\n \n enum hns3_fc_status {\n",
    "prefixes": [
        "4/4"
    ]
}