get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 88444,
    "url": "http://patches.dpdk.org/api/patches/88444/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1614843894-43845-11-git-send-email-oulijun@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": "<1614843894-43845-11-git-send-email-oulijun@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1614843894-43845-11-git-send-email-oulijun@huawei.com",
    "date": "2021-03-04T07:44:50",
    "name": "[V3,10/14] net/hns3: fix HW buffer size on MTU update",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "797e138aad5f97f7d5fc71aec78171116e1abd52",
    "submitter": {
        "id": 1675,
        "url": "http://patches.dpdk.org/api/people/1675/?format=api",
        "name": "Lijun Ou",
        "email": "oulijun@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/1614843894-43845-11-git-send-email-oulijun@huawei.com/mbox/",
    "series": [
        {
            "id": 15486,
            "url": "http://patches.dpdk.org/api/series/15486/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=15486",
            "date": "2021-03-04T07:44:40",
            "name": "Features and bugfixes for hns3",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/15486/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/88444/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/88444/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 8153CA0561;\n\tThu,  4 Mar 2021 08:44:18 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5C51422A2CB;\n\tThu,  4 Mar 2021 08:44:17 +0100 (CET)",
            "from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190])\n by mails.dpdk.org (Postfix) with ESMTP id EA2F3406B4\n for <dev@dpdk.org>; Thu,  4 Mar 2021 08:44:15 +0100 (CET)",
            "from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60])\n by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DrjW14l2DzlSCY;\n Thu,  4 Mar 2021 15:42:05 +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.498.0; Thu, 4 Mar 2021 15:44:11 +0800"
        ],
        "From": "Lijun Ou <oulijun@huawei.com>",
        "To": "<ferruh.yigit@intel.com>",
        "CC": "<dev@dpdk.org>, <linuxarm@openeuler.org>",
        "Date": "Thu, 4 Mar 2021 15:44:50 +0800",
        "Message-ID": "<1614843894-43845-11-git-send-email-oulijun@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1614843894-43845-1-git-send-email-oulijun@huawei.com>",
        "References": "<1614693534-27620-1-git-send-email-oulijun@huawei.com>\n <1614843894-43845-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 V3 10/14] net/hns3: fix HW buffer size on MTU\n update",
        "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: Chengchang Tang <tangchengchang@huawei.com>\n\nAfter MTU changed, the buffer used to store packets in HW should be\nreallocated. And buffer size is allocated based on the maximum frame\nsize in the PF struct. However, the value of maximum frame size  is\nnot updated in time when MTU is changed. This would lead to a packet\nloss for not enough buffer.\n\nThis patch update the maximum frame size before reallocating the HW\nbuffer. And a rollback operation is added to avoid the side effects\nof buffer reallocation failures.\n\nFixes: 1f5ca0b460cd (\"net/hns3: support some device operations\")\nFixes: d51867db65c1 (\"net/hns3: add initialization\")\nCc: stable@dpdk.org\n\nSigned-off-by: Chengchang Tang <tangchengchang@huawei.com>\nSigned-off-by: Lijun Ou <oulijun@huawei.com>\n---\nV2->V3:\n- rewrite the patch title\n---\n drivers/net/hns3/hns3_ethdev.c | 24 ++++++++++++++++++++----\n 1 file changed, 20 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c\nindex b3fd331..21c3c59 100644\n--- a/drivers/net/hns3/hns3_ethdev.c\n+++ b/drivers/net/hns3/hns3_ethdev.c\n@@ -2460,17 +2460,33 @@ hns3_set_mac_mtu(struct hns3_hw *hw, uint16_t new_mps)\n static int\n hns3_config_mtu(struct hns3_hw *hw, uint16_t mps)\n {\n+\tstruct hns3_adapter *hns = HNS3_DEV_HW_TO_ADAPTER(hw);\n+\tuint16_t original_mps = hns->pf.mps;\n+\tint err;\n \tint ret;\n \n \tret = hns3_set_mac_mtu(hw, mps);\n \tif (ret) {\n-\t\thns3_err(hw, \"Failed to set mtu, ret = %d\", ret);\n+\t\thns3_err(hw, \"failed to set mtu, ret = %d\", ret);\n \t\treturn ret;\n \t}\n \n+\thns->pf.mps = mps;\n \tret = hns3_buffer_alloc(hw);\n-\tif (ret)\n-\t\thns3_err(hw, \"Failed to allocate buffer, ret = %d\", ret);\n+\tif (ret) {\n+\t\thns3_err(hw, \"failed to allocate buffer, ret = %d\", ret);\n+\t\tgoto rollback;\n+\t}\n+\n+\treturn 0;\n+\n+rollback:\n+\terr = hns3_set_mac_mtu(hw, original_mps);\n+\tif (err) {\n+\t\thns3_err(hw, \"fail to rollback MTU, err = %d\", err);\n+\t\treturn ret;\n+\t}\n+\thns->pf.mps = original_mps;\n \n \treturn ret;\n }\n@@ -2505,7 +2521,7 @@ hns3_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)\n \t\t\t dev->data->port_id, mtu, ret);\n \t\treturn ret;\n \t}\n-\thns->pf.mps = (uint16_t)frame_size;\n+\n \tif (is_jumbo_frame)\n \t\tdev->data->dev_conf.rxmode.offloads |=\n \t\t\t\t\t\tDEV_RX_OFFLOAD_JUMBO_FRAME;\n",
    "prefixes": [
        "V3",
        "10/14"
    ]
}