Allow for non-standard dataroom sizes for upstream data motion when using a custom mbuf pool.
- New firmware version for UDM (Upstream Data Mover) - New layout on ark_rx_meta data Signed-off-by: Ed Czeck <ed.cz...@atomicrules.com> --- doc/guides/nics/ark.rst | 1 + drivers/net/ark/ark_ethdev_rx.c | 8 ++++++++ drivers/net/ark/ark_ext.h | 9 +++++++++ drivers/net/ark/ark_udm.h | 5 +++-- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/doc/guides/nics/ark.rst b/doc/guides/nics/ark.rst index e1683cf782..bcc9f505df 100644 --- a/doc/guides/nics/ark.rst +++ b/doc/guides/nics/ark.rst @@ -334,6 +334,7 @@ with Arkville releases 21.05, 21.08 and 21.11. LTS versions of DPDK remain compatible with the corresponding Arkville version. If other combinations are required, please contact Atomic Rules support. +* DPDK 23.11 requires Arkville 23.11. * DPDK 22.07 requires Arkville 22.07. * DPDK 22.03 requires Arkville 22.03. * DPDK 21.05 requires Arkville 21.05. diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c index 38bc69dff4..24f1c65690 100644 --- a/drivers/net/ark/ark_ethdev_rx.c +++ b/drivers/net/ark/ark_ethdev_rx.c @@ -9,6 +9,7 @@ #include "ark_logs.h" #include "ark_mpu.h" #include "ark_udm.h" +#include "ark_ext.h" #define ARK_RX_META_SIZE 32 #define ARK_RX_META_OFFSET (RTE_PKTMBUF_HEADROOM - ARK_RX_META_SIZE) @@ -166,6 +167,13 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev, queue->mb_pool = mb_pool; queue->dataroom = rte_pktmbuf_data_room_size(mb_pool) - RTE_PKTMBUF_HEADROOM; + + /* Check pool's private data to confirm pool structure */ + if (mb_pool->private_data_size != 0) { + struct rte_pmd_ark_lmbuf_mempool_priv *pool_priv = rte_mempool_get_priv(mb_pool); + if (strncmp(pool_priv->cookie, ARK_MEMPOOL_COOKIE, sizeof(pool_priv->cookie)) == 0) + queue->dataroom = pool_priv->dataroom; + } queue->headroom = RTE_PKTMBUF_HEADROOM; queue->phys_qid = qidx; queue->queue_index = queue_idx; diff --git a/drivers/net/ark/ark_ext.h b/drivers/net/ark/ark_ext.h index d235d0ff85..6d37449195 100644 --- a/drivers/net/ark/ark_ext.h +++ b/drivers/net/ark/ark_ext.h @@ -5,6 +5,7 @@ #ifndef _ARK_EXT_H_ #define _ARK_EXT_H_ +#include <rte_mbuf.h> #include <ethdev_driver.h> /* The following section lists function prototypes for Arkville's @@ -16,6 +17,14 @@ * See documentation for compiling and use of extensions. */ +/* private data optionally attached to mempool for rx */ +struct rte_pmd_ark_lmbuf_mempool_priv { + struct rte_pktmbuf_pool_private pool_private; + char cookie[4]; + uint32_t dataroom; +}; +#define ARK_MEMPOOL_COOKIE "ARK1" + /** * Extension prototype, required implementation if extensions are used. * Called during device probe to initialize the user structure diff --git a/drivers/net/ark/ark_udm.h b/drivers/net/ark/ark_udm.h index f0685c95c7..ec53ec7e79 100644 --- a/drivers/net/ark/ark_udm.h +++ b/drivers/net/ark/ark_udm.h @@ -20,7 +20,8 @@ */ struct ark_rx_meta { uint32_t user_meta[5]; /* user defined based on fpga code */ - uint8_t reserved[10]; + uint32_t pkt_len32; + uint8_t reserved[6]; uint16_t pkt_len; } __rte_packed; @@ -33,7 +34,7 @@ struct ark_rx_meta { #define ARK_RX_WRITE_TIME_NS 2500 #define ARK_UDM_SETUP 0 #define ARK_UDM_MODID 0x4d445500 -#define ARK_UDM_MODVER 0x37313232 +#define ARK_UDM_MODVER 0x37333332 struct ark_udm_setup_t { union { -- 2.34.1