get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 133833,
    "url": "http://patches.dpdk.org/api/patches/133833/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231103102759.18886-2-lihuisong@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": "<20231103102759.18886-2-lihuisong@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231103102759.18886-2-lihuisong@huawei.com",
    "date": "2023-11-03T10:27:57",
    "name": "[v5,1/3] ethdev: introduce maximum Rx buffer size",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "6c9136466e301579f12adf2f1287208914de3d72",
    "submitter": {
        "id": 2085,
        "url": "http://patches.dpdk.org/api/people/2085/?format=api",
        "name": "lihuisong (C)",
        "email": "lihuisong@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/20231103102759.18886-2-lihuisong@huawei.com/mbox/",
    "series": [
        {
            "id": 30134,
            "url": "http://patches.dpdk.org/api/series/30134/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30134",
            "date": "2023-11-03T10:27:56",
            "name": "introduce maximum Rx buffer size",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/30134/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/133833/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/133833/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 BAFAE43279;\n\tFri,  3 Nov 2023 11:28:03 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 34E3142DAC;\n\tFri,  3 Nov 2023 11:27:49 +0100 (CET)",
            "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id CF9BE40273\n for <dev@dpdk.org>; Fri,  3 Nov 2023 11:27:44 +0100 (CET)",
            "from kwepemm000004.china.huawei.com (unknown [172.30.72.56])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SMH106hC8zrSn3;\n Fri,  3 Nov 2023 18:24:36 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n kwepemm000004.china.huawei.com (7.193.23.18) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2507.31; Fri, 3 Nov 2023 18:27:41 +0800"
        ],
        "From": "Huisong Li <lihuisong@huawei.com>",
        "To": "<dev@dpdk.org>, Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit\n <ferruh.yigit@amd.com>, Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>",
        "CC": "<liuyonglong@huawei.com>, <lihuisong@huawei.com>",
        "Subject": "[PATCH v5 1/3] ethdev: introduce maximum Rx buffer size",
        "Date": "Fri, 3 Nov 2023 18:27:57 +0800",
        "Message-ID": "<20231103102759.18886-2-lihuisong@huawei.com>",
        "X-Mailer": "git-send-email 2.33.0",
        "In-Reply-To": "<20231103102759.18886-1-lihuisong@huawei.com>",
        "References": "<20230808040234.12947-1-lihuisong@huawei.com>\n <20231103102759.18886-1-lihuisong@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"UTF-8\"",
        "Content-Transfer-Encoding": "8bit",
        "X-Originating-IP": "[10.69.192.56]",
        "X-ClientProxiedBy": "dggems706-chm.china.huawei.com (10.3.19.183) To\n kwepemm000004.china.huawei.com (7.193.23.18)",
        "X-CFilter-Loop": "Reflected",
        "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"
    },
    "content": "The \"min_rx_bufsize\" in struct rte_eth_dev_info stands for the minimum\nRx buffer size supported by hardware. Actually, some engines also have\nthe maximum Rx buffer specification, like, hns3, i40e and so on. If mbuf\ndata room size in mempool is greater then the maximum Rx buffer size\nper descriptor supported by HW, the data size application used in each\nmbuf is just as much as the maximum Rx buffer size instead of the whole\ndata room size.\n\nSo introduce maximum Rx buffer size which is not enforced just to\nreport user to avoid memory waste. In addition, fix the comment for\nthe \"min_rx_bufsize\" to make it be more specific.\n\nSigned-off-by: Huisong Li <lihuisong@huawei.com>\nAcked-by: Chengwen Feng <fengchengwen@huawei.com>\nAcked-by: Morten Brørup <mb@smartsharesystems.com>\n---\n doc/guides/rel_notes/release_23_11.rst |  7 +++++++\n lib/ethdev/rte_ethdev.c                |  8 ++++++++\n lib/ethdev/rte_ethdev.h                | 10 +++++++++-\n 3 files changed, 24 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst\nindex 95db98d098..d4f7d5b266 100644\n--- a/doc/guides/rel_notes/release_23_11.rst\n+++ b/doc/guides/rel_notes/release_23_11.rst\n@@ -122,6 +122,13 @@ New Features\n   a group's miss actions, which are the actions to be performed on packets\n   that didn't match any of the flow rules in the group.\n \n+* **Added maximum Rx buffer size to report.**\n+\n+  Introduced the ``max_rx_bufsize`` field representing the maximum Rx\n+  buffer size per descriptor supported by HW in structure ``rte_eth_dev_info``\n+  to report user and to avoid wasting space of mempool.\n+  Its value is UINT32_MAX if driver doesn't report it.\n+\n * **Updated Amazon ena (Elastic Network Adapter) net driver.**\n \n   * Upgraded ENA HAL to latest version.\ndiff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c\nindex af23ac0ad0..24b708f772 100644\n--- a/lib/ethdev/rte_ethdev.c\n+++ b/lib/ethdev/rte_ethdev.c\n@@ -2112,6 +2112,7 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,\n \tstruct rte_eth_dev *dev;\n \tstruct rte_eth_dev_info dev_info;\n \tstruct rte_eth_rxconf local_conf;\n+\tuint32_t buf_data_size;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n@@ -2158,6 +2159,12 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,\n \t\t\treturn ret;\n \n \t\tmbp_buf_size = rte_pktmbuf_data_room_size(mp);\n+\t\tbuf_data_size = mbp_buf_size - RTE_PKTMBUF_HEADROOM;\n+\t\tif (buf_data_size > dev_info.max_rx_bufsize)\n+\t\t\tRTE_ETHDEV_LOG(DEBUG,\n+\t\t\t\t\"For port_id=%u, the mbuf data buffer size (%u) is bigger than \"\n+\t\t\t\t\"max buffer size (%u) device can utilize, so mbuf size can be reduced.\\n\",\n+\t\t\t\tport_id, buf_data_size, dev_info.max_rx_bufsize);\n \t} else if (rx_conf != NULL && rx_conf->rx_nseg > 0) {\n \t\tconst struct rte_eth_rxseg_split *rx_seg;\n \t\tuint16_t n_seg;\n@@ -3757,6 +3764,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)\n \tdev_info->min_mtu = RTE_ETHER_MIN_LEN - RTE_ETHER_HDR_LEN -\n \t\tRTE_ETHER_CRC_LEN;\n \tdev_info->max_mtu = UINT16_MAX;\n+\tdev_info->max_rx_bufsize = UINT32_MAX;\n \n \tif (*dev->dev_ops->dev_infos_get == NULL)\n \t\treturn -ENOTSUP;\ndiff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h\nindex a53dd5a1ef..7133b73d26 100644\n--- a/lib/ethdev/rte_ethdev.h\n+++ b/lib/ethdev/rte_ethdev.h\n@@ -1723,7 +1723,15 @@ struct rte_eth_dev_info {\n \tuint16_t min_mtu;\t/**< Minimum MTU allowed */\n \tuint16_t max_mtu;\t/**< Maximum MTU allowed */\n \tconst uint32_t *dev_flags; /**< Device flags */\n-\tuint32_t min_rx_bufsize; /**< Minimum size of Rx buffer. */\n+\t/** Minimum Rx buffer size per descriptor supported by HW. */\n+\tuint32_t min_rx_bufsize;\n+\t/**\n+\t * Maximum Rx buffer size per descriptor supported by HW.\n+\t * The value is not enforced, information only to application to\n+\t * optimize mbuf size. Its value is UINT32_MAX when not specified\n+\t * by the driver.\n+\t */\n+\tuint32_t max_rx_bufsize;\n \tuint32_t max_rx_pktlen; /**< Maximum configurable length of Rx pkt. */\n \t/** Maximum configurable size of LRO aggregated packet. */\n \tuint32_t max_lro_pkt_size;\n",
    "prefixes": [
        "v5",
        "1/3"
    ]
}