xref: /dpdk/drivers/common/iavf/iavf_alloc.h (revision 7815caa653bd47837eaaa876d78ba88cbe19e5b9)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2001-2021 Intel Corporation
3  */
4 
5 #ifndef _IAVF_ALLOC_H_
6 #define _IAVF_ALLOC_H_
7 
8 struct iavf_hw;
9 
10 /* Memory allocation types */
11 enum iavf_memory_type {
12 	iavf_mem_arq_buf = 0,		/* ARQ indirect command buffer */
13 	iavf_mem_asq_buf = 1,
14 	iavf_mem_atq_buf = 2,		/* ATQ indirect command buffer */
15 	iavf_mem_arq_ring = 3,		/* ARQ descriptor ring */
16 	iavf_mem_atq_ring = 4,		/* ATQ descriptor ring */
17 	iavf_mem_pd = 5,		/* Page Descriptor */
18 	iavf_mem_bp = 6,		/* Backing Page - 4KB */
19 	iavf_mem_bp_jumbo = 7,		/* Backing Page - > 4KB */
20 	iavf_mem_reserved
21 };
22 
23 /* prototype for functions used for dynamic memory allocation */
24 enum iavf_status iavf_allocate_dma_mem(struct iavf_hw *hw,
25 				       struct iavf_dma_mem *mem,
26 				       enum iavf_memory_type type,
27 				       u64 size, u32 alignment);
28 enum iavf_status iavf_free_dma_mem(struct iavf_hw *hw,
29 				   struct iavf_dma_mem *mem);
30 enum iavf_status iavf_allocate_virt_mem(struct iavf_hw *hw,
31 					struct iavf_virt_mem *mem,
32 					u32 size);
33 enum iavf_status iavf_free_virt_mem(struct iavf_hw *hw,
34 				    struct iavf_virt_mem *mem);
35 
36 #endif /* _IAVF_ALLOC_H_ */
37