summaryrefslogtreecommitdiffstats
path: root/drivers/mempool/dpaa2/rte_dpaa2_mempool.h
blob: 4a22b7c42ed4cdd1af87f6b1a40d853c2eb91ea8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright 2018 NXP
 */

#ifndef __RTE_DPAA2_MEMPOOL_H__
#define __RTE_DPAA2_MEMPOOL_H__

/**
 * @file
 *
 * NXP specific mempool related functions.
 *
 */

#ifdef __cplusplus
extern "C" {
#endif

#include <rte_mempool.h>

/**
 * Get BPID corresponding to the packet pool
 *
 * @param mp
 *   memory pool
 *
 * @return
 *   BPID of the buffer pool
 */
uint16_t
rte_dpaa2_mbuf_pool_bpid(struct rte_mempool *mp);

/**
 * Get MBUF from the corresponding 'buf_addr'
 *
 * @param mp
 *   memory pool
 * @param buf_addr
 *   The 'buf_addr' of the mbuf. This is the start buffer address
 *   of the packet buffer (mbuf).
 *
 * @return
 *   - MBUF pointer for success
 *   - NULL in case of error
 */
struct rte_mbuf *
rte_dpaa2_mbuf_from_buf_addr(struct rte_mempool *mp, void *buf_addr);

#ifdef __cplusplus
}
#endif

#endif /* __RTE_DPAA2_MEMPOOL_H__ */