pfc.h (2840B)
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-2019 Broadcom Inc. All rights reserved. 6 * 7 * File: pfc.h 8 * Purpose: Declarations for Tomahawk3 PFC SOC functions. 9 */ 10 11 #ifndef _SOC_PFC_H 12 #define _SOC_PFC_H 13 #include <soc/defs.h> 14 #include <soc/types.h> 15 #include <soc/tomahawk3.h> 16 #if defined(BCM_TOMAHAWK3_SUPPORT) 17 #define TH3_PFC_COS_NUM 12 18 #define TH3_PFC_PRIORITY_NUM 8 19 #define TH3_PFC_MMU_QUEUE_NUM 12 20 #define TH3_PFC_RX_PROFILE_NUM_ENTRIES 8 21 22 #define TH3_PFC_PROPERTIES_PROFILE_ID_MIN 0 23 #define TH3_PFC_PROPERTIES_PROFILE_ID_MAX 7 24 #define TH3_PFC_CLASS_PROFILE_ID_MIN 0 25 #define TH3_PFC_CLASS_PROFILE_ID_MAX 7 26 #define SOC_TH3_PFC_BMP_MEMBER(bmp, mber) ((bmp) & (1U << (mber))) 27 #define SOC_TH3_PFC_BMP_ITER(bmp, max_n, mber) \ 28 for((mber) = 0; (mber) < (max_n); (mber)++) \ 29 if (SOC_TH3_PFC_BMP_MEMBER((bmp), (mber))) 30 31 32 typedef struct soc_cosq_pfc_class_map_config_s { 33 uint8 pfc_enable; 34 uint8 pfc_optimized; 35 uint32 cos_list_bmp; 36 } soc_cosq_pfc_class_map_config_t; 37 38 typedef enum soc_th3_pfc_profile_op_e { 39 SOC_TH3_PFC_PROFILE_OP_GET = 0, 40 SOC_TH3_PFC_PROFILE_OP_SET = 1 41 } soc_th3_pfc_pfc_profile_op_t; 42 43 typedef struct soc_cosq_priority_group_properties_s { 44 int priority_group_id; 45 int service_pool_id; 46 int headroom_pool_id; 47 48 } soc_cosq_priority_group_properties_t; 49 50 typedef enum soc_th3_pfc_profile_e { 51 socTH3PFCPGProperties = 0, /* PG properties profile */ 52 socTH3PFCReceiveClass = 1, /* PFC-rx Priority to CoS mapping */ 53 socTH3PFCProfileMax = 2 54 } soc_th3_pfc_profile_t; 55 56 int 57 soc_th3_pfc_pg_profile_op( 58 int unit, 59 int profile_id, 60 int max_count, 61 soc_th3_pfc_pfc_profile_op_t op, 62 int* array_count, 63 soc_cosq_priority_group_properties_t *properties); 64 65 int 66 soc_th3_pfc_tx_priority_mapping_profile_op( 67 int unit, 68 int profile_id, 69 int max_count, 70 soc_th3_pfc_pfc_profile_op_t op, 71 int *array_count, 72 int *pg_array); 73 74 int 75 soc_th3_pfc_num_optimized_group_get( 76 int unit, 77 soc_port_t port, 78 int *num); 79 80 81 int 82 soc_th3_pfc_rx_priority_mapping_profile_get( 83 int unit, 84 int profile_id, 85 int max_count, 86 soc_cosq_pfc_class_map_config_t *config_array, 87 int *count); 88 int 89 soc_th3_pfc_rx_priority_mapping_profile_set( 90 int unit, 91 int profile_id, 92 soc_cosq_pfc_class_map_config_t *config_array, 93 int count); 94 95 int 96 soc_th3_pfc_config_profile_id_set( 97 int unit, 98 soc_port_t port, 99 soc_th3_pfc_profile_t type, 100 uint32 profile_id); 101 102 int 103 soc_th3_pfc_config_profile_id_get( 104 int unit, 105 soc_port_t port, 106 soc_th3_pfc_profile_t type, 107 uint32 *profile_id); 108 109 int 110 soc_th3_pfc_rx_init_from_cfg(int unit); 111 112 int 113 soc_th3_pfc_priority_to_pg_map_init_from_cfg(int unit); 114 #endif 115 #endif 116