vxlan.h (23566B)
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 __BCM_VXLAN_H__ 14 #define __BCM_VXLAN_H__ 15 16 #if defined(INCLUDE_L3) 17 18 #include <bcm/types.h> 19 #include <bcm/l3.h> 20 #include <bcm/tunnel.h> 21 #include <bcm/vlan.h> 22 23 #if defined(INCLUDE_L3) 24 /* BCM_VXLAN_VPN_* flags for VXLAN VPN Create. */ 25 #define BCM_VXLAN_VPN_ELINE 0x00000001 26 #define BCM_VXLAN_VPN_ELAN 0x00000002 27 #define BCM_VXLAN_VPN_WITH_ID 0x00000004 28 #define BCM_VXLAN_VPN_WITH_VPNID 0x00000008 29 #define BCM_VXLAN_VPN_SERVICE_TAGGED 0x00000010 30 #define BCM_VXLAN_VPN_SERVICE_VLAN_ADD 0x00000020 31 #define BCM_VXLAN_VPN_SERVICE_VLAN_REPLACE 0x00000040 32 #define BCM_VXLAN_VPN_SERVICE_VLAN_DELETE 0x00000080 33 #define BCM_VXLAN_VPN_SERVICE_VLAN_TPID_REPLACE 0x00000100 34 #define BCM_VXLAN_VPN_SERVICE_VLAN_PRI_TPID_REPLACE 0x00000200 35 #define BCM_VXLAN_VPN_SERVICE_VLAN_PRI_REPLACE 0x00000400 36 #define BCM_VXLAN_VPN_SERVICE_PRI_REPLACE 0x00000800 37 #define BCM_VXLAN_VPN_SERVICE_TPID_REPLACE 0x00001000 38 #define BCM_VXLAN_VPN_REPLACE 0x00002000 39 #define BCM_VXLAN_VPN_UNKNOWN_UCAST_REPLACE 0x00004000 40 #define BCM_VXLAN_VPN_UNKNOWN_MCAST_REPLACE 0x00008000 41 #define BCM_VXLAN_VPN_BCAST_REPLACE 0x00010000 42 #define BCM_VXLAN_VPN_TUNNEL_BASED_VNID 0x00020000 43 #endif 44 45 #if defined(INCLUDE_L3) 46 /* BCM_VXLAN_MULTICAST_TUNNEL_STATE_BUD_* flags. */ 47 #define BCM_VXLAN_MULTICAST_TUNNEL_STATE_BUD_ENABLE 0x00000001 48 #define BCM_VXLAN_MULTICAST_TUNNEL_STATE_BUD_DISABLE 0x00000002 49 #endif 50 51 #if defined(INCLUDE_L3) 52 /* VXLAN VPN Definitions. */ 53 #define BCM_VXLAN_VPN_INVALID 0xFFFF /* Invalid VXLAN VPN */ 54 #endif 55 56 #if defined(INCLUDE_L3) 57 /* VXLAN VPN Config Structure. */ 58 typedef struct bcm_vxlan_vpn_config_s { 59 uint32 flags; /* BCM_VXLAN_VPN_xxx. */ 60 bcm_vpn_t vpn; /* VXLAN VPN */ 61 uint32 vnid; /* VNID */ 62 uint8 pkt_pri; /* Packet Priority */ 63 uint8 pkt_cfi; /* Packet CFI */ 64 uint16 egress_service_tpid; /* Service TPID */ 65 bcm_vlan_t egress_service_vlan; /* Service VLAN */ 66 bcm_multicast_t broadcast_group; 67 bcm_multicast_t unknown_unicast_group; 68 bcm_multicast_t unknown_multicast_group; 69 bcm_vlan_protocol_packet_ctrl_t protocol_pkt; 70 bcm_vlan_t vlan; /* Outer VLAN */ 71 bcm_gport_t match_port_class; /* local port vlan domain */ 72 bcm_vlan_t default_vlan; /* default vlan for untag payload */ 73 } bcm_vxlan_vpn_config_t; 74 #endif 75 76 #if defined(INCLUDE_L3) 77 /* Initialize VXLAN VPN config structure. */ 78 extern void bcm_vxlan_vpn_config_t_init( 79 bcm_vxlan_vpn_config_t *info); 80 #endif 81 82 #ifndef BCM_HIDE_DISPATCHABLE 83 84 #if defined(INCLUDE_L3) 85 /* Create VXLAN-VPN instance */ 86 extern int bcm_vxlan_vpn_create( 87 int unit, 88 bcm_vxlan_vpn_config_t *info); 89 #endif 90 91 #if defined(INCLUDE_L3) 92 /* Delete VXLAN_VPN Instance */ 93 extern int bcm_vxlan_vpn_destroy( 94 int unit, 95 bcm_vpn_t l2vpn); 96 #endif 97 98 #if defined(INCLUDE_L3) 99 /* Delete all VXLAN-VPN instances */ 100 extern int bcm_vxlan_vpn_destroy_all( 101 int unit); 102 #endif 103 104 #if defined(INCLUDE_L3) 105 /* Get VXLAN-VPN instance by ID */ 106 extern int bcm_vxlan_vpn_get( 107 int unit, 108 bcm_vpn_t l2vpn, 109 bcm_vxlan_vpn_config_t *info); 110 #endif 111 112 #endif /* BCM_HIDE_DISPATCHABLE */ 113 114 /* VXLAN vpn callback function prototype */ 115 #if defined(INCLUDE_L3) 116 typedef int(*bcm_vxlan_vpn_traverse_cb)( 117 int unit, 118 bcm_vxlan_vpn_config_t *info, 119 void *user_data); 120 #endif 121 122 #ifndef BCM_HIDE_DISPATCHABLE 123 124 #if defined(INCLUDE_L3) 125 /* Traverse VXLAN-VPN */ 126 extern int bcm_vxlan_vpn_traverse( 127 int unit, 128 bcm_vxlan_vpn_traverse_cb cb, 129 void *user_data); 130 #endif 131 132 #endif /* BCM_HIDE_DISPATCHABLE */ 133 134 #if defined(INCLUDE_L3) 135 /* VXLAN port match criteria. */ 136 typedef enum bcm_vxlan_port_match_e { 137 BCM_VXLAN_PORT_MATCH_INVALID = 0, /* Illegal. */ 138 BCM_VXLAN_PORT_MATCH_NONE = 1, /* No source match criteria. */ 139 BCM_VXLAN_PORT_MATCH_PORT = 2, /* {Module, Port} or Trunk. */ 140 BCM_VXLAN_PORT_MATCH_PORT_VLAN = 3, /* Mod/port/trunk + outer VLAN. */ 141 BCM_VXLAN_PORT_MATCH_PORT_INNER_VLAN = 4, /* Mod/port/trunk + inner VLAN. */ 142 BCM_VXLAN_PORT_MATCH_PORT_VLAN_STACKED = 5, /* Mod/port/trunk + outer/inner VLAN. */ 143 BCM_VXLAN_PORT_MATCH_VLAN_PRI = 6, /* Mod/port/trunk + VLAN-PRI + VLAN-CFI. */ 144 BCM_VXLAN_PORT_MATCH_VN_ID = 7, /* Match VXLAN VN_ID */ 145 BCM_VXLAN_PORT_MATCH_SHARE = 8, /* Shared logical port */ 146 BCM_VXLAN_PORT_MATCH_PORT_ITAG = 9, /* Mod/port/trunk + inner vlan tag. */ 147 BCM_VXLAN_PORT_MATCH_COUNT = 10 /* Must be last. */ 148 } bcm_vxlan_port_match_t; 149 #endif 150 151 #if defined(INCLUDE_L3) 152 /* BCM_VXLAN_* flags. */ 153 #define BCM_VXLAN_PORT_WITH_ID (1 << 0) /* create VXLAN port with 154 specified ID */ 155 #define BCM_VXLAN_PORT_DROP (1 << 1) /* Drop matching packets */ 156 #define BCM_VXLAN_PORT_NETWORK (1 << 2) /* Network facing 157 interface */ 158 #define BCM_VXLAN_PORT_COUNTED (1 << 3) /* Maintain packet/byte 159 counts */ 160 #define BCM_VXLAN_PORT_REPLACE (1 << 4) /* Replace existing entry */ 161 #define BCM_VXLAN_PORT_INT_PRI_SET (1 << 5) /* Use Specified pri for 162 internal priority */ 163 #define BCM_VXLAN_PORT_INT_PRI_MAP (1 << 6) /* Use specified exp_map 164 for internal priority */ 165 #define BCM_VXLAN_PORT_EGRESS_TUNNEL (1 << 7) /* Specified Egress 166 tunnel is valid */ 167 #define BCM_VXLAN_PORT_SERVICE_TAGGED (1 << 8) /* Service tag mode */ 168 #define BCM_VXLAN_PORT_SERVICE_VLAN_ADD (1 << 9) /* Add SD-tag */ 169 #define BCM_VXLAN_PORT_SERVICE_VLAN_REPLACE (1 << 10) /* Replace VLAN not TPID */ 170 #define BCM_VXLAN_PORT_SERVICE_VLAN_DELETE (1 << 11) /* Delete VLAN Tag */ 171 #define BCM_VXLAN_PORT_SERVICE_VLAN_TPID_REPLACE (1 << 12) /* Replace VLAN and TPID */ 172 #define BCM_VXLAN_PORT_SERVICE_VLAN_PRI_TPID_REPLACE (1 << 13) /* Replace VLAN, VLAN-PRI 173 and TPID */ 174 #define BCM_VXLAN_PORT_SERVICE_VLAN_PRI_REPLACE (1 << 14) /* Replace VLAN and 175 VLAN-PRI */ 176 #define BCM_VXLAN_PORT_SERVICE_PRI_REPLACE (1 << 15) /* Replace VLAN-PRI only */ 177 #define BCM_VXLAN_PORT_SERVICE_TPID_REPLACE (1 << 16) /* Replace TPID only */ 178 #define BCM_VXLAN_PORT_EGRESS_OBJECT (1 << 17) /* Specified Egress 179 interface is valid */ 180 #define BCM_VXLAN_PORT_MULTICAST (1 << 19) /* Create Multicast-only 181 VXLAN Tunnel */ 182 #define BCM_VXLAN_PORT_DEFAULT (1 << 20) /* Create VXLAN Default 183 Network Port */ 184 #define BCM_VXLAN_PORT_ENABLE_VLAN_CHECKS (1 << 21) /* Enable stp check on 185 ingress physical port, 186 only for access VP 187 derived from 188 VLAN_XLATE */ 189 #define BCM_VXLAN_PORT_SHARE (1 << 22) /* Create shared 190 multicast VXLAN 191 network port */ 192 #define BCM_VXLAN_PORT_ENCAP_LOCAL (1 << 23) /* Encapsulate the VXLAN 193 tunnel on local device */ 194 #define BCM_VXLAN_PORT_TUNNEL_QOS_MAP (1 << 24) /* Use QoS mapped 195 priority for egress 196 Tunnel packet priority 197 control */ 198 #define BCM_VXLAN_PORT_TUNNEL_OUTER_VLAN_DELETE (1 << 25) /* Delete Tunnel Outer 199 VLAN Tag */ 200 #define BCM_VXLAN_PORT_TUNNEL_INNER_VLAN_DELETE (1 << 26) /* Delete Tunnel Inner 201 VLAN Tag */ 202 #define BCM_VXLAN_PORT_UDP_SRC_PORT_RANGE_ENABLE (1 << 27) /* UDP source port range 203 checking for Entropy */ 204 #define BCM_VXLAN_PORT_VPN_BASED (1 << 28) /* To specify the VP is 205 per VPN based */ 206 #define BCM_VXLAN_PORT_LOOPBACK (1 << 29) /* Loopback facing 207 interface for 2-pass 208 RIOT */ 209 #define BCM_VXLAN_PORT_NO_SPLIT_HORIZON_EGRESS (1 << 30) /* Disable split horizon 210 in egress on network 211 port */ 212 #define BCM_VXLAN_PORT_NO_SPLIT_HORIZON_INGRESS (1 << 31) /* Disable split horizon 213 in ingress on network 214 port when RIOT is 215 disabled */ 216 #endif 217 218 #if defined(INCLUDE_L3) 219 /* VXLAN Gport */ 220 typedef struct bcm_vxlan_port_s { 221 bcm_gport_t vxlan_port_id; /* GPORT identifier. */ 222 uint32 flags; /* BCM_VXLAN_PORT_xxx. */ 223 uint32 if_class; /* Interface class ID. */ 224 uint16 int_pri; /* Internal Priority */ 225 uint8 pkt_pri; /* Packet Priority */ 226 uint8 pkt_cfi; /* Packet CFI */ 227 uint16 egress_service_tpid; /* Service Vlan TPID Value */ 228 bcm_vlan_t egress_service_vlan; /* SD-TAG Vlan ID. */ 229 uint16 mtu; /* MTU */ 230 bcm_gport_t match_port; /* Match port / trunk */ 231 bcm_vxlan_port_match_t criteria; /* Match criteria */ 232 bcm_vlan_t match_vlan; /* Outer VLAN ID to match. */ 233 bcm_vlan_t match_inner_vlan; /* Inner VLAN ID to match. */ 234 bcm_gport_t egress_tunnel_id; /* Tunnel Initiator ID */ 235 bcm_gport_t match_tunnel_id; /* Tunnel Terminator ID */ 236 bcm_if_t egress_if; /* VXLAN egress object. */ 237 bcm_switch_network_group_t network_group_id; /* Split Horizon network group 238 identifier. */ 239 uint32 vnid; /* VXLAN packet VNID. */ 240 int qos_map_id; /* QoS Mapped priority */ 241 uint8 tunnel_pkt_pri; /* Tunnel Packet Priority */ 242 uint8 tunnel_pkt_cfi; /* Tunnel Packet CFI */ 243 } bcm_vxlan_port_t; 244 #endif 245 246 #if defined(INCLUDE_L3) 247 /* Initialize the VXLAN port structure. */ 248 extern void bcm_vxlan_port_t_init( 249 bcm_vxlan_port_t *vxlan_port); 250 #endif 251 252 #ifndef BCM_HIDE_DISPATCHABLE 253 254 #if defined(INCLUDE_L3) 255 /* Initialize vxlan module. */ 256 extern int bcm_vxlan_init( 257 int unit); 258 #endif 259 260 #if defined(INCLUDE_L3) 261 /* Detach vxlan module. */ 262 extern int bcm_vxlan_cleanup( 263 int unit); 264 #endif 265 266 #if defined(INCLUDE_L3) 267 /* Add Access/Network VXLAN port */ 268 extern int bcm_vxlan_port_add( 269 int unit, 270 bcm_vpn_t l2vpn, 271 bcm_vxlan_port_t *vxlan_port); 272 #endif 273 274 #if defined(INCLUDE_L3) 275 /* Delete Access/Network VXLAN port */ 276 extern int bcm_vxlan_port_delete( 277 int unit, 278 bcm_vpn_t l2vpn, 279 bcm_gport_t vxlan_port_id); 280 #endif 281 282 #if defined(INCLUDE_L3) 283 /* bcm_vxlan_port_delete_all */ 284 extern int bcm_vxlan_port_delete_all( 285 int unit, 286 bcm_vpn_t l2vpn); 287 #endif 288 289 #if defined(INCLUDE_L3) 290 /* Get Access/Network VXLAN port */ 291 extern int bcm_vxlan_port_get( 292 int unit, 293 bcm_vpn_t l2vpn, 294 bcm_vxlan_port_t *vxlan_port); 295 #endif 296 297 #if defined(INCLUDE_L3) 298 /* Get all Access/Network VXLAN port */ 299 extern int bcm_vxlan_port_get_all( 300 int unit, 301 bcm_vpn_t l2vpn, 302 int port_max, 303 bcm_vxlan_port_t *port_array, 304 int *port_count); 305 #endif 306 307 #if defined(INCLUDE_L3) 308 /* Create VXLAN Tunnel Initiator */ 309 extern int bcm_vxlan_tunnel_initiator_create( 310 int unit, 311 bcm_tunnel_initiator_t *info); 312 #endif 313 314 #if defined(INCLUDE_L3) 315 /* Destroy VXLAN Tunnel Initiator */ 316 extern int bcm_vxlan_tunnel_initiator_destroy( 317 int unit, 318 bcm_gport_t vxlan_tunnel_id); 319 #endif 320 321 #if defined(INCLUDE_L3) 322 /* Destroy all VXLAN Tunnel Initiators */ 323 extern int bcm_vxlan_tunnel_initiator_destroy_all( 324 int unit); 325 #endif 326 327 #if defined(INCLUDE_L3) 328 /* Get VXLAN Tunnel Initiator Info */ 329 extern int bcm_vxlan_tunnel_initiator_get( 330 int unit, 331 bcm_tunnel_initiator_t *info); 332 #endif 333 334 #if defined(INCLUDE_L3) 335 /* Traverse VXLAN Tunnel Initiator Info */ 336 extern int bcm_vxlan_tunnel_initiator_traverse( 337 int unit, 338 bcm_tunnel_initiator_traverse_cb cb, 339 void *user_data); 340 #endif 341 342 #if defined(INCLUDE_L3) 343 /* Create VXLAN Tunnel Terminator */ 344 extern int bcm_vxlan_tunnel_terminator_create( 345 int unit, 346 bcm_tunnel_terminator_t *info); 347 #endif 348 349 #if defined(INCLUDE_L3) 350 /* Update VXLAN Tunnel Terminator */ 351 extern int bcm_vxlan_tunnel_terminator_update( 352 int unit, 353 bcm_tunnel_terminator_t *info); 354 #endif 355 356 #if defined(INCLUDE_L3) 357 /* Destroy VXLAN Tunnel terminator */ 358 extern int bcm_vxlan_tunnel_terminator_destroy( 359 int unit, 360 bcm_gport_t vxlan_tunnel_id); 361 #endif 362 363 #if defined(INCLUDE_L3) 364 /* Destroy all VXLAN Tunnel terminators */ 365 extern int bcm_vxlan_tunnel_terminator_destroy_all( 366 int unit); 367 #endif 368 369 #if defined(INCLUDE_L3) 370 /* Get VXLAN Tunnel terminator Info */ 371 extern int bcm_vxlan_tunnel_terminator_get( 372 int unit, 373 bcm_tunnel_terminator_t *info); 374 #endif 375 376 #if defined(INCLUDE_L3) 377 /* Traverse VXLAN Tunnel Terminator Info */ 378 extern int bcm_vxlan_tunnel_terminator_traverse( 379 int unit, 380 bcm_tunnel_terminator_traverse_cb cb, 381 void *user_data); 382 #endif 383 384 #endif /* BCM_HIDE_DISPATCHABLE */ 385 386 /* Ingress and Egress statistics maintained per Vxlan. */ 387 typedef enum bcm_vxlan_stat_e { 388 bcmVxlanInPackets = 0, /* Packets that ingress on the vxlan */ 389 bcmVxlanOutPackets = 1, /* Packets that egress on the vxlan */ 390 bcmVxlanInBytes = 2, /* Bytes that ingress on the vxlan */ 391 bcmVxlanOutBytes = 3 /* Bytes that egress on the vxlan */ 392 } bcm_vxlan_stat_t; 393 394 /* Ingress statistics maintained per Vxlan Dip. */ 395 typedef enum bcm_vxlan_dip_stat_e { 396 bcmVxlanDipInPackets = 0, /* Packets that ingress on the Vxlan Dip . */ 397 bcmVxlanDipInBytes = 1 /* Bytes that ingress on the Vxlan Dip . */ 398 } bcm_vxlan_dip_stat_t; 399 400 #ifndef BCM_HIDE_DISPATCHABLE 401 402 /* Attach counter entries to the given vxlan port and vpn. */ 403 extern int bcm_vxlan_stat_attach( 404 int unit, 405 bcm_gport_t port, 406 bcm_vpn_t vpn, 407 uint32 stat_counter_id); 408 409 /* Detach counter entries to the given vxlan port and vpn. */ 410 extern int bcm_vxlan_stat_detach( 411 int unit, 412 bcm_gport_t port, 413 bcm_vpn_t vpn); 414 415 /* Get Vxlan counter value for specified vxlan port and vpn */ 416 extern int bcm_vxlan_stat_counter_get( 417 int unit, 418 bcm_gport_t port, 419 bcm_vpn_t vpn, 420 bcm_vxlan_stat_t stat, 421 uint32 num_entries, 422 uint32 *counter_indexes, 423 bcm_stat_value_t *counter_values); 424 425 /* Get Vxlan counter value for specified vxlan port and vpn */ 426 extern int bcm_vxlan_stat_counter_sync_get( 427 int unit, 428 bcm_gport_t port, 429 bcm_vpn_t vpn, 430 bcm_vxlan_stat_t stat, 431 uint32 num_entries, 432 uint32 *counter_indexes, 433 bcm_stat_value_t *counter_values); 434 435 /* Set Vxlan counter value for specified vxlan port and vpn */ 436 extern int bcm_vxlan_stat_counter_set( 437 int unit, 438 bcm_gport_t port, 439 bcm_vpn_t vpn, 440 bcm_vxlan_stat_t stat, 441 uint32 num_entries, 442 uint32 *counter_indexes, 443 bcm_stat_value_t *counter_values); 444 445 /* Get 64-bit counter value for multiple vxlan statistic types. */ 446 extern int bcm_vxlan_stat_multi_get( 447 int unit, 448 bcm_gport_t port, 449 bcm_vpn_t vpn, 450 int nstat, 451 bcm_vxlan_stat_t *stat_arr, 452 uint64 *value_arr); 453 454 /* Get lower 32-bit counter value for multiple Vxlan statistic types. */ 455 extern int bcm_vxlan_stat_multi_get32( 456 int unit, 457 bcm_gport_t port, 458 bcm_vpn_t vpn, 459 int nstat, 460 bcm_vxlan_stat_t *stat_arr, 461 uint32 *value_arr); 462 463 /* Set 64-bit counter value for multiple vxlan statistic types. */ 464 extern int bcm_vxlan_stat_multi_set( 465 int unit, 466 bcm_gport_t port, 467 bcm_vpn_t vpn, 468 int nstat, 469 bcm_vxlan_stat_t *stat_arr, 470 uint64 *value_arr); 471 472 /* Set lower 32-bit counter value for multiple Vxlan statistic types. */ 473 extern int bcm_vxlan_stat_multi_set32( 474 int unit, 475 bcm_gport_t port, 476 bcm_vpn_t vpn, 477 int nstat, 478 bcm_vxlan_stat_t *stat_arr, 479 uint32 *value_arr); 480 481 /* Provide stat counter ids associated with given vxlan port and vpn */ 482 extern int bcm_vxlan_stat_id_get( 483 int unit, 484 bcm_gport_t port, 485 bcm_vpn_t vpn, 486 bcm_vxlan_stat_t stat, 487 uint32 *stat_counter_id); 488 489 /* 490 * Enable/disable collection of statistics on the indicated vxlan port 491 * and vpn. 492 */ 493 extern int bcm_vxlan_stat_enable_set( 494 int unit, 495 bcm_gport_t port, 496 bcm_vpn_t vpn, 497 int enable); 498 499 /* Attach counters entries to the given VXLAN DIP. */ 500 extern int bcm_vxlan_dip_stat_attach( 501 int unit, 502 bcm_ip_t vxlan_dip, 503 uint32 stat_counter_id); 504 505 /* Detach counters entries to the given VXLAN DIP. */ 506 extern int bcm_vxlan_dip_stat_detach( 507 int unit, 508 bcm_ip_t vxlan_dip); 509 510 /* Get the specified counter statistic for an VXLAN DIP. */ 511 extern int bcm_vxlan_dip_stat_counter_get( 512 int unit, 513 bcm_ip_t vxlan_dip, 514 bcm_vxlan_dip_stat_t stat, 515 uint32 num_entries, 516 uint32 *counter_indexes, 517 bcm_stat_value_t *counter_values); 518 519 /* Set the specified counter statistic for an VXLAN DIP. */ 520 extern int bcm_vxlan_dip_stat_counter_set( 521 int unit, 522 bcm_ip_t vxlan_dip, 523 bcm_vxlan_dip_stat_t stat, 524 uint32 num_entries, 525 uint32 *counter_indexes, 526 bcm_stat_value_t *counter_values); 527 528 /* Get 64-bit counter value for multiple VXLAN DIP statistic types. */ 529 extern int bcm_vxlan_dip_stat_multi_get( 530 int unit, 531 bcm_ip_t vxlan_dip, 532 int nstat, 533 bcm_vxlan_dip_stat_t *stat_arr, 534 uint64 *value_arr); 535 536 /* Get 32-bit counter value for multiple VXLAN DIP statistic types. */ 537 extern int bcm_vxlan_dip_stat_multi_get32( 538 int unit, 539 bcm_ip_t vxlan_dip, 540 int nstat, 541 bcm_vxlan_dip_stat_t *stat_arr, 542 uint32 *value_arr); 543 544 /* Set 64-bit counter value for multiple VXLAN DIP statistic types. */ 545 extern int bcm_vxlan_dip_stat_multi_set( 546 int unit, 547 bcm_ip_t vxlan_dip, 548 int nstat, 549 bcm_vxlan_dip_stat_t *stat_arr, 550 uint64 *value_arr); 551 552 /* Set 32-bit counter value for multiple VXLAN DIP statistic types. */ 553 extern int bcm_vxlan_dip_stat_multi_set32( 554 int unit, 555 bcm_ip_t vxlan_dip, 556 int nstat, 557 bcm_vxlan_dip_stat_t *stat_arr, 558 uint32 *value_arr); 559 560 /* Retrieve associated stat counter for given VXLAN DIP. */ 561 extern int bcm_vxlan_dip_stat_id_get( 562 int unit, 563 bcm_ip_t vxlan_dip, 564 bcm_vxlan_dip_stat_t stat, 565 uint32 *stat_counter_id); 566 567 #endif /* BCM_HIDE_DISPATCHABLE */ 568 569 /* VXLAN port callback function prototype */ 570 #if defined(INCLUDE_L3) 571 typedef int(*bcm_vxlan_port_traverse_cb)( 572 int unit, 573 bcm_vxlan_port_t *info, 574 void *user_data); 575 #endif 576 577 #ifndef BCM_HIDE_DISPATCHABLE 578 579 #if defined(INCLUDE_L3) 580 /* Traverse VXLAN-PORT */ 581 extern int bcm_vxlan_port_traverse( 582 int unit, 583 bcm_vxlan_port_traverse_cb cb, 584 void *user_data); 585 #endif 586 587 #endif /* BCM_HIDE_DISPATCHABLE */ 588 589 #if defined(INCLUDE_L3) 590 /* Invalid VXLAN VNI. */ 591 #define BCM_VXLAN_VNI_INVALID -1 /* Invalid VXLAN VNI */ 592 #endif 593 594 #if defined(INCLUDE_L3) 595 /* VXLAN Network Domain Config Structure. */ 596 typedef struct bcm_vxlan_network_domain_config_s { 597 uint32 flags; /* BCM_VXLAN_NETWORK_DOMAIN_CONFIG_XXX. */ 598 uint32 vsi; /* Virtual switch instance. Populated for l2 599 mapping only. */ 600 bcm_vrf_t vrf; /* Virtual router instance. Populated for l3 601 mapping only. */ 602 uint32 network_domain; /* Network identifier. Used to distinct between 603 multiple network. */ 604 uint32 vni; /* VXLAN packet VNID. */ 605 int qos_map_id; /* QoS Mapped priority */ 606 bcm_gport_t vlan_port_id; /* Vlan gport identifier */ 607 } bcm_vxlan_network_domain_config_t; 608 #endif 609 610 #if defined(INCLUDE_L3) 611 /* Flags for bcm_vxlan_network_domain_config_t. */ 612 #define BCM_VXLAN_NETWORK_DOMAIN_CONFIG_INGRESS_ONLY 0x00000001 /* Add only ingress 613 mapping. */ 614 #define BCM_VXLAN_NETWORK_DOMAIN_CONFIG_EGRESS_ONLY 0x00000002 /* Add only egress 615 mapping. */ 616 #define BCM_VXLAN_NETWORK_DOMAIN_CONFIG_L2_MAPPING 0x00000004 /* Add L2 mapping. */ 617 #define BCM_VXLAN_NETWORK_DOMAIN_CONFIG_L3_MAPPING 0x00000008 /* Add L3 mapping. */ 618 #define BCM_VXLAN_NETWORK_DOMAIN_CONFIG_REPLACE 0x00000010 /* Replace the mapping. */ 619 #endif 620 621 #if defined(INCLUDE_L3) 622 /* VXLAN Network Domain Config Structure. */ 623 typedef struct bcm_vxlan_network_domain_config_additional_info_s { 624 uint32 flags; /* BCM_VXLAN_NETWORK_DOMAIN_CONFIG_XXX. */ 625 } bcm_vxlan_network_domain_config_additional_info_t; 626 #endif 627 628 #if defined(INCLUDE_L3) 629 /* Initialize the VXLAN Network domain structure. */ 630 extern void bcm_vxlan_network_domain_config_t_init( 631 bcm_vxlan_network_domain_config_t *config); 632 #endif 633 634 /* VXLAN port callback function prototype */ 635 #if defined(INCLUDE_L3) 636 typedef int(*bcm_vxlan_network_domain_config_traverse_cb)( 637 int unit, 638 bcm_vxlan_network_domain_config_t *info, 639 void *user_data); 640 #endif 641 642 #ifndef BCM_HIDE_DISPATCHABLE 643 644 #if defined(INCLUDE_L3) 645 /* Add a local identifier (vsi or vrf) with a VNI mapping. */ 646 extern int bcm_vxlan_network_domain_config_add( 647 int unit, 648 bcm_vxlan_network_domain_config_t *config); 649 #endif 650 651 #if defined(INCLUDE_L3) 652 /* Get local identifier (vsi or vrf) with VNI mapping. */ 653 extern int bcm_vxlan_network_domain_config_get( 654 int unit, 655 bcm_vxlan_network_domain_config_t *config); 656 #endif 657 658 #if defined(INCLUDE_L3) 659 /* Remove local identifier (vsi or vrf) with VNI mapping. */ 660 extern int bcm_vxlan_network_domain_config_remove( 661 int unit, 662 bcm_vxlan_network_domain_config_t *config); 663 #endif 664 665 #if defined(INCLUDE_L3) 666 /* Traverse local identifier (vsi or vrf) with VNI mapping */ 667 extern int bcm_vxlan_network_domain_config_traverse( 668 int unit, 669 bcm_vxlan_network_domain_config_additional_info_t *additional_info, 670 bcm_vxlan_network_domain_config_traverse_cb cb, 671 void *user_data); 672 #endif 673 674 #endif /* defined(INCLUDE_L3) */ 675 676 #endif /* BCM_HIDE_DISPATCHABLE */ 677 678 #endif /* __BCM_VXLAN_H__ */