cosq.h (6278B)
1 /* 2 * 3 * 4 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 5 * 6 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 7 * 8 * DO NOT EDIT THIS FILE! 9 * This file is auto-generated. 10 * Edits to this file will be lost when it is regenerated. 11 */ 12 13 #ifndef __BCMX_COSQ_H__ 14 #define __BCMX_COSQ_H__ 15 16 #include <bcm/types.h> 17 #include <bcmx/bcmx.h> 18 #include <bcmx/lplist.h> 19 #include <bcm/cosq.h> 20 21 typedef bcm_cosq_gport_discard_t bcmx_cosq_gport_discard_t; 22 23 /* Structure initializer */ 24 extern void bcmx_cosq_gport_discard_t_init( 25 bcmx_cosq_gport_discard_t *discard); 26 27 /* Initialize the COSQ subsystem. */ 28 extern int bcmx_cosq_init(void); 29 30 /* De-initialize the COSQ subsystem. */ 31 extern int bcmx_cosq_detach(void); 32 33 /* Configure the number of Class of Service Queues (COSQs). */ 34 extern int bcmx_cosq_config_set( 35 int numq); 36 37 /* Get the number of Class of Service Queues (COSQs). */ 38 extern int bcmx_cosq_config_get( 39 int *numq); 40 41 /* Set the mapping from internal priority to COS queue. */ 42 extern int bcmx_cosq_mapping_set( 43 bcm_cos_t priority, 44 bcm_cos_queue_t cosq); 45 46 /* Get the mapping from internal priority to COS queue. */ 47 extern int bcmx_cosq_mapping_get( 48 bcm_cos_t priority, 49 bcm_cos_queue_t *cosq); 50 51 /* Set the mapping from internal priority to COS queue. */ 52 extern int bcmx_cosq_port_mapping_set( 53 bcmx_lport_t port, 54 bcm_cos_t priority, 55 bcm_cos_queue_t cosq); 56 57 /* Get the mapping from internal priority to COS queue. */ 58 extern int bcmx_cosq_port_mapping_get( 59 bcmx_lport_t port, 60 bcm_cos_t priority, 61 bcm_cos_queue_t *cosq); 62 63 /* Set Class of Service policy, weights and delay. */ 64 extern int bcmx_cosq_sched_set( 65 int mode, 66 const int weights[BCM_COS_COUNT], 67 int delay); 68 69 /* Set Class of Service policy, weights and delay. */ 70 extern int bcmx_cosq_port_sched_set( 71 bcmx_lplist_t lplist, 72 int mode, 73 const int weights[BCM_COS_COUNT], 74 int delay); 75 76 /* Get Class of Service policy, weights and delay. */ 77 extern int bcmx_cosq_sched_get( 78 int *mode, 79 int weights[BCM_COS_COUNT], 80 int *delay); 81 82 /* Get Class of Service policy, weights and delay. */ 83 extern int bcmx_cosq_port_sched_get( 84 bcmx_lplist_t lplist, 85 int *mode, 86 int weights[BCM_COS_COUNT], 87 int *delay); 88 89 /* Retrieve maximum weights for given COS policy. */ 90 extern int bcmx_cosq_sched_weight_max_get( 91 int mode, 92 int *weight_max); 93 94 /* Configure a port bandwidth distribution among COS queues. */ 95 extern int bcmx_cosq_port_bandwidth_set( 96 bcmx_lport_t port, 97 bcm_cos_queue_t cosq, 98 uint32 kbits_sec_min, 99 uint32 kbits_sec_max, 100 uint32 flags); 101 102 /* Configure a port bandwidth distribution among COS queues. */ 103 extern int bcmx_cosq_port_bandwidth_get( 104 bcmx_lport_t port, 105 bcm_cos_queue_t cosq, 106 uint32 *kbits_sec_min, 107 uint32 *kbits_sec_max, 108 uint32 *flags); 109 110 /* Configure Weighted Random Early Discard (WRED). */ 111 extern int bcmx_cosq_discard_set( 112 uint32 flags); 113 114 /* Configure Weighted Random Early Discard (WRED). */ 115 extern int bcmx_cosq_discard_get( 116 uint32 *flags); 117 118 /* Configure a port's Weighted Random Early Discard (WRED) parameters. */ 119 extern int bcmx_cosq_discard_port_set( 120 bcmx_lport_t port, 121 bcm_cos_queue_t cosq, 122 uint32 color, 123 int drop_start, 124 int drop_slope, 125 int average_time); 126 127 /* Get a port's Weighted Random Early Discard (WRED) parameters. */ 128 extern int bcmx_cosq_discard_port_get( 129 bcmx_lport_t port, 130 bcm_cos_queue_t cosq, 131 uint32 color, 132 int *drop_start, 133 int *drop_slope, 134 int *average_time); 135 136 /* Set various features at the gport/cosq level. */ 137 extern int bcmx_cosq_control_set( 138 bcm_gport_t port, 139 bcm_cos_queue_t cosq, 140 bcm_cosq_control_t type, 141 int arg); 142 143 /* Get various features at the gport/cosq level. */ 144 extern int bcmx_cosq_control_get( 145 bcm_gport_t port, 146 bcm_cos_queue_t cosq, 147 bcm_cosq_control_t type, 148 int *arg); 149 150 extern int bcmx_cosq_gport_add( 151 bcm_gport_t port, 152 int numq, 153 uint32 flags, 154 bcm_gport_t *gport); 155 156 extern int bcmx_cosq_gport_delete( 157 bcm_gport_t gport); 158 159 extern int bcmx_cosq_gport_bandwidth_set( 160 bcm_gport_t gport, 161 bcm_cos_queue_t cosq, 162 uint32 kbits_sec_min, 163 uint32 kbits_sec_max, 164 uint32 flags); 165 166 extern int bcmx_cosq_gport_bandwidth_get( 167 bcm_gport_t gport, 168 bcm_cos_queue_t cosq, 169 uint32 *kbits_sec_min, 170 uint32 *kbits_sec_max, 171 uint32 *flags); 172 173 extern int bcmx_cosq_gport_sched_set( 174 bcm_gport_t gport, 175 bcm_cos_queue_t cosq, 176 int mode, 177 int weight); 178 179 extern int bcmx_cosq_gport_sched_get( 180 bcm_gport_t gport, 181 bcm_cos_queue_t cosq, 182 int *mode, 183 int *weight); 184 185 extern int bcmx_cosq_gport_discard_set( 186 bcm_gport_t gport, 187 bcm_cos_queue_t cosq, 188 bcmx_cosq_gport_discard_t *discard); 189 190 extern int bcmx_cosq_gport_discard_get( 191 bcm_gport_t gport, 192 bcm_cos_queue_t cosq, 193 bcmx_cosq_gport_discard_t *discard); 194 195 extern int bcmx_cosq_gport_attach( 196 bcm_gport_t sched_port, 197 bcm_gport_t input_port, 198 bcm_cos_queue_t cosq); 199 200 extern int bcmx_cosq_gport_detach( 201 bcm_gport_t sched_port, 202 bcm_gport_t input_port, 203 bcm_cos_queue_t cosq); 204 205 extern int bcmx_cosq_gport_attach_get( 206 bcm_gport_t sched_port, 207 bcm_gport_t *input_port, 208 bcm_cos_queue_t *cosq); 209 210 extern int bcmx_cosq_gport_destmod_attach( 211 bcm_gport_t gport, 212 bcm_gport_t ingress_port, 213 bcm_module_t dest_modid, 214 int fabric_egress_port); 215 216 extern int bcmx_cosq_gport_destmod_detach( 217 bcm_gport_t gport, 218 bcm_gport_t ingress_port, 219 bcm_module_t dest_modid, 220 int fabric_egress_port); 221 222 extern int bcmx_cosq_stat_get( 223 bcm_gport_t gport, 224 bcm_cos_queue_t cosq, 225 bcm_cosq_stat_t stat, 226 uint64 *value); 227 228 extern int bcmx_cosq_stat_get32( 229 bcm_gport_t gport, 230 bcm_cos_queue_t cosq, 231 bcm_cosq_stat_t stat, 232 uint32 *value); 233 234 extern int bcmx_cosq_stat_set( 235 bcm_gport_t gport, 236 bcm_cos_queue_t cosq, 237 bcm_cosq_stat_t stat, 238 uint64 value); 239 240 extern int bcmx_cosq_stat_set32( 241 bcm_gport_t gport, 242 bcm_cos_queue_t cosq, 243 bcm_cosq_stat_t stat, 244 uint32 value); 245 246 #endif /* __BCMX_COSQ_H__ */