-
Notifications
You must be signed in to change notification settings - Fork 475
/
saiswitch.h
3692 lines (3256 loc) · 101 KB
/
saiswitch.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Copyright (c) 2014 Microsoft Open Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
* LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS
* FOR A PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
*
* See the Apache Version 2.0 License for specific language governing
* permissions and limitations under the License.
*
* Microsoft would like to thank the following companies for their review and
* assistance with these files: Intel Corporation, Mellanox Technologies Ltd,
* Dell Products, L.P., Facebook, Inc., Marvell International Ltd.
*
* @file saiswitch.h
*
* @brief This module defines SAI Switch interface
*/
#if !defined (__SAISWITCH_H_)
#define __SAISWITCH_H_
#include <saitypes.h>
/**
* @defgroup SAISWITCH SAI - Switch specific API definitions
*
* @{
*/
/**
* @brief Maximum Hardware ID Length
*/
#define SAI_MAX_HARDWARE_ID_LEN 255
/**
* @brief Maximum Firmware Path Name Length
*/
#define SAI_MAX_FIRMWARE_PATH_NAME_LEN PATH_MAX
/**
* @brief Attribute data for #SAI_SWITCH_ATTR_OPER_STATUS
*/
typedef enum _sai_switch_oper_status_t
{
/** Unknown */
SAI_SWITCH_OPER_STATUS_UNKNOWN,
/** Up */
SAI_SWITCH_OPER_STATUS_UP,
/** Down */
SAI_SWITCH_OPER_STATUS_DOWN,
/** Switch encountered a fatal error */
SAI_SWITCH_OPER_STATUS_FAILED,
} sai_switch_oper_status_t;
/**
* @brief Attribute data for packet action
*/
typedef enum _sai_packet_action_t
{
/* Basic Packet Actions */
/*
* These could be further classified based on the nature of action
* - Data Plane Packet Actions
* - CPU Path Packet Actions
*/
/*
* Data Plane Packet Actions.
*
* Following two packet actions only affect the packet action on the data plane.
* Packet action on the CPU path remains unchanged.
*/
/** Drop Packet in data plane */
SAI_PACKET_ACTION_DROP,
/** Forward Packet in data plane. */
SAI_PACKET_ACTION_FORWARD,
/*
* CPU Path Packet Actions.
*
* Following two packet actions only affect the packet action on the CPU path.
* Packet action on the data plane remains unchanged.
*/
/**
* @brief Packet action copy
*
* Copy Packet to CPU without interfering the original packet action in the
* pipeline.
*/
SAI_PACKET_ACTION_COPY,
/** Cancel copy the packet to CPU. */
SAI_PACKET_ACTION_COPY_CANCEL,
/** Combination of Packet Actions */
/**
* @brief Packet action trap
*
* This is a combination of SAI packet action COPY and DROP:
* A copy of the original packet is sent to CPU port, the original
* packet is forcefully dropped from the pipeline.
*/
SAI_PACKET_ACTION_TRAP,
/**
* @brief Packet action log
*
* This is a combination of SAI packet action COPY and FORWARD:
* A copy of the original packet is sent to CPU port, the original
* packet, if it was to be dropped in the original pipeline,
* change the pipeline action to forward (cancel drop).
*/
SAI_PACKET_ACTION_LOG,
/** This is a combination of SAI packet action COPY_CANCEL and DROP */
SAI_PACKET_ACTION_DENY,
/** This is a combination of SAI packet action COPY_CANCEL and FORWARD */
SAI_PACKET_ACTION_TRANSIT,
/** Do not drop the packet. */
SAI_PACKET_ACTION_DONOTDROP
} sai_packet_action_t;
/**
* @brief Attribute data for number of vlan tags present in a packet
*/
typedef enum _sai_packet_vlan_t
{
/**
* @brief Untagged
*
* Packet without vlan tags.
*/
SAI_PACKET_VLAN_UNTAG,
/**
* @brief Single Outer Tag
*
* Packet outer TPID matches to the ingress port outer TPID and
* packet inner TPID if present, does not match the configured inner TPID.
*/
SAI_PACKET_VLAN_SINGLE_OUTER_TAG,
/**
* @brief Double Tag
*
* Packet outer TPID matches to the ingress port outer TPID and
* packet inner TPID matches to the configured inner TPID.
*/
SAI_PACKET_VLAN_DOUBLE_TAG
} sai_packet_vlan_t;
/**
* @brief Attribute data for #SAI_SWITCH_ATTR_SWITCHING_MODE
*/
typedef enum _sai_switch_switching_mode_t
{
/** Cut-through switching mode */
SAI_SWITCH_SWITCHING_MODE_CUT_THROUGH,
/** Store-and-forward switching mode */
SAI_SWITCH_SWITCHING_MODE_STORE_AND_FORWARD
} sai_switch_switching_mode_t;
/**
* @brief Attribute data for #SAI_SWITCH_ATTR_ECMP_DEFAULT_HASH_ALGORITHM
* and #SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_ALGORITHM
*/
typedef enum _sai_hash_algorithm_t
{
/** CRC based hash algorithm */
SAI_HASH_ALGORITHM_CRC = 0,
/** XOR-based hash algorithm */
SAI_HASH_ALGORITHM_XOR = 1,
/** Random-based hash algorithm */
SAI_HASH_ALGORITHM_RANDOM = 2,
/** Lower 16-bits of CRC32 based hash algorithm */
SAI_HASH_ALGORITHM_CRC_32LO = 3,
/** Higher 16-bits of CRC32-based hash algorithm */
SAI_HASH_ALGORITHM_CRC_32HI = 4,
/** CRC using CCITT polynomial based hash algorithm */
SAI_HASH_ALGORITHM_CRC_CCITT = 5,
/** Combination of CRC and XOR based hash algorithm */
SAI_HASH_ALGORITHM_CRC_XOR = 6,
} sai_hash_algorithm_t;
/**
* @brief Attribute data for #SAI_SWITCH_ATTR_RESTART_TYPE
*/
typedef enum _sai_switch_restart_type_t
{
/** NPU doesn't support warmboot */
SAI_SWITCH_RESTART_TYPE_NONE = 0,
/** Planned restart only */
SAI_SWITCH_RESTART_TYPE_PLANNED = 1,
/** Both planned and unplanned restart */
SAI_SWITCH_RESTART_TYPE_ANY = 2,
} sai_switch_restart_type_t;
/**
* @brief Attribute data for #SAI_SWITCH_ATTR_MCAST_SNOOPING_CAPABILITY
*/
typedef enum _sai_switch_mcast_snooping_capability_t
{
/** NPU doesn't support IP based L2MC */
SAI_SWITCH_MCAST_SNOOPING_CAPABILITY_NONE = 0,
/** *G lookup only */
SAI_SWITCH_MCAST_SNOOPING_CAPABILITY_XG = 1,
/** SG lookup only */
SAI_SWITCH_MCAST_SNOOPING_CAPABILITY_SG = 2,
/** Both *G/SG lookup supported */
SAI_SWITCH_MCAST_SNOOPING_CAPABILITY_XG_AND_SG = 3,
} sai_switch_mcast_snooping_capability_t;
/**
* @brief Attribute data for #SAI_SWITCH_ATTR_HARDWARE_ACCESS_BUS
*/
typedef enum _sai_switch_hardware_access_bus_t
{
/** Hardware access bus is MDIO */
SAI_SWITCH_HARDWARE_ACCESS_BUS_MDIO,
/** Hardware access bus is I2C */
SAI_SWITCH_HARDWARE_ACCESS_BUS_I2C,
/** Hardware access bus is CPLD */
SAI_SWITCH_HARDWARE_ACCESS_BUS_CPLD,
} sai_switch_hardware_access_bus_t;
/**
* @brief Attribute data for #SAI_SWITCH_ATTR_FIRMWARE_LOAD_METHOD
*/
typedef enum _sai_switch_firmware_load_method_t
{
/** Do not download FW. Use already downloaded FW instead */
SAI_SWITCH_FIRMWARE_LOAD_METHOD_NONE,
/** Download FW internally via MDIO */
SAI_SWITCH_FIRMWARE_LOAD_METHOD_INTERNAL,
/** Load FW from EEPROM */
SAI_SWITCH_FIRMWARE_LOAD_METHOD_EEPROM,
} sai_switch_firmware_load_method_t;
/**
* @brief Attribute data for #SAI_SWITCH_ATTR_FIRMWARE_LOAD_TYPE
*/
typedef enum _sai_switch_firmware_load_type_t
{
/** Skip firmware download if firmware is already present */
SAI_SWITCH_FIRMWARE_LOAD_TYPE_SKIP,
/** Always download the firmware specified by firmware load method */
SAI_SWITCH_FIRMWARE_LOAD_TYPE_FORCE,
/** Check the firmware version. If it is different from current version download firmware */
SAI_SWITCH_FIRMWARE_LOAD_TYPE_AUTO,
} sai_switch_firmware_load_type_t;
/**
* @brief Attribute data for #SAI_SWITCH_ATTR_TYPE
*/
typedef enum _sai_switch_type_t
{
/** Switch type is Switching Network processing unit */
SAI_SWITCH_TYPE_NPU,
/** Switch type is PHY */
SAI_SWITCH_TYPE_PHY,
/** Switch type is VOQ based NPU */
SAI_SWITCH_TYPE_VOQ,
/** Switch type is Fabric switch device */
SAI_SWITCH_TYPE_FABRIC,
/** Switch type is POE (Power over Ethernet) */
SAI_SWITCH_TYPE_POE,
} sai_switch_type_t;
/**
* @brief Attribute data for #SAI_SWITCH_ATTR_FAILOVER_CONFIG_MODE
* Used for Failover configuration mode
* In case of primary port failure, hitless enables the switch over to secondary
* port without losing link. It allows uninterrupted data transmission.
*/
typedef enum _sai_switch_failover_config_mode_t
{
/** Ports are configured but do not operate in hitless mode */
SAI_SWITCH_FAILOVER_CONFIG_MODE_NO_HITLESS,
/** Ports are configured and operate in hitless mode */
SAI_SWITCH_FAILOVER_CONFIG_MODE_HITLESS
} sai_switch_failover_config_mode_t;
/**
* @brief Defines tunnel type
*/
typedef enum _sai_tunnel_type_t
{
SAI_TUNNEL_TYPE_IPINIP,
SAI_TUNNEL_TYPE_IPINIP_GRE,
SAI_TUNNEL_TYPE_VXLAN,
SAI_TUNNEL_TYPE_MPLS,
SAI_TUNNEL_TYPE_SRV6,
SAI_TUNNEL_TYPE_NVGRE,
SAI_TUNNEL_TYPE_IPINIP_ESP,
SAI_TUNNEL_TYPE_IPINIP_UDP_ESP,
SAI_TUNNEL_TYPE_VXLAN_UDP_ESP,
} sai_tunnel_type_t;
/**
* @brief Defines VXLAN tunnel UDP source port mode
*/
typedef enum _sai_tunnel_vxlan_udp_sport_mode_t
{
/**
* @brief User define value
*/
SAI_TUNNEL_VXLAN_UDP_SPORT_MODE_USER_DEFINED,
/**
* @brief RFC6335 Computed hash value in range 49152-65535
*/
SAI_TUNNEL_VXLAN_UDP_SPORT_MODE_EPHEMERAL,
} sai_tunnel_vxlan_udp_sport_mode_t;
/**
* @brief Defines tunnel encap ECN mode
*/
typedef enum _sai_tunnel_encap_ecn_mode_t
{
/**
* @brief Normal mode behavior defined in RFC 6040
* section 4.1 copy from inner
*/
SAI_TUNNEL_ENCAP_ECN_MODE_STANDARD,
/**
* @brief User defined behavior.
*/
SAI_TUNNEL_ENCAP_ECN_MODE_USER_DEFINED
} sai_tunnel_encap_ecn_mode_t;
/**
* @brief Defines tunnel decap ECN mode
*/
typedef enum _sai_tunnel_decap_ecn_mode_t
{
/**
* @brief Behavior defined in RFC 6040 section 4.2
*/
SAI_TUNNEL_DECAP_ECN_MODE_STANDARD,
/**
* @brief Copy from outer ECN
*/
SAI_TUNNEL_DECAP_ECN_MODE_COPY_FROM_OUTER,
/**
* @brief User defined behavior
*/
SAI_TUNNEL_DECAP_ECN_MODE_USER_DEFINED
} sai_tunnel_decap_ecn_mode_t;
/**
* @brief Defines tunnel attributes at switch level.
* SAI_OBJECT_TYPE_SWITCH_TUNNEL object provides
* per tunnel type global configuration.
* SAI_OBJECT_TYPE_TUNNEL object configuration
* overrides the switch scoped global configuration.
*/
typedef enum _sai_switch_tunnel_attr_t
{
/**
* @brief Start of attributes
*/
SAI_SWITCH_TUNNEL_ATTR_START,
/**
* @brief Tunnel type key
*
* @type sai_tunnel_type_t
* @flags MANDATORY_ON_CREATE | CREATE_ONLY | KEY
* @isresourcetype true
*/
SAI_SWITCH_TUNNEL_ATTR_TUNNEL_TYPE = SAI_SWITCH_TUNNEL_ATTR_START,
/**
* @brief Packet action when a packet ingress and gets routed back to same tunnel
*
* @type sai_packet_action_t
* @flags CREATE_AND_SET
* @default SAI_PACKET_ACTION_FORWARD
*/
SAI_SWITCH_TUNNEL_ATTR_LOOPBACK_PACKET_ACTION,
/* Tunnel encap attributes */
/**
* @brief Tunnel encap ECN mode
*
* @type sai_tunnel_encap_ecn_mode_t
* @flags CREATE_ONLY
* @default SAI_TUNNEL_ENCAP_ECN_MODE_STANDARD
*/
SAI_SWITCH_TUNNEL_ATTR_TUNNEL_ENCAP_ECN_MODE,
/**
* @brief Tunnel encap ECN mappers only
*
* @type sai_object_list_t
* @flags CREATE_ONLY
* @objects SAI_OBJECT_TYPE_TUNNEL_MAP
* @default empty
*/
SAI_SWITCH_TUNNEL_ATTR_ENCAP_MAPPERS,
/* Tunnel decap attributes */
/**
* @brief Tunnel decap ECN mode
*
* @type sai_tunnel_decap_ecn_mode_t
* @flags CREATE_ONLY
* @default SAI_TUNNEL_DECAP_ECN_MODE_STANDARD
*/
SAI_SWITCH_TUNNEL_ATTR_TUNNEL_DECAP_ECN_MODE,
/**
* @brief Tunnel decap ECN mappers only
*
* @type sai_object_list_t
* @flags CREATE_ONLY
* @objects SAI_OBJECT_TYPE_TUNNEL_MAP
* @default empty
*/
SAI_SWITCH_TUNNEL_ATTR_DECAP_MAPPERS,
/**
* @brief Tunnel VXLAN UDP source port mode
*
* @type sai_tunnel_vxlan_udp_sport_mode_t
* @flags CREATE_AND_SET
* @default SAI_TUNNEL_VXLAN_UDP_SPORT_MODE_EPHEMERAL
*/
SAI_SWITCH_TUNNEL_ATTR_TUNNEL_VXLAN_UDP_SPORT_MODE,
/**
* @brief Tunnel UDP source port
*
* @type sai_uint16_t
* @flags CREATE_AND_SET
* @isvlan false
* @default 0
* @validonly SAI_SWITCH_TUNNEL_ATTR_TUNNEL_TYPE == SAI_TUNNEL_TYPE_VXLAN and SAI_SWITCH_TUNNEL_ATTR_TUNNEL_VXLAN_UDP_SPORT_MODE == SAI_TUNNEL_VXLAN_UDP_SPORT_MODE_USER_DEFINED
*/
SAI_SWITCH_TUNNEL_ATTR_VXLAN_UDP_SPORT,
/**
* @brief Tunnel UDP source port mask
*
* Sport mask defining the number of least significant bits
* reserved for the calculated hash value. 0 means a fixed value.
*
* @type sai_uint8_t
* @flags CREATE_AND_SET
* @isvlan false
* @default 0
* @validonly SAI_SWITCH_TUNNEL_ATTR_TUNNEL_TYPE == SAI_TUNNEL_TYPE_VXLAN and SAI_SWITCH_TUNNEL_ATTR_TUNNEL_VXLAN_UDP_SPORT_MODE == SAI_TUNNEL_VXLAN_UDP_SPORT_MODE_USER_DEFINED
*/
SAI_SWITCH_TUNNEL_ATTR_VXLAN_UDP_SPORT_MASK,
/**
* @brief Enable TC AND COLOR -> DSCP MAP on tunnel at encapsulation (access-to-network) node to remark the DSCP in tunnel header
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_QOS_MAP
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_SWITCH_TUNNEL_ATTR_ENCAP_QOS_TC_AND_COLOR_TO_DSCP_MAP,
/**
* @brief Enable TC -> Queue MAP on tunnel encap
*
* Map id = #SAI_NULL_OBJECT_ID to disable map on tunnel.
* Default no map, i.e. packets are queued with static mapping.
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_QOS_MAP
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_SWITCH_TUNNEL_ATTR_ENCAP_QOS_TC_TO_QUEUE_MAP,
/**
* @brief Enable DSCP -> TC MAP on tunnel at termination (Network-to-access) node.
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_QOS_MAP
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_SWITCH_TUNNEL_ATTR_DECAP_QOS_DSCP_TO_TC_MAP,
/**
* @brief Enable TC -> Priority Group MAP
*
* Map id = #SAI_NULL_OBJECT_ID to disable map on port.
* Default no map
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_QOS_MAP
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_SWITCH_TUNNEL_ATTR_DECAP_QOS_TC_TO_PRIORITY_GROUP_MAP,
/**
* @brief End of attributes
*/
SAI_SWITCH_TUNNEL_ATTR_END,
/** Custom range base value */
SAI_SWITCH_TUNNEL_ATTR_CUSTOM_RANGE_START = 0x10000000,
/** End of custom range base */
SAI_SWITCH_TUNNEL_ATTR_CUSTOM_RANGE_END
} sai_switch_tunnel_attr_t;
/**
* @brief Attribute data for SAI_SWITCH_ATTR_HOSTIF_OPER_STATUS_UPDATE_MODE.
*/
typedef enum _sai_switch_hostif_oper_status_update_mode_t
{
/**
* @brief Application mode.
*
* In this mode, operational status of hostif must be updated by application
* using hostif API with SAI_HOSTIF_ATTR_OPER_STATUS attribute. SAI adapter
* should not update the hostif operational status internally.
* When a host interface is created, application must update the operational
* status if required and should not rely on SAI adapter to update it.
*/
SAI_SWITCH_HOSTIF_OPER_STATUS_UPDATE_MODE_APPLICATION = 0,
/**
* @brief SAI adapter mode.
*
* In this mode, operational status of hostif is updated internally by SAI
* adapter. Update of hostif operational status by application using hostif
* API with SAI_HOSTIF_ATTR_OPER_STATUS is ignored.
*/
SAI_SWITCH_HOSTIF_OPER_STATUS_UPDATE_MODE_SAI_ADAPTER = 1,
} sai_switch_hostif_oper_status_update_mode_t;
/**
* @brief Attribute Id in sai_set_switch_attribute() and
* sai_get_switch_attribute() calls.
*/
typedef enum _sai_switch_attr_t
{
/**
* @brief Start of attributes
*/
SAI_SWITCH_ATTR_START,
/**
* @brief Number of active(created) ports on the switch
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_NUMBER_OF_ACTIVE_PORTS = SAI_SWITCH_ATTR_START,
/** @ignore - for backward compatibility */
SAI_SWITCH_ATTR_PORT_NUMBER = SAI_SWITCH_ATTR_NUMBER_OF_ACTIVE_PORTS,
/**
* @brief Maximum number of supported ports on the switch
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_MAX_NUMBER_OF_SUPPORTED_PORTS,
/**
* @brief Get the port list
*
* @type sai_object_list_t
* @flags READ_ONLY
* @objects SAI_OBJECT_TYPE_PORT
* @default internal
*/
SAI_SWITCH_ATTR_PORT_LIST,
/**
* @brief Get the Max MTU in bytes, supported by the switch
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_PORT_MAX_MTU,
/**
* @brief Get the CPU Port
*
* @type sai_object_id_t
* @flags READ_ONLY
* @objects SAI_OBJECT_TYPE_PORT
* @default internal
*/
SAI_SWITCH_ATTR_CPU_PORT,
/**
* @brief Max number of virtual routers supported
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_MAX_VIRTUAL_ROUTERS,
/**
* @brief The size of the FDB Table in bytes
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_FDB_TABLE_SIZE,
/**
* @brief The L3 Host Table size
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_L3_NEIGHBOR_TABLE_SIZE,
/**
* @brief The L3 Route Table size
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_L3_ROUTE_TABLE_SIZE,
/**
* @brief Number of ports that can be part of a LAG
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_LAG_MEMBERS,
/**
* @brief Number of LAGs that can be created
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_NUMBER_OF_LAGS,
/**
* @brief ECMP number of members per group
*
* Default is 64
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_ECMP_MEMBERS,
/**
* @brief ECMP number of group
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_NUMBER_OF_ECMP_GROUPS,
/**
* @brief The number of Unicast queues per port
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_NUMBER_OF_UNICAST_QUEUES,
/**
* @brief The number of Multicast queues per port
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_NUMBER_OF_MULTICAST_QUEUES,
/**
* @brief The total number of queues per port
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_NUMBER_OF_QUEUES,
/**
* @brief The number of CPU queues
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_NUMBER_OF_CPU_QUEUES,
/**
* @brief Local subnet routing supported.
*
* Routes with next hop set to "on-link".
*
* @type bool
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_ON_LINK_ROUTE_SUPPORTED,
/**
* @brief Operational state
*
* @type sai_switch_oper_status_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_OPER_STATUS,
/**
* @brief Maximum number of temperature sensors available.
*
* @type sai_uint8_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_MAX_NUMBER_OF_TEMP_SENSORS,
/**
* @brief List of temperature readings from all sensors.
*
* Values in Celsius.
*
* @type sai_s32_list_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_TEMP_LIST,
/**
* @brief The current value of the maximum temperature
* retrieved from the switch sensors
*
* Value in Celsius.
*
* @type sai_int32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_MAX_TEMP,
/**
* @brief The average of temperature readings over all
* sensors in the switch
*
* Value in Celsius.
*
* @type sai_int32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_AVERAGE_TEMP,
/**
* @brief Minimum priority for ACL table
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_ACL_TABLE_MINIMUM_PRIORITY,
/**
* @brief Maximum priority for ACL table
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_ACL_TABLE_MAXIMUM_PRIORITY,
/**
* @brief Minimum priority for ACL entry
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_ACL_ENTRY_MINIMUM_PRIORITY,
/**
* @brief Maximum priority for ACL entry
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_ACL_ENTRY_MAXIMUM_PRIORITY,
/**
* @brief Minimum priority for ACL table group
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_ACL_TABLE_GROUP_MINIMUM_PRIORITY,
/**
* @brief Maximum priority for ACL table group
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_ACL_TABLE_GROUP_MAXIMUM_PRIORITY,
/**
* @brief FDB DST user-based meta data range
*
* @type sai_u32_range_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_FDB_DST_USER_META_DATA_RANGE,
/**
* @brief Route DST Table user-based meta data range
*
* @type sai_u32_range_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_ROUTE_DST_USER_META_DATA_RANGE,
/**
* @brief Neighbor DST Table user-based meta data range
*
* @type sai_u32_range_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_NEIGHBOR_DST_USER_META_DATA_RANGE,
/**
* @brief Port user-based meta data range
*
* @type sai_u32_range_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_PORT_USER_META_DATA_RANGE,
/**
* @brief VLAN user-based meta data range
*
* @type sai_u32_range_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_VLAN_USER_META_DATA_RANGE,
/**
* @brief ACL user-based ACL meta data range
*
* @type sai_u32_range_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_ACL_USER_META_DATA_RANGE,
/**
* @brief ACL user-based trap id range
*
* @type sai_u32_range_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_ACL_USER_TRAP_ID_RANGE,
/**
* @brief Default SAI VLAN ID
*
* @type sai_object_id_t
* @flags READ_ONLY
* @objects SAI_OBJECT_TYPE_VLAN
* @default internal
*/
SAI_SWITCH_ATTR_DEFAULT_VLAN_ID,
/**
* @brief Default SAI STP instance ID
*
* @type sai_object_id_t
* @flags READ_ONLY
* @objects SAI_OBJECT_TYPE_STP
* @default internal
*/
SAI_SWITCH_ATTR_DEFAULT_STP_INST_ID,
/**
* @brief Max number of STP instances that NPU supports
*
* @type sai_uint32_t
* @flags READ_ONLY
*/
SAI_SWITCH_ATTR_MAX_STP_INSTANCE,
/**
* @brief Default SAI Virtual Router ID
*
* Must return #SAI_STATUS_OBJECT_IN_USE when try to delete this VR ID.
*
* @type sai_object_id_t
* @flags READ_ONLY
* @objects SAI_OBJECT_TYPE_VIRTUAL_ROUTER
* @default internal
*/
SAI_SWITCH_ATTR_DEFAULT_VIRTUAL_ROUTER_ID,
/**
* @brief Default SAI Override Virtual Router ID
*
* Must return #SAI_STATUS_OBJECT_IN_USE when try to delete this VR ID.
*
* @type sai_object_id_t
* @flags READ_ONLY
* @objects SAI_OBJECT_TYPE_VIRTUAL_ROUTER
* @default internal
*/
SAI_SWITCH_ATTR_DEFAULT_OVERRIDE_VIRTUAL_ROUTER_ID,
/**
* @brief Default .1Q Bridge ID
*
* @type sai_object_id_t
* @flags READ_ONLY
* @objects SAI_OBJECT_TYPE_BRIDGE
* @default internal
*/
SAI_SWITCH_ATTR_DEFAULT_1Q_BRIDGE_ID,
/**
* @brief Switch/Global bind point for ingress ACL object
*
* Bind (or unbind) an ingress ACL table or ACL group globally. Enable/Update
* ingress ACL table or ACL group filtering by assigning a valid
* object id. Disable ingress filtering by assigning SAI_NULL_OBJECT_ID
* in the attribute value.
*