gsa_api_multicast2.h (9269B)
1 /* 2 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 3 * 4 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 5 */ 6 7 8 #ifndef __GSA_API_MULTICAST_INCLUDED__ 9 /* { */ 10 #define __GSA_API_MULTICAST_INCLUDED__ 11 12 /************* 13 * INCLUDES * 14 */ 15 /* { */ 16 #include <soc/dpp/SAND/Utils/sand_header.h> 17 18 #include "gsa_framework.h" 19 20 /* } */ 21 /************* 22 * DEFINES * 23 */ 24 /* { */ 25 26 27 /* } */ 28 29 /************* 30 * MACROS * 31 */ 32 /* { */ 33 34 /* } */ 35 36 /************* 37 * TYPE DEFS * 38 */ 39 /* { */ 40 41 42 43 typedef enum 44 { 45 /* 46 * Egress + Ingress multicast, based on pre-defined policy. 47 */ 48 GSA_P_MC_TYPE_ALL_AUTO=0, 49 /* 50 * Egress multicast, based on pre-defined policy. 51 */ 52 GSA_P_MC_TYPE_EGR_AUTO=1, 53 /* 54 * Egress multicast, VLAN membership replication (set of 55 * system ports). 56 */ 57 GSA_P_MC_TYPE_EGR_VLAN=2, 58 /* 59 * Egress multicast, General replication (set of system 60 * ports + Copy-Unique-Data). 61 */ 62 GSA_P_MC_TYPE_EGR_GEN=3, 63 /* 64 * Ingress multicast, based on pre-defined policy. 65 */ 66 GSA_P_MC_TYPE_INGR_AUTO=4, 67 /* 68 * Ingress multicast, Device-Level-Scheduled (set of 69 * destination FAP-s). 70 */ 71 GSA_P_MC_TYPE_INGR_DEV_SCHED=5, 72 /* 73 * Ingress multicast, Device-Level-Scheduled (set of 74 * destination system ports). 75 */ 76 GSA_P_MC_TYPE_INGR_PORT_SCHED=6, 77 /* 78 * Fabric multicast, not scheduled by the egress. 79 */ 80 GSA_P_MC_TYPE_INGR_FABRIC=7, 81 /* 82 * Total number of Multicast types. 83 */ 84 GSA_P_NOF_MC_TYPES=8, 85 }GSA_MC_TYPE; 86 87 typedef enum 88 { 89 /* 90 * System Physical FAP Port.Matching Index Range: 0 4095. 91 */ 92 GSA_DEST_SYS_PORT_TYPE_SYS_PHY_PORT=0, 93 /* 94 * System LAG Id. Matching Index Range: 0 255. 95 */ 96 GSA_DEST_SYS_PORT_TYPE_LAG=1, 97 /* 98 * Total number of system-ports types. 99 */ 100 GSA_DEST_SYS_PORT_NOF_TYPES=2, 101 }GSA_DEST_SYS_PORT_TYPE; 102 103 104 typedef struct 105 { 106 SOC_SAND_MAGIC_NUM_VAR 107 /* 108 * LAG id or system-physical-port id. 109 */ 110 GSA_DEST_SYS_PORT_TYPE type; 111 /* 112 * According to the System-Port type, one of the 113 * following:LAG id. Range: 0 255.System Physical Port. 114 * Range: 0 4K-1. 115 */ 116 uint32 id; 117 }GSA_DEST_SYS_PORT_INFO; 118 119 /* } */ 120 121 /************* 122 * GLOBALS * 123 */ 124 /* { */ 125 126 /* } */ 127 128 /************* 129 * FUNCTIONS * 130 */ 131 /* { */ 132 133 134 /********************************************************************* 135 * NAME: 136 * gsa_mc_grp_open 137 * TYPE: 138 * PROC 139 * FUNCTION: 140 * Open Multicast Group. 141 * INPUT: 142 * SOC_SAND_IN int unit - 143 * Identifier of the device to access. 144 * SOC_SAND_IN uint32 mc_id - 145 * The index of the multicast group to open. Range: 0 - 146 * 16K-1. 147 * SOC_SAND_IN GSA_MC_TYPE mc_type - 148 * The type of the multicast to open. 149 * SOC_SAND_IN uint32 mc_grp_size - 150 * The number of members in the multicast group. 151 * SOC_SAND_IN GSA_DEST_SYS_PORT_INFO *mc_grp_members - 152 * A list of multicast group members; Destination Physical 153 * System Ports. The size of the array is mc_grp_size. 154 * Note: for GSA_P_MC_TYPE_INGR_FABRIC, this field is 155 * ignored and may be set to NULL. 156 * SOC_SAND_IN uint32 *per_member_cud - 157 * If applicable (e.g. for GSA_P_MC_TYPE_EGR_GEN multicast 158 * type) - the Copy-Unique-Data to embed into the OTMH 159 * outlif field. Note: for Ethernet Ports, this field is 160 * interpreted as the ARP pointer. For MC types that don't 161 * need the CUD information, this field is ignored, and may 162 * be set to NULL. 163 * REMARKS: 164 * 1. In case the MC group can not be opened due to 165 * insufficient memory, the API returns error. 2. If the MC 166 * group with the specified MC index already exists, it is 167 * updated to the specified member list. 168 * RETURNS: 169 * OK or ERROR indication. 170 */ 171 172 uint32 173 gsa_mc_grp_open( 174 SOC_SAND_IN uint32 mc_id, 175 SOC_SAND_IN GSA_MC_TYPE mc_type, 176 SOC_SAND_IN uint32 mc_grp_size, 177 SOC_SAND_IN GSA_DEST_SYS_PORT_INFO *mc_grp_members, 178 SOC_SAND_IN uint32 *per_member_cud 179 ); 180 181 /********************************************************************* 182 * NAME: 183 * gsa_mc_grp_close 184 * TYPE: 185 * PROC 186 * FUNCTION: 187 * Close a Multicast Group if exists. 188 * INPUT: 189 * SOC_SAND_IN int unit - 190 * Identifier of the device to access. 191 * SOC_SAND_IN GSA_MC_TYPE mc_type - 192 * SOC_SAND_IN GSA_P_MC_TYPE mc_type 193 * SOC_SAND_IN uint32 mc_id - 194 * The index of the multicast group to close. Range: 0 - 195 * 16K-1. SOC_SAND_IN GSA_P_MC_TYPE mc_type - The type of the 196 * multicast to close. 197 * REMARKS: 198 * None. 199 * RETURNS: 200 * OK or ERROR indication. 201 */ 202 203 uint32 204 gsa_mc_grp_close( 205 SOC_SAND_IN GSA_MC_TYPE mc_type, 206 SOC_SAND_IN uint32 mc_id 207 ); 208 209 /********************************************************************* 210 * NAME: 211 * gsa_mc_grp_get 212 * TYPE: 213 * PROC 214 * FUNCTION: 215 * Open Multicast Group. 216 * INPUT: 217 * SOC_SAND_IN int unit - 218 * Identifier of the device to access. 219 * SOC_SAND_IN uint32 mc_id - 220 * The index of the multicast group to open. Range: 0 - 221 * 16K-1. 222 * SOC_SAND_IN GSA_MC_TYPE mc_type - 223 * The type of the multicast to open. 224 * SOC_SAND_OUT GSA_DEST_SYS_PORT_INFO *mc_grp_members - 225 * The list of multicast group members; Destination 226 * Physical System Ports. The size of the array is 227 * exact_mc_grp_size. Note: for SWP_P_MC_TYPE_INGR_FABRIC, 228 * this field is ignored and is set to NULL. 229 * SOC_SAND_OUT uint32 *per_member_cud - 230 * If applicable (e.g. for SWP_P_MC_TYPE_EGR_GEN multicast 231 * type) - the Copy-Unique-Data to embed into the OTMH 232 * outlif field. Note: for Ethernet Ports, this field is 233 * interpreted as the ARP pointer. For MC types that don't 234 * need the CUD information, this field is ignored, and is 235 * set to NULL. 236 * SOC_SAND_OUT uint32 *exact_mc_grp_size - 237 * The actual number of members in the multicast group. 238 * SOC_SAND_OUT uint8 *is_open - 239 * The parameter indicates whether the group is open and 240 * can be retrieved. 241 * REMARKS: 242 * Except the ingress fully scheduled type, it gets the 243 * egress multicast group accordingly to the policy. 244 * RETURNS: 245 * OK or ERROR indication. 246 */ 247 248 uint32 249 gsa_mc_grp_get( 250 SOC_SAND_IN uint32 mc_id, 251 SOC_SAND_IN GSA_MC_TYPE mc_type, 252 SOC_SAND_OUT GSA_DEST_SYS_PORT_INFO *mc_grp_members, 253 SOC_SAND_OUT uint32 *per_member_cud, 254 SOC_SAND_OUT uint32 *exact_mc_grp_size, 255 SOC_SAND_OUT uint8 *is_open 256 ); 257 258 uint32 259 gsa_mc_grp_get_size( 260 SOC_SAND_IN uint32 mc_id, 261 SOC_SAND_IN GSA_MC_TYPE mc_type, 262 SOC_SAND_OUT uint32 *mc_grp_size 263 ); 264 265 266 #if GSA_DEBUG 267 268 269 const char* 270 swp_p_GSA_MC_TYPE_to_string( 271 SOC_SAND_IN GSA_MC_TYPE enum_val 272 ); 273 274 void 275 gsa_GSA_DEST_SYS_PORT_INFO_print( 276 SOC_SAND_IN GSA_DEST_SYS_PORT_INFO *info 277 ); 278 279 280 void 281 gsa_GSA_DEST_SYS_PORT_INFO_table_format_print( 282 SOC_SAND_IN GSA_DEST_SYS_PORT_INFO *info 283 ); 284 285 #endif /* GSA_DEBUG */ 286 287 void 288 gsa_MC_TYPE_to_swp_p( 289 SOC_SAND_IN GSA_MC_TYPE mc_type, 290 SOC_SAND_OUT SWP_P_MC_TYPE *swp_p_mc_type 291 ); 292 293 void 294 gsa_GSA_DEST_SYS_PORT_INFO_clear( 295 SOC_SAND_OUT GSA_DEST_SYS_PORT_INFO *info 296 ); 297 298 void 299 gsa_DEST_SYS_PORT_INFO_to_petra( 300 SOC_SAND_IN GSA_DEST_SYS_PORT_INFO *info, 301 SOC_SAND_OUT SOC_PETRA_DEST_SYS_PORT_INFO *soc_petra_info 302 ); 303 304 void 305 gsa_DEST_SYS_PORT_INFO_from_petra( 306 SOC_SAND_IN SOC_PETRA_DEST_SYS_PORT_INFO *soc_petra_info, 307 SOC_SAND_OUT GSA_DEST_SYS_PORT_INFO *info 308 ); 309 310 uint32 311 gsa_petra_api_multicast_group_print( 312 SOC_SAND_IN int unit, 313 SOC_SAND_IN uint32 mc_id, 314 SOC_SAND_IN GSA_MC_TYPE mc_type 315 ); 316 317 /* } */ 318 319 #include <soc/dpp/SAND/Utils/sand_footer.h> 320 321 /* } __GSA_API_MULTICAST2_INCLUDED__*/ 322 #endif