From: Yuan Wang <yuanx.wang@intel.com>
To: dev@dpdk.org, Thomas Monjalon <thomas@monjalon.net>,
Ferruh Yigit <ferruh.yigit@amd.com>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
Ray Kinsella <mdr@ashroe.eu>
Cc: ferruh.yigit@xilinx.com, xiaoyun.li@intel.com,
aman.deep.singh@intel.com, yuying.zhang@intel.com,
qi.z.zhang@intel.com, qiming.yang@intel.com,
jerinjacobk@gmail.com, viacheslavo@nvidia.com,
stephen@networkplumber.org, xuan.ding@intel.com,
hpothula@marvell.com, yaqi.tang@intel.com,
Yuan Wang <yuanx.wang@intel.com>,
Wenxuan Wu <wenxuanx.wu@intel.com>
Subject: [PATCH v9 1/4] ethdev: introduce protocol header API
Date: Mon, 10 Oct 2022 04:25:38 +0800 [thread overview]
Message-ID: <20221009202541.352724-2-yuanx.wang@intel.com> (raw)
In-Reply-To: <20221009202541.352724-1-yuanx.wang@intel.com>
Add a new ethdev API to retrieve supported protocol headers
of a PMD, which helps to configure protocol header based buffer split.
Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Signed-off-by: Wenxuan Wu <wenxuanx.wu@intel.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
doc/guides/nics/features.rst | 2 +-
doc/guides/rel_notes/release_22_11.rst | 5 ++++
lib/ethdev/ethdev_driver.h | 15 ++++++++++++
lib/ethdev/rte_ethdev.c | 33 ++++++++++++++++++++++++++
lib/ethdev/rte_ethdev.h | 30 +++++++++++++++++++++++
lib/ethdev/version.map | 1 +
6 files changed, 85 insertions(+), 1 deletion(-)
diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 6aa1085c5b..fea604e77f 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -183,7 +183,7 @@ Scatters the packets being received on specified boundaries to segmented mbufs.
* **[uses] rte_eth_rxconf**: ``rx_conf.rx_seg, rx_conf.rx_nseg``.
* **[implements] datapath**: ``Buffer Split functionality``.
* **[provides] rte_eth_dev_info**: ``rx_offload_capa:RTE_ETH_RX_OFFLOAD_BUFFER_SPLIT``.
-* **[related] API**: ``rte_eth_rx_queue_setup()``.
+* **[related] API**: ``rte_eth_rx_queue_setup()``, ``rte_eth_buffer_split_get_supported_hdr_ptypes()``.
.. _nic_features_lro:
diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst
index c560dbdab7..16aca14bab 100644
--- a/doc/guides/rel_notes/release_22_11.rst
+++ b/doc/guides/rel_notes/release_22_11.rst
@@ -189,6 +189,11 @@ New Features
into single event containing ``rte_event_vector``
whose event type is ``RTE_EVENT_TYPE_CRYPTODEV_VECTOR``.
+* **Added protocol header based buffer split.**
+
+ * Added ``rte_eth_buffer_split_get_supported_hdr_ptypes()``, to get supported
+ header protocols of a PMD to split.
+
Removed Items
-------------
diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h
index e2bd4642b9..1300acc95d 100644
--- a/lib/ethdev/ethdev_driver.h
+++ b/lib/ethdev/ethdev_driver.h
@@ -1055,6 +1055,18 @@ typedef int (*eth_ip_reassembly_conf_get_t)(struct rte_eth_dev *dev,
typedef int (*eth_ip_reassembly_conf_set_t)(struct rte_eth_dev *dev,
const struct rte_eth_ip_reassembly_params *conf);
+/**
+ * @internal
+ * Get supported header protocols of a PMD to split.
+ *
+ * @param dev
+ * Ethdev handle of port.
+ *
+ * @return
+ * An array pointer to store supported protocol headers.
+ */
+typedef const uint32_t *(*eth_buffer_split_supported_hdr_ptypes_get_t)(struct rte_eth_dev *dev);
+
/**
* @internal
* Dump private info from device to a file.
@@ -1366,6 +1378,9 @@ struct eth_dev_ops {
/** Set IP reassembly configuration */
eth_ip_reassembly_conf_set_t ip_reassembly_conf_set;
+ /** Get supported header ptypes to split */
+ eth_buffer_split_supported_hdr_ptypes_get_t buffer_split_supported_hdr_ptypes_get;
+
/** Dump private info from device */
eth_dev_priv_dump_t eth_dev_priv_dump;
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 4703ab0caf..79d1f9b993 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -6209,6 +6209,39 @@ rte_eth_tx_descriptor_dump(uint16_t port_id, uint16_t queue_id,
queue_id, offset, num, file));
}
+int
+rte_eth_buffer_split_get_supported_hdr_ptypes(uint16_t port_id, uint32_t *ptypes, int num)
+{
+ int i, j;
+ struct rte_eth_dev *dev;
+ const uint32_t *all_types;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+ dev = &rte_eth_devices[port_id];
+
+ if (ptypes == NULL && num > 0) {
+ RTE_ETHDEV_LOG(ERR,
+ "Cannot get ethdev port %u supported header protocol types to NULL when array size is non zero\n",
+ port_id);
+ return -EINVAL;
+ }
+
+ if (*dev->dev_ops->buffer_split_supported_hdr_ptypes_get == NULL)
+ return -ENOTSUP;
+ all_types = (*dev->dev_ops->buffer_split_supported_hdr_ptypes_get)(dev);
+
+ if (all_types == NULL)
+ return 0;
+
+ for (i = 0, j = 0; all_types[i] != RTE_PTYPE_UNKNOWN; ++i) {
+ if (j < num)
+ ptypes[j] = all_types[i];
+ j++;
+ }
+
+ return j;
+}
+
RTE_LOG_REGISTER_DEFAULT(rte_eth_dev_logtype, INFO);
RTE_INIT(ethdev_init_telemetry)
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 8c4a35cc1f..f9da569179 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -6337,6 +6337,36 @@ rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
}
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Get supported header protocols to split on Rx.
+ *
+ * When a packet type is announced to be split, it *must* be supported by
+ * the PMD. For instance, if eth-ipv4, eth-ipv4-udp is announced, the PMD must
+ * return the following packet types for these packets:
+ * - Ether/IPv4 -> RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4
+ * - Ether/IPv4/UDP -> RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_UDP
+ *
+ * @param port_id
+ * The port identifier of the device.
+ * @param[out] ptypes
+ * An array pointer to store supported protocol headers, allocated by caller.
+ * These ptypes are composed with RTE_PTYPE_*.
+ * @param num
+ * Size of the array pointed by param ptypes.
+ * @return
+ * - (>=0) Number of supported ptypes. If the number of types exceeds num,
+ * only num entries will be filled into the ptypes array, but the full
+ * count of supported ptypes will be returned.
+ * - (-ENOTSUP) if header protocol is not supported by device.
+ * - (-ENODEV) if *port_id* invalid.
+ * - (-EINVAL) if bad parameter.
+ */
+__rte_experimental
+int rte_eth_buffer_split_get_supported_hdr_ptypes(uint16_t port_id, uint32_t *ptypes, int num);
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map
index 3205556ce7..30b067e0b6 100644
--- a/lib/ethdev/version.map
+++ b/lib/ethdev/version.map
@@ -296,6 +296,7 @@ EXPERIMENTAL {
rte_flow_async_action_handle_query;
rte_mtr_meter_policy_get;
rte_mtr_meter_profile_get;
+ rte_eth_buffer_split_get_supported_hdr_ptypes;
};
INTERNAL {
--
2.25.1
next prev parent reply other threads:[~2022-10-09 12:39 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-12 18:15 [PATCH 0/4] support protocol based buffer split Yuan Wang
2022-08-12 18:15 ` [PATCH 1/4] ethdev: introduce protocol header API Yuan Wang
2022-08-12 18:15 ` [PATCH 2/4] ethdev: introduce protocol hdr based buffer split Yuan Wang
2022-08-12 18:15 ` [PATCH 3/4] app/testpmd: add rxhdrs commands and parameters Yuan Wang
2022-08-12 18:15 ` [PATCH 4/4] net/ice: support buffer split in Rx path Yuan Wang
2022-09-01 22:33 ` [PATCH v2 0/4] support protocol based buffer split Yuan Wang
2022-09-01 22:34 ` [PATCH v2 1/4] ethdev: introduce protocol header API Yuan Wang
2022-09-01 22:35 ` [PATCH v2 2/4] ethdev: introduce protocol hdr based buffer split Yuan Wang
2022-09-01 22:36 ` [PATCH v2 3/4] app/testpmd: add rxhdrs commands and parameters Yuan Wang
2022-09-01 22:37 ` [PATCH v2 4/4] net/ice: support buffer split in Rx path Yuan Wang
2022-09-02 19:10 ` [PATCH v3 0/4] support protocol based buffer split Yuan Wang
2022-09-02 19:10 ` [PATCH v3 1/4] ethdev: introduce protocol header API Yuan Wang
2022-09-12 11:24 ` Andrew Rybchenko
2022-09-16 8:34 ` Wang, YuanX
2022-09-02 19:10 ` [PATCH v3 2/4] ethdev: introduce protocol hdr based buffer split Yuan Wang
2022-09-12 11:47 ` Andrew Rybchenko
2022-09-16 8:38 ` Wang, YuanX
2022-09-20 5:35 ` Andrew Rybchenko
2022-09-22 3:13 ` Wang, YuanX
2022-09-13 7:56 ` Suanming Mou
2022-09-16 8:39 ` Wang, YuanX
2022-09-02 19:10 ` [PATCH v3 3/4] app/testpmd: add rxhdrs commands and parameters Yuan Wang
2022-09-02 19:10 ` [PATCH v3 4/4] net/ice: support buffer split in Rx path Yuan Wang
2022-09-20 11:12 ` [PATCH v4 0/4] support protocol based buffer split Yuan Wang
2022-09-20 11:12 ` [PATCH v4 1/4] ethdev: introduce protocol header API Yuan Wang
2022-09-20 11:12 ` [PATCH v4 2/4] ethdev: introduce protocol hdr based buffer split Yuan Wang
2022-09-20 11:12 ` [PATCH v4 3/4] app/testpmd: add rxhdrs commands and parameters Yuan Wang
2022-09-20 11:12 ` [PATCH v4 4/4] net/ice: support buffer split in Rx path Yuan Wang
2022-09-26 9:40 ` [PATCH v5 0/4] support protocol based buffer split Yuan Wang
2022-09-26 9:40 ` [PATCH v5 1/4] ethdev: introduce protocol header API Yuan Wang
2022-09-26 9:40 ` [PATCH v5 2/4] ethdev: introduce protocol hdr based buffer split Yuan Wang
2022-09-28 15:42 ` Wang, YuanX
2022-09-26 9:40 ` [PATCH v5 3/4] app/testpmd: add rxhdrs commands and parameters Yuan Wang
2022-09-26 9:40 ` [PATCH v5 4/4] net/ice: support buffer split in Rx path Yuan Wang
2022-09-29 18:59 ` [PATCH v6 0/4] support protocol based buffer split Yuan Wang
2022-09-29 18:59 ` [PATCH v6 1/4] ethdev: introduce protocol header API Yuan Wang
2022-09-29 18:59 ` [PATCH v6 2/4] ethdev: introduce protocol hdr based buffer split Yuan Wang
2022-09-29 18:59 ` [PATCH v6 3/4] app/testpmd: add rxhdrs commands and parameters Yuan Wang
2022-09-29 18:59 ` [PATCH v6 4/4] net/ice: support buffer split in Rx path Yuan Wang
2022-09-30 6:45 ` Tang, Yaqi
2022-10-01 21:05 ` [PATCH v7 0/4] support protocol based buffer split Yuan Wang
2022-10-01 21:05 ` [PATCH v7 1/4] ethdev: introduce protocol header API Yuan Wang
2022-10-03 7:04 ` Andrew Rybchenko
2022-10-04 2:21 ` Wang, YuanX
2022-10-04 7:52 ` Andrew Rybchenko
2022-10-04 15:00 ` Wang, YuanX
2022-10-01 21:05 ` [PATCH v7 2/4] ethdev: introduce protocol hdr based buffer split Yuan Wang
2022-10-02 4:01 ` Wang, YuanX
2022-10-03 7:47 ` Andrew Rybchenko
2022-10-04 2:48 ` Wang, YuanX
2022-10-04 8:22 ` Andrew Rybchenko
2022-10-04 15:01 ` Wang, YuanX
2022-10-01 21:05 ` [PATCH v7 3/4] app/testpmd: add rxhdrs commands and parameters Yuan Wang
2022-10-01 21:05 ` [PATCH v7 4/4] net/ice: support buffer split in Rx path Yuan Wang
2022-10-05 23:18 ` [PATCH v8 0/4] support protocol based buffer split Yuan Wang
2022-10-05 23:18 ` [PATCH v8 1/4] ethdev: introduce protocol header API Yuan Wang
2022-10-06 10:11 ` Andrew Rybchenko
2022-10-05 23:18 ` [PATCH v8 2/4] ethdev: introduce protocol hdr based buffer split Yuan Wang
2022-10-06 10:11 ` Andrew Rybchenko
2022-10-08 14:30 ` Ding, Xuan
2022-10-05 23:18 ` [PATCH v8 3/4] app/testpmd: add rxhdrs commands and parameters Yuan Wang
2022-10-06 10:12 ` Andrew Rybchenko
2022-10-05 23:18 ` [PATCH v8 4/4] net/ice: support buffer split in Rx path Yuan Wang
2022-10-06 10:12 ` Andrew Rybchenko
2022-10-06 10:13 ` [PATCH v8 0/4] support protocol based buffer split Andrew Rybchenko
2022-10-09 20:25 ` [PATCH v9 " Yuan Wang
2022-10-09 14:58 ` Andrew Rybchenko
2022-10-10 2:45 ` Ding, Xuan
2022-10-09 20:25 ` Yuan Wang [this message]
2022-10-09 20:25 ` [PATCH v9 2/4] ethdev: introduce protocol hdr " Yuan Wang
2022-10-09 20:25 ` [PATCH v9 3/4] app/testpmd: add rxhdrs commands and parameters Yuan Wang
2022-10-09 20:25 ` [PATCH v9 4/4] net/ice: support buffer split in Rx path Yuan Wang
-- strict thread matches above, loose matches on Subject: below --
2022-03-03 6:01 [RFC] ethdev: introduce protocol type based header split xuan.ding
2022-06-13 10:25 ` [PATCH v9 0/4] add an api to support proto based buffer split wenxuanx.wu
2022-06-13 10:25 ` [PATCH v9 1/4] ethdev: introduce protocol header API wenxuanx.wu
2022-07-07 9:05 ` Thomas Monjalon
2022-08-01 7:09 ` Wang, YuanX
2022-08-01 10:01 ` Thomas Monjalon
2022-08-02 10:12 ` Wang, YuanX
2022-07-08 15:00 ` Andrew Rybchenko
2022-08-01 7:17 ` Wang, YuanX
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221009202541.352724-2-yuanx.wang@intel.com \
--to=yuanx.wang@intel.com \
--cc=aman.deep.singh@intel.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@amd.com \
--cc=ferruh.yigit@xilinx.com \
--cc=hpothula@marvell.com \
--cc=jerinjacobk@gmail.com \
--cc=mdr@ashroe.eu \
--cc=qi.z.zhang@intel.com \
--cc=qiming.yang@intel.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
--cc=viacheslavo@nvidia.com \
--cc=wenxuanx.wu@intel.com \
--cc=xiaoyun.li@intel.com \
--cc=xuan.ding@intel.com \
--cc=yaqi.tang@intel.com \
--cc=yuying.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).