get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 112692,
    "url": "http://patchwork.dpdk.org/api/patches/112692/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20220613102550.241759-2-wenxuanx.wu@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20220613102550.241759-2-wenxuanx.wu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220613102550.241759-2-wenxuanx.wu@intel.com",
    "date": "2022-06-13T10:25:47",
    "name": "[v9,1/4] ethdev: introduce protocol header API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a2eff7a94810e32ce89f77a8c1ba110a74a5f106",
    "submitter": {
        "id": 2515,
        "url": "http://patchwork.dpdk.org/api/people/2515/?format=api",
        "name": "Wu, WenxuanX",
        "email": "wenxuanx.wu@intel.com"
    },
    "delegate": {
        "id": 3961,
        "url": "http://patchwork.dpdk.org/api/users/3961/?format=api",
        "username": "arybchenko",
        "first_name": "Andrew",
        "last_name": "Rybchenko",
        "email": "andrew.rybchenko@oktetlabs.ru"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20220613102550.241759-2-wenxuanx.wu@intel.com/mbox/",
    "series": [
        {
            "id": 23498,
            "url": "http://patchwork.dpdk.org/api/series/23498/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=23498",
            "date": "2022-06-13T10:25:46",
            "name": "add an api to support proto based buffer split",
            "version": 9,
            "mbox": "http://patchwork.dpdk.org/series/23498/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/112692/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/112692/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 9C7FDA0543;\n\tMon, 13 Jun 2022 12:49:06 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 77B12410DD;\n\tMon, 13 Jun 2022 12:49:04 +0200 (CEST)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by mails.dpdk.org (Postfix) with ESMTP id E51FD4069C\n for <dev@dpdk.org>; Mon, 13 Jun 2022 12:49:02 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 13 Jun 2022 03:49:02 -0700",
            "from unknown (HELO localhost.localdomain) ([10.239.251.3])\n by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 13 Jun 2022 03:48:58 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1655117343; x=1686653343;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=1JjaoW+ZvoVoZzYl6honTnADjv1U+nxGt2JOOtZrK3I=;\n b=cnHo3254OtSEdcYiCzLFgkCDgQUo7NfNvDZhjDwDWxfaH4Y1rHxv+po3\n EydEvTFdcN7se2hT376UiGAaxm51+470yAaSkWxlpHnzJTHXK3KAMYHhO\n /oW+ljGmHMCjHsmy9lADJc7+LXHwJnGQew0MEcjup5LFqWcrMEOFTwv9l\n 3f6uiXV9t2/iIuDHPcZZAD+S3JG7LQWPeDE76i3zPGVNrq5zMbQXwWVPy\n D5Fhy7pONyBuvfSpIy63qL7sg/nhG6VycKZSQNZX6tn+70a4tBhKrRDcJ\n /e5rxfZgmRSwm5Q4GA7yDZalZjPc9GSMbVREbmrVyJWqNCydkHecf+WoE g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6400,9594,10376\"; a=\"258076128\"",
            "E=Sophos;i=\"5.91,297,1647327600\"; d=\"scan'208\";a=\"258076128\"",
            "E=Sophos;i=\"5.91,297,1647327600\"; d=\"scan'208\";a=\"617442805\""
        ],
        "From": "wenxuanx.wu@intel.com",
        "To": "thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru, xiaoyun.li@intel.com,\n ferruh.yigit@xilinx.com, aman.deep.singh@intel.com, dev@dpdk.org,\n yuying.zhang@intel.com, qi.z.zhang@intel.com, jerinjacobk@gmail.com",
        "Cc": "stephen@networkplumber.org,\n\tWenxuan Wu <wenxuanx.wu@intel.com>",
        "Subject": "[PATCH v9 1/4] ethdev: introduce protocol header API",
        "Date": "Mon, 13 Jun 2022 10:25:47 +0000",
        "Message-Id": "<20220613102550.241759-2-wenxuanx.wu@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220613102550.241759-1-wenxuanx.wu@intel.com>",
        "References": "<20220303060136.36427-1-xuan.ding@intel.com>\n <20220613102550.241759-1-wenxuanx.wu@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "From: Wenxuan Wu <wenxuanx.wu@intel.com>\n\nThis patch added new ethdev API to retrieve supported protocol header mask\nof a PMD, which helps to configure protocol header based buffer split.\n\nSigned-off-by: Wenxuan Wu <wenxuanx.wu@intel.com>\n---\n doc/guides/rel_notes/release_22_07.rst |  2 ++\n lib/ethdev/ethdev_driver.h             | 18 +++++++++++++++\n lib/ethdev/rte_ethdev.c                | 31 +++++++++++++++++---------\n lib/ethdev/rte_ethdev.h                | 22 ++++++++++++++++++\n lib/ethdev/version.map                 |  3 +++\n 5 files changed, 65 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst\nindex 42a5f2d990..a9b8ed3494 100644\n--- a/doc/guides/rel_notes/release_22_07.rst\n+++ b/doc/guides/rel_notes/release_22_07.rst\n@@ -54,7 +54,9 @@ New Features\n      This section is a comment. Do not overwrite or remove it.\n      Also, make sure to start the actual text at the margin.\n      =======================================================\n+* **Added new ethdev API for PMD to get buffer split supported protocol types.**\n \n+  Added ``rte_eth_supported_hdrs_get()``, to get supported header protocol mask of a PMD to split.\n \n Removed Items\n -------------\ndiff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h\nindex 69d9dc21d8..7b19842582 100644\n--- a/lib/ethdev/ethdev_driver.h\n+++ b/lib/ethdev/ethdev_driver.h\n@@ -1054,6 +1054,21 @@ typedef int (*eth_ip_reassembly_conf_get_t)(struct rte_eth_dev *dev,\n typedef int (*eth_ip_reassembly_conf_set_t)(struct rte_eth_dev *dev,\n \t\tconst struct rte_eth_ip_reassembly_params *conf);\n \n+/**\n+ * @internal\n+ * Get supported protocol flags of a PMD to split.\n+ *\n+ * @param dev\n+ *   ethdev handle of port.\n+ *\n+ * @param[out]  ptype mask\n+ *   supported ptype mask of a PMD.\n+ *\n+ * @return\n+ *   Negative errno value on error, zero on success.\n+ */\n+typedef int (*eth_buffer_split_hdr_ptype_get_t)(struct rte_eth_dev *dev, uint32_t *ptype);\n+\n /**\n  * @internal\n  * Dump private info from device to a file.\n@@ -1281,6 +1296,9 @@ struct eth_dev_ops {\n \t/** Set IP reassembly configuration */\n \teth_ip_reassembly_conf_set_t ip_reassembly_conf_set;\n \n+\t/** Get supported ptypes to split */\n+\teth_buffer_split_hdr_ptype_get_t hdrs_supported_ptypes_get;\n+\n \t/** Dump private info from device */\n \teth_dev_priv_dump_t eth_dev_priv_dump;\n };\ndiff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c\nindex 29a3d80466..e1f2a0ffe3 100644\n--- a/lib/ethdev/rte_ethdev.c\n+++ b/lib/ethdev/rte_ethdev.c\n@@ -1636,9 +1636,10 @@ rte_eth_dev_is_removed(uint16_t port_id)\n }\n \n static int\n-rte_eth_rx_queue_check_split(const struct rte_eth_rxseg_split *rx_seg,\n-\t\t\t     uint16_t n_seg, uint32_t *mbp_buf_size,\n-\t\t\t     const struct rte_eth_dev_info *dev_info)\n+rte_eth_rx_queue_check_split(uint16_t port_id,\n+\t\t\t\tconst struct rte_eth_rxseg_split *rx_seg,\n+\t\t\t\tint16_t n_seg, uint32_t *mbp_buf_size,\n+\t\t\t    const struct rte_eth_dev_info *dev_info)\n {\n \tconst struct rte_eth_rxseg_capa *seg_capa = &dev_info->rx_seg_capa;\n \tstruct rte_mempool *mp_first;\n@@ -1694,13 +1695,7 @@ rte_eth_rx_queue_check_split(const struct rte_eth_rxseg_split *rx_seg,\n \t\t}\n \t\toffset += seg_idx != 0 ? 0 : RTE_PKTMBUF_HEADROOM;\n \t\t*mbp_buf_size = rte_pktmbuf_data_room_size(mpl);\n-\t\tlength = length != 0 ? length : *mbp_buf_size;\n-\t\tif (*mbp_buf_size < length + offset) {\n-\t\t\tRTE_ETHDEV_LOG(ERR,\n-\t\t\t\t       \"%s mbuf_data_room_size %u < %u (segment length=%u + segment offset=%u)\\n\",\n-\t\t\t\t       mpl->name, *mbp_buf_size,\n-\t\t\t\t       length + offset, length, offset);\n-\t\t\treturn -EINVAL;\n+\n \t\t}\n \t}\n \treturn 0;\n@@ -1779,7 +1774,7 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,\n \t\tn_seg = rx_conf->rx_nseg;\n \n \t\tif (rx_conf->offloads & RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT) {\n-\t\t\tret = rte_eth_rx_queue_check_split(rx_seg, n_seg,\n+\t\t\tret = rte_eth_rx_queue_check_split(port_id, rx_seg, n_seg,\n \t\t\t\t\t\t\t   &mbp_buf_size,\n \t\t\t\t\t\t\t   &dev_info);\n \t\t\tif (ret != 0)\n@@ -5844,6 +5839,20 @@ rte_eth_ip_reassembly_conf_set(uint16_t port_id,\n \t\t       (*dev->dev_ops->ip_reassembly_conf_set)(dev, conf));\n }\n \n+int\n+rte_eth_supported_hdrs_get(uint16_t port_id, uint32_t *ptypes)\n+{\n+\tstruct rte_eth_dev *dev;\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->hdrs_supported_ptypes_get,\n+\t\t\t\t-ENOTSUP);\n+\n+\treturn eth_err(port_id,\n+\t\t       (*dev->dev_ops->hdrs_supported_ptypes_get)(dev, ptypes));\n+}\n+\n int\n rte_eth_dev_priv_dump(uint16_t port_id, FILE *file)\n {\ndiff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h\nindex 04cff8ee10..72cac1518e 100644\n--- a/lib/ethdev/rte_ethdev.h\n+++ b/lib/ethdev/rte_ethdev.h\n@@ -6152,6 +6152,28 @@ rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,\n \treturn rte_eth_tx_buffer_flush(port_id, queue_id, buffer);\n }\n \n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * Get supported header protocols to split supported by PMD.\n+ * The API will return error if the device is not valid.\n+ *\n+ * @param port_id\n+ *   The port identifier of the device.\n+ * @param ptype\n+ *   Supported protocol headers of driver.\n+ * @return\n+ *   - (-ENOTSUP) if header protocol is not supported by device.\n+ *   - (-ENODEV) if *port_id* invalid.\n+ *   - (-EIO) if device is removed.\n+ *   - (0) on success.\n+ */\n+__rte_experimental\n+int rte_eth_supported_hdrs_get(uint16_t port_id,\n+\t\tuint32_t *ptype);\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/ethdev/version.map b/lib/ethdev/version.map\nindex 20391ab29e..7705c0364a 100644\n--- a/lib/ethdev/version.map\n+++ b/lib/ethdev/version.map\n@@ -279,6 +279,9 @@ EXPERIMENTAL {\n \trte_flow_async_action_handle_create;\n \trte_flow_async_action_handle_destroy;\n \trte_flow_async_action_handle_update;\n+\n+\t# added in 22.07\n+\trte_eth_supported_hdrs_get;\n };\n \n INTERNAL {\n",
    "prefixes": [
        "v9",
        "1/4"
    ]
}