diff mbox series

[v7,1/4] ethdev: introduce protocol header API

Message ID 20221001210521.15955-2-yuanx.wang@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: Andrew Rybchenko
Headers show
Series support protocol based buffer split | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Yuan Wang Oct. 1, 2022, 9:05 p.m. UTC
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/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                 |  3 +++
 5 files changed, 86 insertions(+)

Comments

Andrew Rybchenko Oct. 3, 2022, 7:04 a.m. UTC | #1
On 10/2/22 00:05, Yuan Wang wrote:
> 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/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                 |  3 +++
>   5 files changed, 86 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst
> index 0231959874..6a7474a3d6 100644
> --- a/doc/guides/rel_notes/release_22_11.rst
> +++ b/doc/guides/rel_notes/release_22_11.rst
> @@ -96,6 +96,11 @@ New Features
>     * Added ``rte_event_eth_tx_adapter_queue_stop`` to stop the Tx Adapter
>       from enqueueing any packets to the Tx queue.
>   
> +* **Added new ethdev API for PMD to get buffer split supported protocol types.**
> +
> +  * Added ``rte_eth_buffer_split_get_supported_hdr_ptypes()``, to get supported
> +    header protocols of a PMD to split.
> +

ethdev features should be grouped together in release notes.
I'll fix it on applying if a new version is not required.

[snip]

> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
> index 0c2c1088c0..1f0a7f8f3f 100644
> --- a/lib/ethdev/rte_ethdev.c
> +++ b/lib/ethdev/rte_ethdev.c
> @@ -6002,6 +6002,39 @@ rte_eth_dev_priv_dump(uint16_t port_id, FILE *file)
>   	return eth_err(port_id, (*dev->dev_ops->eth_dev_priv_dump)(dev, 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)

Should be compared with NULL explicitly as coding standard
says. I can fix it on applying as well.

[snip]
Yuan Wang Oct. 4, 2022, 2:21 a.m. UTC | #2
Hi Andrew,

> -----Original Message-----
> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Sent: Monday, October 3, 2022 3:04 PM
> To: Wang, YuanX <yuanx.wang@intel.com>; dev@dpdk.org; Thomas
> Monjalon <thomas@monjalon.net>; Ferruh Yigit <ferruh.yigit@amd.com>;
> Ray Kinsella <mdr@ashroe.eu>
> Cc: ferruh.yigit@xilinx.com; Li, Xiaoyun <xiaoyun.li@intel.com>; Singh, Aman
> Deep <aman.deep.singh@intel.com>; Zhang, Yuying
> <yuying.zhang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Yang,
> Qiming <qiming.yang@intel.com>; jerinjacobk@gmail.com;
> viacheslavo@nvidia.com; stephen@networkplumber.org; Ding, Xuan
> <xuan.ding@intel.com>; hpothula@marvell.com; Tang, Yaqi
> <yaqi.tang@intel.com>; Wenxuan Wu <wenxuanx.wu@intel.com>
> Subject: Re: [PATCH v7 1/4] ethdev: introduce protocol header API
> 
> On 10/2/22 00:05, Yuan Wang wrote:
> > 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/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                 |  3 +++
> >   5 files changed, 86 insertions(+)
> >
> > diff --git a/doc/guides/rel_notes/release_22_11.rst
> > b/doc/guides/rel_notes/release_22_11.rst
> > index 0231959874..6a7474a3d6 100644
> > --- a/doc/guides/rel_notes/release_22_11.rst
> > +++ b/doc/guides/rel_notes/release_22_11.rst
> > @@ -96,6 +96,11 @@ New Features
> >     * Added ``rte_event_eth_tx_adapter_queue_stop`` to stop the Tx
> Adapter
> >       from enqueueing any packets to the Tx queue.
> >
> > +* **Added new ethdev API for PMD to get buffer split supported
> > +protocol types.**
> > +
> > +  * Added ``rte_eth_buffer_split_get_supported_hdr_ptypes()``, to get
> supported
> > +    header protocols of a PMD to split.
> > +
> 
> ethdev features should be grouped together in release notes.
> I'll fix it on applying if a new version is not required.

We will send a new version. For the doc changes, I don't understand your point very well.
Since will be no new changes to the code within this patch, could you help to adjust the doc?
Thanks very much.

> 
> [snip]
> 
> > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index
> > 0c2c1088c0..1f0a7f8f3f 100644
> > --- a/lib/ethdev/rte_ethdev.c
> > +++ b/lib/ethdev/rte_ethdev.c
> > @@ -6002,6 +6002,39 @@ rte_eth_dev_priv_dump(uint16_t port_id, FILE
> *file)
> >   	return eth_err(port_id, (*dev->dev_ops->eth_dev_priv_dump)(dev,
> 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)
> 
> Should be compared with NULL explicitly as coding standard says. I can fix it
> on applying as well.

Sure, I will fix in v8.

> 
> [snip]
Andrew Rybchenko Oct. 4, 2022, 7:52 a.m. UTC | #3
On 10/4/22 05:21, Wang, YuanX wrote:
> Hi Andrew,
> 
>> -----Original Message-----
>> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
>> Sent: Monday, October 3, 2022 3:04 PM
>> To: Wang, YuanX <yuanx.wang@intel.com>; dev@dpdk.org; Thomas
>> Monjalon <thomas@monjalon.net>; Ferruh Yigit <ferruh.yigit@amd.com>;
>> Ray Kinsella <mdr@ashroe.eu>
>> Cc: ferruh.yigit@xilinx.com; Li, Xiaoyun <xiaoyun.li@intel.com>; Singh, Aman
>> Deep <aman.deep.singh@intel.com>; Zhang, Yuying
>> <yuying.zhang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Yang,
>> Qiming <qiming.yang@intel.com>; jerinjacobk@gmail.com;
>> viacheslavo@nvidia.com; stephen@networkplumber.org; Ding, Xuan
>> <xuan.ding@intel.com>; hpothula@marvell.com; Tang, Yaqi
>> <yaqi.tang@intel.com>; Wenxuan Wu <wenxuanx.wu@intel.com>
>> Subject: Re: [PATCH v7 1/4] ethdev: introduce protocol header API
>>
>> On 10/2/22 00:05, Yuan Wang wrote:
>>> 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/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                 |  3 +++
>>>    5 files changed, 86 insertions(+)
>>>
>>> diff --git a/doc/guides/rel_notes/release_22_11.rst
>>> b/doc/guides/rel_notes/release_22_11.rst
>>> index 0231959874..6a7474a3d6 100644
>>> --- a/doc/guides/rel_notes/release_22_11.rst
>>> +++ b/doc/guides/rel_notes/release_22_11.rst
>>> @@ -96,6 +96,11 @@ New Features
>>>      * Added ``rte_event_eth_tx_adapter_queue_stop`` to stop the Tx
>> Adapter
>>>        from enqueueing any packets to the Tx queue.
>>>
>>> +* **Added new ethdev API for PMD to get buffer split supported
>>> +protocol types.**
>>> +
>>> +  * Added ``rte_eth_buffer_split_get_supported_hdr_ptypes()``, to get
>> supported
>>> +    header protocols of a PMD to split.
>>> +
>>
>> ethdev features should be grouped together in release notes.
>> I'll fix it on applying if a new version is not required.
> 
> We will send a new version. For the doc changes, I don't understand your point very well.
> Since will be no new changes to the code within this patch, could you help to adjust the doc?
> Thanks very much.

Please, read a comment just after 'New Features' section start.
Hopefully it will make my note clearer.
Anyway, don't worry about it a lot. I can easily fix it on
applying.

> 
>>
>> [snip]
>>
>>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index
>>> 0c2c1088c0..1f0a7f8f3f 100644
>>> --- a/lib/ethdev/rte_ethdev.c
>>> +++ b/lib/ethdev/rte_ethdev.c
>>> @@ -6002,6 +6002,39 @@ rte_eth_dev_priv_dump(uint16_t port_id, FILE
>> *file)
>>>    	return eth_err(port_id, (*dev->dev_ops->eth_dev_priv_dump)(dev,
>> 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)
>>
>> Should be compared with NULL explicitly as coding standard says. I can fix it
>> on applying as well.
> 
> Sure, I will fix in v8.
> 
>>
>> [snip]
Yuan Wang Oct. 4, 2022, 3 p.m. UTC | #4
Hi Andrew,

> -----Original Message-----
> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Sent: Tuesday, October 4, 2022 3:53 PM
> To: Wang, YuanX <yuanx.wang@intel.com>; dev@dpdk.org; Thomas
> Monjalon <thomas@monjalon.net>; Ferruh Yigit <ferruh.yigit@amd.com>;
> Ray Kinsella <mdr@ashroe.eu>
> Cc: ferruh.yigit@xilinx.com; Li, Xiaoyun <xiaoyun.li@intel.com>; Singh, Aman
> Deep <aman.deep.singh@intel.com>; Zhang, Yuying
> <yuying.zhang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Yang,
> Qiming <qiming.yang@intel.com>; jerinjacobk@gmail.com;
> viacheslavo@nvidia.com; stephen@networkplumber.org; Ding, Xuan
> <xuan.ding@intel.com>; hpothula@marvell.com; Tang, Yaqi
> <yaqi.tang@intel.com>; Wenxuan Wu <wenxuanx.wu@intel.com>
> Subject: Re: [PATCH v7 1/4] ethdev: introduce protocol header API
> 
> On 10/4/22 05:21, Wang, YuanX wrote:
> > Hi Andrew,
> >
> >> -----Original Message-----
> >> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> >> Sent: Monday, October 3, 2022 3:04 PM
> >> To: Wang, YuanX <yuanx.wang@intel.com>; dev@dpdk.org; Thomas
> Monjalon
> >> <thomas@monjalon.net>; Ferruh Yigit <ferruh.yigit@amd.com>; Ray
> >> Kinsella <mdr@ashroe.eu>
> >> Cc: ferruh.yigit@xilinx.com; Li, Xiaoyun <xiaoyun.li@intel.com>;
> >> Singh, Aman Deep <aman.deep.singh@intel.com>; Zhang, Yuying
> >> <yuying.zhang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Yang,
> >> Qiming <qiming.yang@intel.com>; jerinjacobk@gmail.com;
> >> viacheslavo@nvidia.com; stephen@networkplumber.org; Ding, Xuan
> >> <xuan.ding@intel.com>; hpothula@marvell.com; Tang, Yaqi
> >> <yaqi.tang@intel.com>; Wenxuan Wu <wenxuanx.wu@intel.com>
> >> Subject: Re: [PATCH v7 1/4] ethdev: introduce protocol header API
> >>
> >> On 10/2/22 00:05, Yuan Wang wrote:
> >>> 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/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                 |  3 +++
> >>>    5 files changed, 86 insertions(+)
> >>>
> >>> diff --git a/doc/guides/rel_notes/release_22_11.rst
> >>> b/doc/guides/rel_notes/release_22_11.rst
> >>> index 0231959874..6a7474a3d6 100644
> >>> --- a/doc/guides/rel_notes/release_22_11.rst
> >>> +++ b/doc/guides/rel_notes/release_22_11.rst
> >>> @@ -96,6 +96,11 @@ New Features
> >>>      * Added ``rte_event_eth_tx_adapter_queue_stop`` to stop the Tx
> >> Adapter
> >>>        from enqueueing any packets to the Tx queue.
> >>>
> >>> +* **Added new ethdev API for PMD to get buffer split supported
> >>> +protocol types.**
> >>> +
> >>> +  * Added ``rte_eth_buffer_split_get_supported_hdr_ptypes()``, to
> >>> + get
> >> supported
> >>> +    header protocols of a PMD to split.
> >>> +
> >>
> >> ethdev features should be grouped together in release notes.
> >> I'll fix it on applying if a new version is not required.
> >
> > We will send a new version. For the doc changes, I don't understand your
> point very well.
> > Since will be no new changes to the code within this patch, could you help
> to adjust the doc?
> > Thanks very much.
> 
> Please, read a comment just after 'New Features' section start.
> Hopefully it will make my note clearer.
> Anyway, don't worry about it a lot. I can easily fix it on applying.

Is it written like the following, if it is not correct please help to fix.

* **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.
  * Ethdev: The ``reserved`` field in the ``rte_eth_rxseg_split`` structure is
    replaced with ``proto_hdr`` to support protocol header based buffer split.
    User can choose length or protocol header to configure buffer split
    according to NIC's capability.

Thanks,
Yuan

 [snip]
diff mbox series

Patch

diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst
index 0231959874..6a7474a3d6 100644
--- a/doc/guides/rel_notes/release_22_11.rst
+++ b/doc/guides/rel_notes/release_22_11.rst
@@ -96,6 +96,11 @@  New Features
   * Added ``rte_event_eth_tx_adapter_queue_stop`` to stop the Tx Adapter
     from enqueueing any packets to the Tx queue.
 
+* **Added new ethdev API for PMD to get buffer split supported protocol types.**
+
+  * 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 8cd8eb8685..791b264610 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.
@@ -1302,6 +1314,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 0c2c1088c0..1f0a7f8f3f 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -6002,6 +6002,39 @@  rte_eth_dev_priv_dump(uint16_t port_id, FILE *file)
 	return eth_err(port_id, (*dev->dev_ops->eth_dev_priv_dump)(dev, 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)
+		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 12535c703e..cf14e04010 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -6017,6 +6017,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 25e54f9d3e..50f5814a48 100644
--- a/lib/ethdev/version.map
+++ b/lib/ethdev/version.map
@@ -285,6 +285,9 @@  EXPERIMENTAL {
 	rte_mtr_color_in_protocol_priority_get;
 	rte_mtr_color_in_protocol_set;
 	rte_mtr_meter_vlan_table_update;
+
+	# added in 22.11
+	rte_eth_buffer_split_get_supported_hdr_ptypes;
 };
 
 INTERNAL {