get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 72605,
    "url": "https://patches.dpdk.org/api/patches/72605/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1593604482-47494-10-git-send-email-xavier.huwei@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": "<1593604482-47494-10-git-send-email-xavier.huwei@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1593604482-47494-10-git-send-email-xavier.huwei@huawei.com",
    "date": "2020-07-01T11:54:41",
    "name": "[09/10] net/hns3: fix reassembling multiple segment packets in Tx",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "540824f7439588932e6be2cb81299212b7b204ad",
    "submitter": {
        "id": 1405,
        "url": "https://patches.dpdk.org/api/people/1405/?format=api",
        "name": "Wei Hu (Xavier)",
        "email": "xavier.huwei@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/1593604482-47494-10-git-send-email-xavier.huwei@huawei.com/mbox/",
    "series": [
        {
            "id": 10710,
            "url": "https://patches.dpdk.org/api/series/10710/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10710",
            "date": "2020-07-01T11:54:33",
            "name": "misc updates for hns3 PMD driver",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/10710/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/72605/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/72605/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 CCF2BA0350;\n\tWed,  1 Jul 2020 13:56:59 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 5D5661D426;\n\tWed,  1 Jul 2020 13:56:35 +0200 (CEST)",
            "from huawei.com (szxga07-in.huawei.com [45.249.212.35])\n by dpdk.org (Postfix) with ESMTP id 309F91D183\n for <dev@dpdk.org>; Wed,  1 Jul 2020 13:56:33 +0200 (CEST)",
            "from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60])\n by Forcepoint Email with ESMTP id 335883952F3187DBB78D\n for <dev@dpdk.org>; Wed,  1 Jul 2020 19:56:32 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id\n 14.3.487.0; Wed, 1 Jul 2020 19:56:22 +0800"
        ],
        "From": "\"Wei Hu (Xavier)\" <xavier.huwei@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<xavier.huwei@huawei.com>",
        "Date": "Wed, 1 Jul 2020 19:54:41 +0800",
        "Message-ID": "<1593604482-47494-10-git-send-email-xavier.huwei@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1593604482-47494-1-git-send-email-xavier.huwei@huawei.com>",
        "References": "<1593604482-47494-1-git-send-email-xavier.huwei@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 09/10] net/hns3: fix reassembling multiple\n\tsegment packets in Tx",
        "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": "Because of the hardware constraints, hns3 network engine doesn't support\nsending packets with more than eight fragments. And hns3 pmd driver tries\nto reassemble these kind of packets to meet hardware requirements.\nCurrently, there are two problems:\n1) when the input buffer_len * 8 < pkt_len, the packets are impossible to\n   be reassembled into 8 Buffer Descriptors. In this case, the packets will\n   be passed to hardware, which eventually causes a hardware reset.\n2) The meta data in origin packets which are required to fill into the\n   descriptor haven't been copied into the reassembled pkts.\n\nThis patch adds a check for 1) to ensure such packets will be dropped by\ndriver and copies useful meta data from the origin packets to the\nreassembled packets.\n\nFixes: bba636698316 (\"net/hns3: support Rx/Tx and related operations\")\nCc: stable@dpdk.org\n\nSigned-off-by: Chengchang Tang <tangchengchang@huawei.com>\nSigned-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\n---\n drivers/net/hns3/hns3_rxtx.c | 25 +++++++++++++++++++++----\n 1 file changed, 21 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c\nindex 931d89a..8892fc1 100644\n--- a/drivers/net/hns3/hns3_rxtx.c\n+++ b/drivers/net/hns3/hns3_rxtx.c\n@@ -2095,6 +2095,20 @@ hns3_tx_alloc_mbufs(struct hns3_tx_queue *txq, struct rte_mempool *mb_pool,\n \treturn 0;\n }\n \n+static inline void\n+hns3_pktmbuf_copy_hdr(struct rte_mbuf *new_pkt, struct rte_mbuf *old_pkt)\n+{\n+\tnew_pkt->ol_flags = old_pkt->ol_flags;\n+\tnew_pkt->pkt_len = rte_pktmbuf_pkt_len(old_pkt);\n+\tnew_pkt->outer_l2_len = old_pkt->outer_l2_len;\n+\tnew_pkt->outer_l3_len = old_pkt->outer_l3_len;\n+\tnew_pkt->l2_len = old_pkt->l2_len;\n+\tnew_pkt->l3_len = old_pkt->l3_len;\n+\tnew_pkt->l4_len = old_pkt->l4_len;\n+\tnew_pkt->vlan_tci_outer = old_pkt->vlan_tci_outer;\n+\tnew_pkt->vlan_tci = old_pkt->vlan_tci;\n+}\n+\n static int\n hns3_reassemble_tx_pkts(void *tx_queue, struct rte_mbuf *tx_pkt,\n \t\t\tstruct rte_mbuf **new_pkt)\n@@ -2118,9 +2132,11 @@ hns3_reassemble_tx_pkts(void *tx_queue, struct rte_mbuf *tx_pkt,\n \n \tmb_pool = tx_pkt->pool;\n \tbuf_size = tx_pkt->buf_len - RTE_PKTMBUF_HEADROOM;\n-\tnb_new_buf = (tx_pkt->pkt_len - 1) / buf_size + 1;\n+\tnb_new_buf = (rte_pktmbuf_pkt_len(tx_pkt) - 1) / buf_size + 1;\n+\tif (nb_new_buf > HNS3_MAX_NON_TSO_BD_PER_PKT)\n+\t\treturn -EINVAL;\n \n-\tlast_buf_len = tx_pkt->pkt_len % buf_size;\n+\tlast_buf_len = rte_pktmbuf_pkt_len(tx_pkt) % buf_size;\n \tif (last_buf_len == 0)\n \t\tlast_buf_len = buf_size;\n \n@@ -2132,7 +2148,7 @@ hns3_reassemble_tx_pkts(void *tx_queue, struct rte_mbuf *tx_pkt,\n \t/* Copy the original packet content to the new mbufs */\n \ttemp = tx_pkt;\n \ts = rte_pktmbuf_mtod(temp, char *);\n-\tlen_s = temp->data_len;\n+\tlen_s = rte_pktmbuf_data_len(temp);\n \ttemp_new = new_mbuf;\n \tfor (i = 0; i < nb_new_buf; i++) {\n \t\td = rte_pktmbuf_mtod(temp_new, char *);\n@@ -2155,13 +2171,14 @@ hns3_reassemble_tx_pkts(void *tx_queue, struct rte_mbuf *tx_pkt,\n \t\t\t\tif (temp == NULL)\n \t\t\t\t\tbreak;\n \t\t\t\ts = rte_pktmbuf_mtod(temp, char *);\n-\t\t\t\tlen_s = temp->data_len;\n+\t\t\t\tlen_s = rte_pktmbuf_data_len(temp);\n \t\t\t}\n \t\t}\n \n \t\ttemp_new->data_len = buf_len;\n \t\ttemp_new = temp_new->next;\n \t}\n+\thns3_pktmbuf_copy_hdr(new_mbuf, tx_pkt);\n \n \t/* free original mbufs */\n \trte_pktmbuf_free(tx_pkt);\n",
    "prefixes": [
        "09/10"
    ]
}