allocator.h (2350B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 6 * 7 * File: allocator.h 8 */ 9 10 #ifndef _BCM_INT_DPP_ALLOCATOR_H_ 11 #define _BCM_INT_DPP_ALLOCATOR_H_ 12 13 #include <bcm/types.h> 14 15 16 /* 17 * Resource types visible to the user 18 */ 19 typedef enum { 20 DPP_USR_RES_FEC_L3, 21 DPP_USR_RES_FEC_L3_MPATH, 22 DPP_USR_RES_FEC_IPMC, 23 DPP_USR_RES_FEC_GLOBAL_GPORT, 24 DPP_USR_RES_FEC_LOCAL_GPORT, 25 DPP_USR_RES_FEC_L2MC, 26 DPP_USR_RES_FEC_MPLS, 27 DPP_USR_RES_FEC_UNICAST, 28 DPP_USR_RES_LIF, 29 DPP_USR_RES_EEP, 30 DPP_USR_RES_IFID, 31 DPP_USR_RES_VRF, 32 DPP_USR_RES_VSI, 33 DPP_USR_RES_FLOW_SE, 34 DPP_USR_RES_FLOW_CONNECTORS, 35 DPP_USR_RES_QUEUES, 36 DPP_USR_RES_MAX 37 } _dpp_usr_res_types_t; 38 39 typedef enum { 40 DPP_HW_RES_FEC = 0, 41 DPP_HW_RES_GLOBAL_GPORT_FEC, 42 DPP_HW_RES_LOCAL_GPORT_FEC, 43 DPP_HW_RES_LIF, 44 DPP_HW_RES_EEP, 45 DPP_HW_RES_IFID, 46 DPP_HW_RES_VRF, 47 DPP_HW_RES_VSI, 48 DPP_HW_RES_PROTECTION, 49 DPP_HW_RES_FLOWS, 50 DPP_HW_RES_QUEUES, 51 DPP_HW_RES_MAX 52 } _dpp_hw_res_t; 53 54 typedef enum { 55 DPP_TABLE_NONE=0, 56 DPP_TABLE_FEC, 57 DPP_TABLE_VSI, 58 DPP_TABLE_LIF, 59 DPP_TABLE_EEP, 60 DPP_TABLE_VRF, 61 DPP_TABLE_PROT, 62 DPP_TABLE_IFID, 63 DPP_TABLE_FLOW, 64 DPP_TABLE_QUEUE, 65 DPP_TABLE_MAX 66 } _dpp_hw_table_t; 67 68 69 /* 70 * Function 71 * _dpp_resource_init 72 * Purpose 73 * Initialize the shr resource manager for all HW resources 74 * for the unit 75 * Parameters 76 * (IN) unit : unit number of the device 77 * Returns 78 * BCM_E_NONE all resources are successfully initialized 79 * BCM_E_* as appropriate otherwise 80 * Notes 81 * Returns error is any of the resources cannot be initialized 82 */ 83 extern int 84 _dpp_resource_init(int unit); 85 86 /* 87 * Function 88 * _dpp_alloc_wellknown_resources 89 * Purpose 90 * Allocate well-known resources per unit 91 * and save the same in the soc structure 92 * for sharing between modules. 93 * 94 * Parameters 95 * (IN) unit : unit number of the device 96 * Returns 97 * BCM_E_NONE - All required resources are allocated 98 * BCM_E_* - failure 99 * Notes 100 */ 101 extern int 102 _dpp_alloc_wellknown_resources(int unit); 103 104 #endif /* _BCM_INT_DPP_ALLOCATOR_H_ */