1 /* SPDX-License-Identifier: BSD-3-Clause
3 * Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved.
4 * Copyright 2016-2019 NXP
8 #ifndef _DPAA2_HW_DPBP_H_
9 #define _DPAA2_HW_DPBP_H_
11 #define DPAA2_MAX_BUF_POOLS 8
15 /**< The address from where DPAA2 will carve out the buffers */
17 /**< Physical address of the memory provided in addr */
19 /**< Number of buffers */
21 /**< Size including headroom for each buffer */
23 /**< Buffer alignment (in bytes) */
25 /**< Autogenerated buffer pool ID for internal use */
29 uint32_t size; /**< Size of the Pool */
30 uint32_t num_bufs; /**< Number of buffers in Pool */
31 uint16_t bpid; /**< Pool ID, from pool configuration */
32 uint8_t *h_bpool_mem; /**< Internal context data */
33 struct dpaa2_dpbp_dev *dpbp_node; /**< Hardware context */
37 * Buffer pool list configuration structure. User need to give DPAA2 the
38 * valid number of 'num_buf_pools'.
40 struct dpaa2_bp_list_cfg {
41 struct buf_pool_cfg buf_pool; /* Configuration of each buffer pool*/
44 struct dpaa2_bp_list {
45 struct dpaa2_bp_list *next;
46 struct rte_mempool *mp; /**< DPDK RTE EAL pool reference */
47 int32_t dpaa2_ops_index; /**< Index into DPDK Mempool ops table */
48 struct buf_pool buf_pool;
51 struct dpaa2_bp_info {
52 uint32_t meta_data_size;
54 struct dpaa2_bp_list *bp_list;
57 #define mempool_to_bpinfo(mp) ((struct dpaa2_bp_info *)(mp)->pool_data)
58 #define mempool_to_bpid(mp) ((mempool_to_bpinfo(mp))->bpid)
60 extern struct dpaa2_bp_info *rte_dpaa2_bpid_info;
63 int rte_dpaa2_mbuf_alloc_bulk(struct rte_mempool *pool,
64 void **obj_table, unsigned int count);
66 #endif /* _DPAA2_HW_DPBP_H_ */