get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 78312,
    "url": "http://patches.dpdk.org/api/patches/78312/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200922085401.12272-5-huwei013@chinasoftinc.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": "<20200922085401.12272-5-huwei013@chinasoftinc.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200922085401.12272-5-huwei013@chinasoftinc.com",
    "date": "2020-09-22T08:53:48",
    "name": "[04/17] net/hns3: add max number of segs compatibility",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "47ff4b449bfd6e41ac5c75854a36733467716068",
    "submitter": {
        "id": 1537,
        "url": "http://patches.dpdk.org/api/people/1537/?format=api",
        "name": "Wei Hu (Xavier)",
        "email": "huwei013@chinasoftinc.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/20200922085401.12272-5-huwei013@chinasoftinc.com/mbox/",
    "series": [
        {
            "id": 12401,
            "url": "http://patches.dpdk.org/api/series/12401/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12401",
            "date": "2020-09-22T08:53:46",
            "name": "updates for hns3 PMD driver",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/12401/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/78312/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/78312/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 85C03A04E1;\n\tTue, 22 Sep 2020 11:02:27 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 36FC21DBDD;\n\tTue, 22 Sep 2020 10:55:04 +0200 (CEST)",
            "from incedge.chinasoftinc.com (unknown [114.113.233.8])\n by dpdk.org (Postfix) with ESMTP id 5EACC1DAFF\n for <dev@dpdk.org>; Tue, 22 Sep 2020 10:54:56 +0200 (CEST)",
            "from mail.chinasoftinc.com ([10.168.0.51]) by\n incedge.chinasoftinc.com with ESMTP id L32AhJ0oQYAU6wc8 (version=TLSv1\n cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO);\n Tue, 22 Sep 2020 16:54:54 +0800 (CST)",
            "from localhost.localdomain (120.133.139.157) by INCCAS001.ito.icss\n (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Tue, 22 Sep 2020\n 16:54:53 +0800"
        ],
        "X-ASG-Debug-ID": "1600764894-149d111bae19b030001-TfluYd",
        "X-Barracuda-Envelope-From": "huwei013@chinasoftinc.com",
        "X-Barracuda-RBL-Trusted-Forwarder": [
            "10.168.0.51",
            "10.168.0.60"
        ],
        "X-ASG-Whitelist": "Client",
        "From": "\"Wei Hu (Xavier)\" <huwei013@chinasoftinc.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<xavier.huwei@huawei.com>",
        "Date": "Tue, 22 Sep 2020 16:53:48 +0800",
        "X-ASG-Orig-Subj": "[PATCH 04/17] net/hns3: add max number of segs compatibility",
        "Message-ID": "<20200922085401.12272-5-huwei013@chinasoftinc.com>",
        "X-Mailer": "git-send-email 2.9.5",
        "In-Reply-To": "<20200922085401.12272-1-huwei013@chinasoftinc.com>",
        "References": "<20200922085401.12272-1-huwei013@chinasoftinc.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[120.133.139.157]",
        "X-Barracuda-Connect": "UNKNOWN[10.168.0.51]",
        "X-Barracuda-Start-Time": "1600764894",
        "X-Barracuda-Encrypted": "ECDHE-RSA-AES256-SHA",
        "X-Barracuda-URL": "https://incspam.chinasofti.com:443/cgi-mod/mark.cgi",
        "X-Virus-Scanned": "by bsmtpd at chinasoftinc.com",
        "X-Barracuda-Scan-Msg-Size": "6614",
        "Subject": "[dpdk-dev] [PATCH 04/17] net/hns3: add max number of segs\n\tcompatibility",
        "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: Hongbo Zheng <zhenghongbo3@huawei.com>\n\nKunpeng 920 supports the maximum nb_segs of non-tso packet is 8 in Tx\ndirection, kunpeng 930 expands this limit value to 18, this patch sets\nthe corresponding value by querying the maximum number of non-tso nb_segs\nsupported by the device during initialization.\n\nSigned-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>\nSigned-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>\nSigned-off-by: Chengchang Tang <tangchengchang@huawei.com>\n---\n drivers/net/hns3/hns3_ethdev.c    |  2 +-\n drivers/net/hns3/hns3_ethdev_vf.c |  2 +-\n drivers/net/hns3/hns3_rxtx.c      | 30 ++++++++++++++++++++----------\n drivers/net/hns3/hns3_rxtx.h      |  1 +\n 4 files changed, 23 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c\nindex 9ce382a..ed4273b 100644\n--- a/drivers/net/hns3/hns3_ethdev.c\n+++ b/drivers/net/hns3/hns3_ethdev.c\n@@ -2514,7 +2514,7 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)\n \t\t.nb_min = HNS3_MIN_RING_DESC,\n \t\t.nb_align = HNS3_ALIGN_RING_DESC,\n \t\t.nb_seg_max = HNS3_MAX_TSO_BD_PER_PKT,\n-\t\t.nb_mtu_seg_max = HNS3_MAX_NON_TSO_BD_PER_PKT,\n+\t\t.nb_mtu_seg_max = hw->max_non_tso_bd_num,\n \t};\n \n \tinfo->default_rxconf = (struct rte_eth_rxconf) {\ndiff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c\nindex 037a5be..c39edf5 100644\n--- a/drivers/net/hns3/hns3_ethdev_vf.c\n+++ b/drivers/net/hns3/hns3_ethdev_vf.c\n@@ -966,7 +966,7 @@ hns3vf_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)\n \t\t.nb_min = HNS3_MIN_RING_DESC,\n \t\t.nb_align = HNS3_ALIGN_RING_DESC,\n \t\t.nb_seg_max = HNS3_MAX_TSO_BD_PER_PKT,\n-\t\t.nb_mtu_seg_max = HNS3_MAX_NON_TSO_BD_PER_PKT,\n+\t\t.nb_mtu_seg_max = hw->max_non_tso_bd_num,\n \t};\n \n \tinfo->default_rxconf = (struct rte_eth_rxconf) {\ndiff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c\nindex 6d02bad..7c7b9de 100644\n--- a/drivers/net/hns3/hns3_rxtx.c\n+++ b/drivers/net/hns3/hns3_rxtx.c\n@@ -2181,6 +2181,7 @@ hns3_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,\n \t\t\t\t\tHNS3_PORT_BASE_VLAN_ENABLE;\n \telse\n \t\ttxq->pvid_sw_shift_en = false;\n+\ttxq->max_non_tso_bd_num = hw->max_non_tso_bd_num;\n \ttxq->configured = true;\n \ttxq->io_base = (void *)((char *)hw->io_base + HNS3_TQP_REG_OFFSET +\n \t\t\t\tidx * HNS3_TQP_REG_SIZE);\n@@ -2438,7 +2439,8 @@ hns3_pktmbuf_copy_hdr(struct rte_mbuf *new_pkt, struct rte_mbuf *old_pkt)\n }\n \n static int\n-hns3_reassemble_tx_pkts(struct rte_mbuf *tx_pkt, struct rte_mbuf **new_pkt)\n+hns3_reassemble_tx_pkts(struct rte_mbuf *tx_pkt, struct rte_mbuf **new_pkt,\n+\t\t\t\t  uint8_t max_non_tso_bd_num)\n {\n \tstruct rte_mempool *mb_pool;\n \tstruct rte_mbuf *new_mbuf;\n@@ -2458,7 +2460,7 @@ hns3_reassemble_tx_pkts(struct rte_mbuf *tx_pkt, struct rte_mbuf **new_pkt)\n \tmb_pool = tx_pkt->pool;\n \tbuf_size = tx_pkt->buf_len - RTE_PKTMBUF_HEADROOM;\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+\tif (nb_new_buf > max_non_tso_bd_num)\n \t\treturn -EINVAL;\n \n \tlast_buf_len = rte_pktmbuf_pkt_len(tx_pkt) % buf_size;\n@@ -2690,7 +2692,8 @@ hns3_txd_enable_checksum(struct hns3_tx_queue *txq, uint16_t tx_desc_id,\n }\n \n static bool\n-hns3_pkt_need_linearized(struct rte_mbuf *tx_pkts, uint32_t bd_num)\n+hns3_pkt_need_linearized(struct rte_mbuf *tx_pkts, uint32_t bd_num,\n+\t\t\t\t uint32_t max_non_tso_bd_num)\n {\n \tstruct rte_mbuf *m_first = tx_pkts;\n \tstruct rte_mbuf *m_last = tx_pkts;\n@@ -2705,10 +2708,10 @@ hns3_pkt_need_linearized(struct rte_mbuf *tx_pkts, uint32_t bd_num)\n \t * frags greater than gso header len + mss, and the remaining 7\n \t * consecutive frags greater than MSS except the last 7 frags.\n \t */\n-\tif (bd_num <= HNS3_MAX_NON_TSO_BD_PER_PKT)\n+\tif (bd_num <= max_non_tso_bd_num)\n \t\treturn false;\n \n-\tfor (i = 0; m_last && i < HNS3_MAX_NON_TSO_BD_PER_PKT - 1;\n+\tfor (i = 0; m_last && i < max_non_tso_bd_num - 1;\n \t     i++, m_last = m_last->next)\n \t\ttot_len += m_last->data_len;\n \n@@ -2726,7 +2729,7 @@ hns3_pkt_need_linearized(struct rte_mbuf *tx_pkts, uint32_t bd_num)\n \t * ensure the sum of the data length of every 7 consecutive buffer\n \t * is greater than mss except the last one.\n \t */\n-\tfor (i = 0; m_last && i < bd_num - HNS3_MAX_NON_TSO_BD_PER_PKT; i++) {\n+\tfor (i = 0; m_last && i < bd_num - max_non_tso_bd_num; i++) {\n \t\ttot_len -= m_first->data_len;\n \t\ttot_len += m_last->data_len;\n \n@@ -2859,15 +2862,19 @@ uint16_t\n hns3_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,\n \t       uint16_t nb_pkts)\n {\n+\tstruct hns3_tx_queue *txq;\n \tstruct rte_mbuf *m;\n \tuint16_t i;\n \tint ret;\n \n+\ttxq = (struct hns3_tx_queue *)tx_queue;\n+\n \tfor (i = 0; i < nb_pkts; i++) {\n \t\tm = tx_pkts[i];\n \n \t\tif (hns3_pkt_is_tso(m) &&\n-\t\t    (hns3_pkt_need_linearized(m, m->nb_segs) ||\n+\t\t    (hns3_pkt_need_linearized(m, m->nb_segs,\n+\t\t\t\t\t      txq->max_non_tso_bd_num) ||\n \t\t     hns3_check_tso_pkt_valid(m))) {\n \t\t\trte_errno = EINVAL;\n \t\t\treturn i;\n@@ -2880,7 +2887,7 @@ hns3_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,\n \t\t\treturn i;\n \t\t}\n \n-\t\tif (hns3_vld_vlan_chk(tx_queue, m)) {\n+\t\tif (hns3_vld_vlan_chk(txq, m)) {\n \t\t\trte_errno = EINVAL;\n \t\t\treturn i;\n \t\t}\n@@ -2921,6 +2928,7 @@ static int\n hns3_check_non_tso_pkt(uint16_t nb_buf, struct rte_mbuf **m_seg,\n \t\t      struct rte_mbuf *tx_pkt, struct hns3_tx_queue *txq)\n {\n+\tuint8_t max_non_tso_bd_num;\n \tstruct rte_mbuf *new_pkt;\n \tint ret;\n \n@@ -2936,9 +2944,11 @@ hns3_check_non_tso_pkt(uint16_t nb_buf, struct rte_mbuf **m_seg,\n \t\treturn -EINVAL;\n \t}\n \n-\tif (unlikely(nb_buf > HNS3_MAX_NON_TSO_BD_PER_PKT)) {\n+\tmax_non_tso_bd_num = txq->max_non_tso_bd_num;\n+\tif (unlikely(nb_buf > max_non_tso_bd_num)) {\n \t\ttxq->exceed_limit_bd_pkt_cnt++;\n-\t\tret = hns3_reassemble_tx_pkts(tx_pkt, &new_pkt);\n+\t\tret = hns3_reassemble_tx_pkts(tx_pkt, &new_pkt,\n+\t\t\t\t\t      max_non_tso_bd_num);\n \t\tif (ret) {\n \t\t\ttxq->exceed_limit_bd_reassem_fail++;\n \t\t\treturn ret;\ndiff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h\nindex 476cfc2..5ffe30e 100644\n--- a/drivers/net/hns3/hns3_rxtx.h\n+++ b/drivers/net/hns3/hns3_rxtx.h\n@@ -372,6 +372,7 @@ struct hns3_tx_queue {\n \t */\n \tuint32_t min_tx_pkt_len;\n \n+\tuint8_t max_non_tso_bd_num; /* max BD number of one non-TSO packet */\n \tbool tx_deferred_start; /* don't start this queue in dev start */\n \tbool configured;        /* indicate if tx queue has been configured */\n \t/*\n",
    "prefixes": [
        "04/17"
    ]
}