On 9/2/22 22:10, 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.w...@intel.com>
Signed-off-by: Xuan Ding <xuan.d...@intel.com>
Signed-off-by: Wenxuan Wu <wenxuanx...@intel.com>
Nit below. Other than that:
Reviewed-by: Andrew Rybchenko <andrew.rybche...@oktetlabs.ru>
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 1979dc0850..093c577add 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -5917,6 +5917,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",
Do not split log message across many lines. Too long line is a
less evil which is accepted by checkpatches.
+ port_id);
+ return -EINVAL;
+ }
[snip]