1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright 2018 NXP 3 */ 4 5 #ifndef _RTE_MBUF_POOL_OPS_H_ 6 #define _RTE_MBUF_POOL_OPS_H_ 7 8 /** 9 * @file 10 * RTE Mbuf Pool Ops 11 * 12 * These APIs are for configuring the mbuf pool ops names to be largely used by 13 * rte_pktmbuf_pool_create(). However, this can also be used to set and inquire 14 * the best mempool ops available. 15 */ 16 17 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 22 /** 23 * Set the platform supported pktmbuf HW mempool ops name 24 * 25 * This function allow the HW to register the actively supported HW mempool 26 * ops_name. Only one HW mempool ops can be registered at any point of time. 27 * 28 * @param ops_name 29 * @return 30 * - On success, zero. 31 * - On failure, a negative value. 32 */ 33 int 34 rte_mbuf_set_platform_mempool_ops(const char *ops_name); 35 36 /** 37 * Get configured platform supported pktmbuf HW mempool ops name 38 * 39 * This function returns the platform supported mempool ops name. 40 * 41 * @return 42 * - On success, platform pool ops name. 43 * - On failure, NULL. 44 */ 45 const char * 46 rte_mbuf_platform_mempool_ops(void); 47 48 /** 49 * Set the user preferred pktmbuf mempool ops name 50 * 51 * This function can be used by the user to configure user preferred 52 * mempool ops name. 53 * 54 * @param ops_name 55 * @return 56 * - On success, zero. 57 * - On failure, a negative value. 58 */ 59 int 60 rte_mbuf_set_user_mempool_ops(const char *ops_name); 61 62 /** 63 * Get user preferred pool ops name for mbuf 64 * 65 * This function returns the user configured mempool ops name. 66 * 67 * @return 68 * - On success, user pool ops name.. 69 * - On failure, NULL. 70 */ 71 const char * 72 rte_mbuf_user_mempool_ops(void); 73 74 /** 75 * Get the best mempool ops name for pktmbuf. 76 * 77 * This function is used to determine the best options for mempool ops for 78 * pktmbuf allocations. Following are the priority order: 79 * 1. User defined, 2. Platform HW supported, 3. Compile time configured. 80 * This function is also used by the rte_pktmbuf_pool_create to get the best 81 * mempool ops name. 82 * 83 * @return 84 * returns preferred mbuf pool ops name 85 */ 86 const char * 87 rte_mbuf_best_mempool_ops(void); 88 89 90 #ifdef __cplusplus 91 } 92 #endif 93 94 #endif /* _RTE_MBUF_POOL_OPS_H_ */ 95